Merge branch 'master' of https://github.com/Anuken/Mindustry into 7.0-features
This commit is contained in:
@@ -29,7 +29,7 @@ task deploy(type: Copy){
|
||||
}
|
||||
|
||||
android{
|
||||
buildToolsVersion '30.0.2'
|
||||
buildToolsVersion '30.0.3'
|
||||
compileSdkVersion 30
|
||||
sourceSets{
|
||||
main{
|
||||
@@ -139,8 +139,8 @@ dependencies{
|
||||
gpImplementation "com.google.android.gms:play-services-games:21.0.0"
|
||||
gpImplementation "com.google.android.gms:play-services-auth:19.0.0"
|
||||
|
||||
//android dependencies magically disappear during compilation, thanks gradle!
|
||||
def sdkFile = new File((String)findSdkDir(), "/platforms/android-29/android.jar")
|
||||
//TODO dynamically find best android platform jar instead of hard-coding to 30
|
||||
def sdkFile = new File((String)findSdkDir(), "/platforms/android-30/android.jar")
|
||||
if(sdkFile.exists()) compileOnly files(sdkFile.absolutePath)
|
||||
}
|
||||
|
||||
|
||||
22
build.gradle
22
build.gradle
@@ -13,28 +13,10 @@ buildscript{
|
||||
google()
|
||||
maven{ url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||
maven{ url 'https://jitpack.io' }
|
||||
|
||||
//fake repository to download my patched robovm jar from
|
||||
ivy{
|
||||
url 'https://github.com/'
|
||||
|
||||
patternLayout {
|
||||
artifact '/[organisation]/[module]/raw/a-single-jar-file/[revision].jar'
|
||||
}
|
||||
|
||||
// This is required in Gradle 6.0+ as metadata file (ivy.xml)
|
||||
// is mandatory. Docs linked below this code section
|
||||
metadataSources { artifact() }
|
||||
}
|
||||
}
|
||||
|
||||
dependencies{
|
||||
//use local, patched robovm gradle plugin until my PR for gradle 7.0 support is merged
|
||||
//https://github.com/Anuken/robovm/raw/a-single-jar-file/robovm-gradle-plugin-2.3.14-SNAPSHOT.jar
|
||||
classpath "Anuken:robovm:robovm-gradle-plugin-2.3.14-SNAPSHOT"
|
||||
//needed for plugin above
|
||||
classpath "com.mobidevelop.robovm:robovm-dist-compiler:2.3.13"
|
||||
|
||||
classpath "com.mobidevelop.robovm:robovm-gradle-plugin:2.3.14"
|
||||
classpath "com.github.Anuken.Arc:packer:$arcHash"
|
||||
classpath "com.github.Anuken.Arc:arc-core:$arcHash"
|
||||
}
|
||||
@@ -285,7 +267,7 @@ project(":ios"){
|
||||
props.load(new FileInputStream(vfile))
|
||||
}else{
|
||||
props['app.id'] = 'io.anuke.mindustry'
|
||||
props['app.version'] = '6.0'
|
||||
props['app.version'] = '7.0'
|
||||
props['app.mainclass'] = 'mindustry.IOSLauncher'
|
||||
props['app.executable'] = 'IOSLauncher'
|
||||
props['app.name'] = 'Mindustry'
|
||||
|
||||
@@ -217,7 +217,7 @@ hosts.none = [lightgray]No se han encontrado partidas en LAN
|
||||
host.invalid = [scarlet]No se pudo conectar con el anfitrión
|
||||
|
||||
servers.local = Servidores Locales
|
||||
servers.local.steam = Partidas Públicas y Lervidores Locales
|
||||
servers.local.steam = Partidas Públicas y Servidores Locales
|
||||
servers.remote = Servidores Remotos
|
||||
servers.global = Servidores de la Comunidad
|
||||
|
||||
|
||||
@@ -78,13 +78,12 @@ schematic.tagexists = Такой тег уже существует.
|
||||
|
||||
stats = Статистика
|
||||
stat.wave = Волн отражено:[accent] {0}
|
||||
stat.unitsCreated = Единиц создано:[accent] {0}
|
||||
stat.enemiesDestroyed = Врагов уничтожено:[accent] {0}
|
||||
stat.built = Строений построено:[accent] {0}
|
||||
stat.destroyed = Строений уничтожено:[accent] {0}
|
||||
stat.deconstructed = Строений разобрано:[accent] {0}
|
||||
stat.delivered = Ресурсов запущено:
|
||||
stat.playtime = Время игры:[accent] {0}
|
||||
stat.rank = Финальный ранг: [accent]{0}
|
||||
|
||||
globalitems = [accent]Общие предметы
|
||||
map.delete = Вы действительно хотите удалить карту «[accent]{0}[]»?
|
||||
@@ -392,6 +391,8 @@ waves.load = Загрузить из буфера обмена
|
||||
waves.invalid = Неверные волны в буфере обмена.
|
||||
waves.copied = Волны скопированы.
|
||||
waves.none = Враги не были определены.\nОбратите внимание, что пустые волны будут автоматически заменены обычной волной.
|
||||
waves.units.hide = Скрыть все
|
||||
waves.units.show = Показать все
|
||||
|
||||
#these are intentionally in lower case
|
||||
wavemode.counts = количество единиц
|
||||
@@ -444,6 +445,7 @@ editor.overwrite = [accent]Внимание!\nЭто перезапишет уж
|
||||
editor.overwrite.confirm = [scarlet]Осторожно![] Карта с таким названием уже существует. Вы действительно хотите её перезаписать?\n«[accent]{0}[]»
|
||||
editor.exists = Карта с таким именем уже существует.
|
||||
editor.selectmap = Выберите карту для загрузки:
|
||||
editor.cliffs = Стены на скалы
|
||||
|
||||
toolmode.replace = Заменить
|
||||
toolmode.replace.description = Рисует только\nна сплошных блоках.
|
||||
@@ -649,6 +651,7 @@ status.overclock.name = Разгон
|
||||
status.shocked.name = Шок
|
||||
status.blasted.name = Разрыв
|
||||
status.unmoving.name = Обездвиживание
|
||||
status.boss.name = Страж
|
||||
|
||||
settings.language = Язык
|
||||
settings.data = Игровые данные
|
||||
@@ -1137,6 +1140,7 @@ block.core-shard.name = Ядро: «Осколок»
|
||||
block.core-foundation.name = Ядро: «Штаб»
|
||||
block.core-nucleus.name = Ядро: «Атом»
|
||||
block.deep-water.name = Глубоководье
|
||||
block.deep-tainted-water.name = Загрязнённое глубоководье
|
||||
block.shallow-water.name = Вода
|
||||
block.tainted-water.name = Загрязнённая вода
|
||||
block.darksand-tainted-water.name = Тёмный песок с загрязнённой водой
|
||||
@@ -1374,6 +1378,7 @@ hint.coreUpgrade = Ядра могут быть улучшены путем [acc
|
||||
hint.presetLaunch = В серые [accent]секторы с посадочными зонами[], такие как [accent]Ледяной лес[], можно запускаться из любого места. Они не требуют захвата близлежащей территории.\n\n[accent]Нумерованные секторы[], такие как этот, [accent]не обязательны[] для прохождения.
|
||||
hint.coreIncinerate = После того, как ядро будет заполнено предметом до отказа, любые лишние входящие предметы этого типа будут [accent]сожжены[].
|
||||
hint.coopCampaign = Во время игры в [accent]кампанию по сети[], произведённые на текущей карте предметы будут также отправлены [accent]на ваши локальные секторы[].\n\nЛюбое исследование со стороны хоста также будет перенесено.
|
||||
hint.presetDifficulty = У этого сектора [scarlet]высокий уровень угрозы[].\nЗапуск на такие сектора [accent]не рекомендуется[] без достаточных технологий и подготовки.
|
||||
|
||||
item.copper.description = Используется во всех типах построек и боеприпасов.
|
||||
item.copper.details = Медь. Аномально широко распространённый металл на Серпуло. Структурно слабый, если не укреплён.
|
||||
|
||||
@@ -40,7 +40,7 @@ public class Vars implements Loadable{
|
||||
public static boolean loadLocales = true;
|
||||
/** Whether the logger is loaded. */
|
||||
public static boolean loadedLogger = false, loadedFileLogger = false;
|
||||
/** Whether to enable various experimental features (e.g. cliffs) */
|
||||
/** Whether to enable various experimental features (e.g. spawn positions for spawn groups) */
|
||||
public static boolean experimental = false;
|
||||
/** Name of current Steam player. */
|
||||
public static String steamPlayerName = "";
|
||||
|
||||
@@ -369,13 +369,13 @@ public class Fx{
|
||||
|
||||
Fill.circle(e.x, e.y, e.fin() * 10);
|
||||
Drawf.light(e.x, e.y, e.fin() * 20f, Pal.heal, 0.7f);
|
||||
}),
|
||||
}).followParent(true),
|
||||
|
||||
greenLaserChargeSmall = new Effect(40f, 100f, e -> {
|
||||
color(Pal.heal);
|
||||
stroke(e.fin() * 2f);
|
||||
Lines.circle(e.x, e.y, e.fout() * 50f);
|
||||
}),
|
||||
}).followParent(true),
|
||||
|
||||
greenCloud = new Effect(80f, e -> {
|
||||
color(Pal.heal);
|
||||
|
||||
@@ -452,6 +452,7 @@ public class UnitTypes implements ContentList{
|
||||
x = y = 0f;
|
||||
|
||||
firstShotDelay = Fx.greenLaserChargeSmall.lifetime - 1f;
|
||||
parentizeEffects = true;
|
||||
|
||||
reload = 155f;
|
||||
recoil = 0f;
|
||||
@@ -541,6 +542,7 @@ public class UnitTypes implements ContentList{
|
||||
shootStatusDuration = 60f * 2f;
|
||||
shootStatus = StatusEffects.unmoving;
|
||||
firstShotDelay = Fx.greenLaserCharge.lifetime;
|
||||
parentizeEffects = true;
|
||||
|
||||
bullet = new LaserBulletType(){{
|
||||
length = 460f;
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package mindustry.core;
|
||||
|
||||
import arc.*;
|
||||
import arc.assets.*;
|
||||
import arc.assets.loaders.*;
|
||||
import arc.assets.loaders.MusicLoader.*;
|
||||
import arc.assets.loaders.SoundLoader.*;
|
||||
import arc.audio.*;
|
||||
import arc.files.*;
|
||||
import arc.struct.*;
|
||||
import mindustry.*;
|
||||
|
||||
/** Handles files in a modded context. */
|
||||
public class FileTree implements FileHandleResolver{
|
||||
@@ -40,4 +45,30 @@ public class FileTree implements FileHandleResolver{
|
||||
public Fi resolve(String fileName){
|
||||
return get(fileName);
|
||||
}
|
||||
|
||||
public Sound loadSound(String soundName){
|
||||
if(Vars.headless) return new Sound();
|
||||
|
||||
String name = "sounds/" + soundName;
|
||||
String path = Vars.tree.get(name + ".ogg").exists() ? name + ".ogg" : name + ".mp3";
|
||||
|
||||
var sound = new Sound();
|
||||
AssetDescriptor<?> desc = Core.assets.load(path, Sound.class, new SoundParameter(sound));
|
||||
desc.errored = Throwable::printStackTrace;
|
||||
|
||||
return sound;
|
||||
}
|
||||
|
||||
public Music loadMusic(String soundName){
|
||||
if(Vars.headless) return new Music();
|
||||
|
||||
String name = "music/" + soundName;
|
||||
String path = Vars.tree.get(name + ".ogg").exists() ? name + ".ogg" : name + ".mp3";
|
||||
|
||||
var music = new Music();
|
||||
AssetDescriptor<?> desc = Core.assets.load(path, Music.class, new MusicParameter(music));
|
||||
desc.errored = Throwable::printStackTrace;
|
||||
|
||||
return music;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ abstract class PlayerComp implements UnitController, Entityc, Syncc, Timerc, Dra
|
||||
|
||||
public TextureRegion icon(){
|
||||
//display default icon for dead players
|
||||
if(dead()) return core() == null ? UnitTypes.alpha.fullIcon : ((CoreBlock)core().block).unitType.fullIcon;
|
||||
if(dead()) return core() == null ? UnitTypes.alpha.fullIcon : ((CoreBlock)bestCore().block).unitType.fullIcon;
|
||||
|
||||
return unit.icon();
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ public class ContentParser{
|
||||
ObjectMap<Class<?>, ContentType> contentTypes = new ObjectMap<>();
|
||||
ObjectSet<Class<?>> implicitNullable = ObjectSet.with(TextureRegion.class, TextureRegion[].class, TextureRegion[][].class);
|
||||
ObjectMap<String, AssetDescriptor<?>> sounds = new ObjectMap<>();
|
||||
Seq<ParseListener> listeners = new Seq<>();
|
||||
|
||||
ObjectMap<Class<?>, FieldParser> classParsers = new ObjectMap<>(){{
|
||||
put(Effect.class, (type, data) -> {
|
||||
@@ -178,7 +179,10 @@ public class ContentParser{
|
||||
@Override
|
||||
public <T> T readValue(Class<T> type, Class elementType, JsonValue jsonData, Class keyType){
|
||||
T t = internalRead(type, elementType, jsonData, keyType);
|
||||
if(t != null) checkNullFields(t);
|
||||
if(t != null && !Reflect.isWrapper(t.getClass()) && (type == null || !type.isPrimitive())){
|
||||
checkNullFields(t);
|
||||
listeners.each(hook -> hook.parsed(type, jsonData, t));
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
||||
@@ -805,4 +809,8 @@ public class ContentParser{
|
||||
public float time = 60f * 10f;
|
||||
}
|
||||
|
||||
public interface ParseListener{
|
||||
void parsed(Class<?> type, JsonValue jsonData, Object result);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -21,6 +21,7 @@ import mindustry.game.EventType.*;
|
||||
import mindustry.gen.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.graphics.MultiPacker.*;
|
||||
import mindustry.mod.ContentParser.*;
|
||||
import mindustry.type.*;
|
||||
import mindustry.ui.*;
|
||||
|
||||
@@ -651,6 +652,11 @@ public class Mods implements Loadable{
|
||||
parser.markError(content, error);
|
||||
}
|
||||
|
||||
/** Adds a listener for parsed JSON objects. */
|
||||
public void addParseListener(ParseListener hook){
|
||||
parser.listeners.add(hook);
|
||||
}
|
||||
|
||||
/** @return a list of mods and versions, in the format name:version. */
|
||||
public Seq<String> getModStrings(){
|
||||
return mods.select(l -> !l.meta.hidden && l.enabled()).map(l -> l.name + ":" + l.meta.version);
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package mindustry.mod;
|
||||
|
||||
import arc.*;
|
||||
import arc.assets.*;
|
||||
import arc.assets.loaders.MusicLoader.*;
|
||||
import arc.assets.loaders.SoundLoader.*;
|
||||
import arc.audio.*;
|
||||
import arc.files.*;
|
||||
import arc.func.*;
|
||||
@@ -85,30 +82,14 @@ public class Scripts implements Disposable{
|
||||
return Vars.tree.get(path, true).readBytes();
|
||||
}
|
||||
|
||||
//kept for backwards compatibility
|
||||
public Sound loadSound(String soundName){
|
||||
if(Vars.headless) return new Sound();
|
||||
|
||||
String name = "sounds/" + soundName;
|
||||
String path = Vars.tree.get(name + ".ogg").exists() ? name + ".ogg" : name + ".mp3";
|
||||
|
||||
var sound = new Sound();
|
||||
AssetDescriptor<?> desc = Core.assets.load(path, Sound.class, new SoundParameter(sound));
|
||||
desc.errored = Throwable::printStackTrace;
|
||||
|
||||
return sound;
|
||||
return Vars.tree.loadSound(soundName);
|
||||
}
|
||||
|
||||
//kept for backwards compatibility
|
||||
public Music loadMusic(String soundName){
|
||||
if(Vars.headless) return new Music();
|
||||
|
||||
String name = "music/" + soundName;
|
||||
String path = Vars.tree.get(name + ".ogg").exists() ? name + ".ogg" : name + ".mp3";
|
||||
|
||||
var music = new Music();
|
||||
AssetDescriptor<?> desc = Core.assets.load(path, Music.class, new MusicParameter(music));
|
||||
desc.errored = Throwable::printStackTrace;
|
||||
|
||||
return music;
|
||||
return Vars.tree.loadMusic(soundName);
|
||||
}
|
||||
|
||||
/** Ask the user to select a file to read for a certain purpose like "Please upload a sprite" */
|
||||
|
||||
@@ -91,6 +91,8 @@ public class Weapon implements Cloneable{
|
||||
public boolean ignoreRotation = false;
|
||||
/** min velocity required for this weapon to shoot */
|
||||
public float minShootVelocity = -1f;
|
||||
/** should the shoot effects follow the unit (effects need followParent set to true for this to work) */
|
||||
public boolean parentizeEffects;
|
||||
/** internal value used for alternation - do not change! */
|
||||
public int otherSide = -1;
|
||||
/** sound used for shooting */
|
||||
@@ -333,7 +335,7 @@ public class Weapon implements Cloneable{
|
||||
Angles.shotgun(shots, spacing, rotation, f -> mount.bullet = bullet(unit, shootX, shootY, f + Mathf.range(inaccuracy), lifeScl));
|
||||
}
|
||||
|
||||
boolean parentize = ammo.keepVelocity;
|
||||
boolean parentize = ammo.keepVelocity || parentizeEffects;
|
||||
|
||||
if(delay){
|
||||
Time.run(firstShotDelay, () -> {
|
||||
|
||||
@@ -11,4 +11,4 @@ android.useAndroidX=true
|
||||
#used for slow jitpack builds; TODO see if this actually works
|
||||
http.socketTimeout=80000
|
||||
http.connectionTimeout=80000
|
||||
archash=72627de9b81e7143af4ebe1d1f9d54099ade8fd3
|
||||
archash=43f8f93e80779f91fad622acfae70cdc300edecf
|
||||
|
||||
@@ -42,5 +42,9 @@
|
||||
{
|
||||
"name": "Korea",
|
||||
"address": ["mindustry.kr"]
|
||||
},
|
||||
{
|
||||
"name": "SubZero",
|
||||
"address": ["minty-server.ddns.net"]
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user