diff --git a/annotations/src/main/java/mindustry/annotations/Annotations.java b/annotations/src/main/java/mindustry/annotations/Annotations.java index 501c255d2e..88bd457e05 100644 --- a/annotations/src/main/java/mindustry/annotations/Annotations.java +++ b/annotations/src/main/java/mindustry/annotations/Annotations.java @@ -98,6 +98,8 @@ public class Annotations{ boolean serialize() default true; /** Whether to generate IO code. This is for advanced usage only. */ boolean genio() default true; + /** Whether I made a massive mistake by merging two different class branches */ + boolean legacy() default false; } /** Indicates an internal interface for entity components. */ diff --git a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java index 1cd5f7c4e5..8eba0ec683 100644 --- a/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java +++ b/annotations/src/main/java/mindustry/annotations/entity/EntityProcess.java @@ -240,7 +240,6 @@ public class EntityProcess extends BaseProcessor{ //look at each definition for(Selement type : allDefs){ EntityDef ann = type.annotation(EntityDef.class); - boolean isFinal = ann.isFinal(); //all component classes (not interfaces) Seq components = allComponents(type); @@ -274,6 +273,10 @@ public class EntityProcess extends BaseProcessor{ name += "Entity"; } + if(ann.legacy()){ + name += "Legacy" + Strings.capitalize(type.name()); + } + //skip double classes if(usedNames.containsKey(name)){ extraNames.get(usedNames.get(name), ObjectSet::new).add(type.name()); diff --git a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java index 497a622749..94df1e5a9c 100644 --- a/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java +++ b/annotations/src/main/java/mindustry/annotations/impl/AssetsProcess.java @@ -123,8 +123,7 @@ public class AssetsProcess extends BaseProcessor{ if(SourceVersion.isKeyword(name)) name += "s"; String filepath = path.substring(path.lastIndexOf("/") + 1) + "/" + fname; - - String filename = "arc.Core.app.getType() != arc.Application.ApplicationType.iOS ? \"" + filepath + "\" : \"" + filepath.replace(".ogg", ".mp3") + "\""; + String filename = "\"" + filepath + "\""; loadBegin.addStatement("arc.Core.assets.load(" + filename + ", " + rtype + ".class).loaded = a -> " + name + " = (" + rtype + ")a", filepath, filepath.replace(".ogg", ".mp3")); diff --git a/annotations/src/main/resources/revisions/block/3.json b/annotations/src/main/resources/revisions/block/3.json new file mode 100644 index 0000000000..75c7a4a245 --- /dev/null +++ b/annotations/src/main/resources/revisions/block/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/corvus/3.json b/annotations/src/main/resources/revisions/corvus/3.json new file mode 100644 index 0000000000..75c7a4a245 --- /dev/null +++ b/annotations/src/main/resources/revisions/corvus/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/flare/3.json b/annotations/src/main/resources/revisions/flare/3.json new file mode 100644 index 0000000000..75c7a4a245 --- /dev/null +++ b/annotations/src/main/resources/revisions/flare/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/mace/3.json b/annotations/src/main/resources/revisions/mace/3.json new file mode 100644 index 0000000000..811f101bd5 --- /dev/null +++ b/annotations/src/main/resources/revisions/mace/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:baseRotation,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/oct/2.json b/annotations/src/main/resources/revisions/oct/2.json new file mode 100644 index 0000000000..87371c85dd --- /dev/null +++ b/annotations/src/main/resources/revisions/oct/2.json @@ -0,0 +1 @@ +{version:2,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/quad/3.json b/annotations/src/main/resources/revisions/quad/3.json new file mode 100644 index 0000000000..d091179927 --- /dev/null +++ b/annotations/src/main/resources/revisions/quad/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:payloads,type:arc.struct.Seq},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/risso/3.json b/annotations/src/main/resources/revisions/risso/3.json new file mode 100644 index 0000000000..75c7a4a245 --- /dev/null +++ b/annotations/src/main/resources/revisions/risso/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/annotations/src/main/resources/revisions/spiroct/3.json b/annotations/src/main/resources/revisions/spiroct/3.json new file mode 100644 index 0000000000..364fdca813 --- /dev/null +++ b/annotations/src/main/resources/revisions/spiroct/3.json @@ -0,0 +1 @@ +{version:3,fields:[{name:ammo,type:float},{name:armor,type:float},{name:controller,type:mindustry.entities.units.UnitController},{name:elevation,type:float},{name:flag,type:double},{name:health,type:float},{name:isShooting,type:boolean},{name:mineTile,type:mindustry.world.Tile},{name:mounts,type:"mindustry.entities.units.WeaponMount[]"},{name:plans,type:arc.struct.Queue},{name:rotation,type:float},{name:shield,type:float},{name:spawnedByCore,type:boolean},{name:stack,type:mindustry.type.ItemStack},{name:statuses,type:arc.struct.Seq},{name:team,type:mindustry.game.Team},{name:type,type:mindustry.type.UnitType},{name:x,type:float},{name:y,type:float}]} \ No newline at end of file diff --git a/build.gradle b/build.gradle index 8984e5b60f..f09b4f5cd6 100644 --- a/build.gradle +++ b/build.gradle @@ -172,11 +172,20 @@ allprojects{ jcenter() } + task clearCache{ + doFirst{ + delete{ + delete "$rootDir/core/assets/cache" + } + } + } + tasks.withType(JavaCompile){ targetCompatibility = 8 sourceCompatibility = 14 options.encoding = "UTF-8" options.compilerArgs += ["-Xlint:deprecation"] + dependsOn clearCache } } diff --git a/core/assets-raw/fontgen/config.json b/core/assets-raw/fontgen/config.json index f972f27dee..16bc4ed7d2 100644 --- a/core/assets-raw/fontgen/config.json +++ b/core/assets-raw/fontgen/config.json @@ -114,12 +114,6 @@ "code": 59411, "src": "typicons" }, - { - "uid": "k7sao112253txym1egnte7822irbyphe", - "css": "eye", - "code": 59412, - "src": "typicons" - }, { "uid": "jqzwo6i8oicjbn049sh2856d8anrqoli", "css": "edit", @@ -315,7 +309,7 @@ { "uid": "4bad23bc52aaddaac37da019e46b6f6b", "css": "discord_", - "code": 59485, + "code": 59406, "src": "custom_icons", "selected": true, "svg": { @@ -365,7 +359,7 @@ { "uid": "dd1e5d774d1ced68cb7c439d8ed102f5", "css": "logic", - "code": 59517, + "code": 59412, "src": "custom_icons", "selected": true, "svg": { @@ -379,7 +373,7 @@ { "uid": "d0ff49daa25603348abe7e3f7c70be56", "css": "distribution", - "code": 59475, + "code": 59415, "src": "custom_icons", "selected": true, "svg": { @@ -393,7 +387,7 @@ { "uid": "47efe0c5ca937e0def7264347af501ed", "css": "hammer", - "code": 59483, + "code": 59419, "src": "custom_icons", "selected": true, "svg": { @@ -407,7 +401,7 @@ { "uid": "b41aaf351112113e5f50cb8b977d6293", "css": "save", - "code": 59495, + "code": 59434, "src": "custom_icons", "selected": true, "svg": { @@ -421,7 +415,7 @@ { "uid": "e67fcdbfc21c4f395a4f78e2a56c5060", "css": "link", - "code": 59496, + "code": 59435, "src": "custom_icons", "selected": true, "svg": { @@ -435,7 +429,7 @@ { "uid": "3679836be9338f58f8a74e4352dc0bdd", "css": "itchio", - "code": 59497, + "code": 59436, "src": "custom_icons", "selected": true, "svg": { @@ -449,7 +443,7 @@ { "uid": "a3f0c795c6e6506c0bf33e4d344676d5", "css": "line", - "code": 59498, + "code": 59437, "src": "custom_icons", "selected": true, "svg": { @@ -463,7 +457,7 @@ { "uid": "f54e291de7ca06c5101bdeb7e81d6b7f", "css": "admin", - "code": 59484, + "code": 59440, "src": "custom_icons", "selected": true, "svg": { @@ -477,7 +471,7 @@ { "uid": "53efee2384cbefdc94210fb1b4972ed6", "css": "spray-1", - "code": 59499, + "code": 59468, "src": "custom_icons", "selected": true, "svg": { @@ -491,7 +485,7 @@ { "uid": "98cdb7c2e72493434efd910db1f62b29", "css": "crafting", - "code": 59486, + "code": 59469, "src": "custom_icons", "selected": true, "svg": { @@ -505,7 +499,7 @@ { "uid": "dc6530e8b375575b7df2040d108e5368", "css": "fill", - "code": 59500, + "code": 59474, "src": "custom_icons", "selected": true, "svg": { @@ -519,7 +513,7 @@ { "uid": "06281408f2d30c261c9129e3f167204f", "css": "defense", - "code": 59487, + "code": 59475, "src": "custom_icons", "selected": true, "svg": { @@ -533,7 +527,7 @@ { "uid": "88103366af75e17d8a3921ee1fb8616c", "css": "paste", - "code": 59501, + "code": 59483, "src": "custom_icons", "selected": true, "svg": { @@ -547,7 +541,7 @@ { "uid": "c0d81c71f616c8324a78c54d994af313", "css": "effect", - "code": 59489, + "code": 59484, "src": "custom_icons", "selected": true, "svg": { @@ -561,7 +555,7 @@ { "uid": "65c4e52c12c9bed7754878f76c4a0acd", "css": "book", - "code": 59502, + "code": 59485, "src": "custom_icons", "selected": true, "svg": { @@ -575,7 +569,7 @@ { "uid": "cee021b830261625d59e49c48a86102c", "css": "liquid", - "code": 59490, + "code": 59486, "src": "custom_icons", "selected": true, "svg": { @@ -589,7 +583,7 @@ { "uid": "afcfe6416bfdb70c40ede7bf666667d9", "css": "host", - "code": 59503, + "code": 59487, "src": "custom_icons", "selected": true, "svg": { @@ -603,7 +597,7 @@ { "uid": "060ea30307b6e6ab4706682853ec9d21", "css": "production", - "code": 59491, + "code": 59489, "src": "custom_icons", "selected": true, "svg": { @@ -617,7 +611,7 @@ { "uid": "32084a9ecd9e7693002b13e274a84240", "css": "exit", - "code": 59504, + "code": 59405, "src": "custom_icons", "selected": true, "svg": { @@ -631,7 +625,7 @@ { "uid": "7ee2f2d80faaf4bce9af14bbb6cf1f07", "css": "mode-pvp", - "code": 59509, + "code": 59420, "src": "custom_icons", "selected": true, "svg": { @@ -645,7 +639,7 @@ { "uid": "bc0f646b936f7dc761ce8efe1201d450", "css": "terrain", - "code": 59505, + "code": 59495, "src": "custom_icons", "selected": true, "svg": { @@ -659,7 +653,7 @@ { "uid": "fca174e630aceac2289d86197d04ac6d", "css": "mode-attack", - "code": 59510, + "code": 59496, "src": "custom_icons", "selected": true, "svg": { @@ -673,7 +667,7 @@ { "uid": "d2dae093c8eaeecb8b86b9b3137d5e59", "css": "refresh-1", - "code": 59507, + "code": 59497, "src": "custom_icons", "selected": true, "svg": { @@ -687,7 +681,7 @@ { "uid": "279c989fcea20393a5b83eb9e598d59a", "css": "none", - "code": 59567, + "code": 59498, "src": "custom_icons", "selected": true, "svg": { @@ -701,7 +695,7 @@ { "uid": "e3b561a775bcb150f6b8ea719a465345", "css": "pencil_", - "code": 59508, + "code": 59499, "src": "custom_icons", "selected": true, "svg": { @@ -715,7 +709,7 @@ { "uid": "8b4d5e8da6aa68188b631aaf252a9e14", "css": "refresh", - "code": 59568, + "code": 59500, "src": "custom_icons", "selected": true, "svg": { @@ -729,7 +723,7 @@ { "uid": "44e902e72564bc6d9a9eb1d174208d35", "css": "mode-survival", - "code": 59511, + "code": 59501, "src": "custom_icons", "selected": true, "svg": { @@ -743,7 +737,7 @@ { "uid": "9e23184b166b551c5fb0bd5ee3a4dc2c", "css": "command-rally", - "code": 59512, + "code": 59502, "src": "custom_icons", "selected": true, "svg": { @@ -757,7 +751,7 @@ { "uid": "5b2609713ca347b272beb0bc5f49c42e", "css": "units", - "code": 59493, + "code": 59503, "src": "custom_icons", "selected": true, "svg": { @@ -771,7 +765,7 @@ { "uid": "de2b09bde33670e3502e3e07b936e098", "css": "command-attack", - "code": 59513, + "code": 59504, "src": "custom_icons", "selected": true, "svg": { @@ -785,7 +779,7 @@ { "uid": "343b1d6c67d1c2bdc279b8df809fb3bf", "css": "trash", - "code": 59506, + "code": 59505, "src": "custom_icons", "selected": true, "svg": { @@ -799,7 +793,7 @@ { "uid": "f82a79ee879412f7ddf7c517c6958d45", "css": "chat", - "code": 59515, + "code": 59506, "src": "custom_icons", "selected": true, "svg": { @@ -813,7 +807,7 @@ { "uid": "1a406c75ee5adac112504cd1baf6d482", "css": "turret", - "code": 59492, + "code": 59507, "src": "custom_icons", "selected": true, "svg": { @@ -827,7 +821,7 @@ { "uid": "559d541ead67649a9658f22b36bc48fc", "css": "players", - "code": 59516, + "code": 59508, "src": "custom_icons", "selected": true, "svg": { @@ -841,7 +835,7 @@ { "uid": "2e574f2316b8b4f840d5680dcad8088b", "css": "editor", - "code": 59573, + "code": 59509, "src": "custom_icons", "selected": true, "svg": { @@ -855,7 +849,7 @@ { "uid": "6e16d3f823a60ce0e9db3a9768668132", "css": "copy", - "code": 59574, + "code": 59510, "src": "custom_icons", "selected": true, "svg": { @@ -869,7 +863,7 @@ { "uid": "295e9560f763400dae5f29abd75c4e39", "css": "tree", - "code": 59474, + "code": 59511, "src": "custom_icons", "selected": true, "svg": { @@ -883,7 +877,7 @@ { "uid": "0581bbd4c54547d8d6721cc122ffe0fa", "css": "lock-open", - "code": 59468, + "code": 59512, "src": "custom_icons", "selected": true, "svg": { @@ -897,7 +891,7 @@ { "uid": "d0203434b5e4cea53499b112743fd675", "css": "pick", - "code": 59434, + "code": 59513, "src": "custom_icons", "selected": true, "svg": { @@ -911,7 +905,7 @@ { "uid": "b04d1002bf24f642a026b8844f0ab4af", "css": "export", - "code": 59435, + "code": 59515, "src": "custom_icons", "selected": true, "svg": { @@ -925,7 +919,7 @@ { "uid": "6636e2512996fa2c2b37b8d9e111d4fe", "css": "download", - "code": 59436, + "code": 59516, "src": "custom_icons", "selected": true, "svg": { @@ -939,7 +933,7 @@ { "uid": "f9895cd70db81922fbd2aa1882f04a03", "css": "upload", - "code": 59437, + "code": 59517, "src": "custom_icons", "selected": true, "svg": { @@ -953,7 +947,7 @@ { "uid": "e8191eedaa10260cef458a2385925cb0", "css": "settings", - "code": 59406, + "code": 59530, "src": "custom_icons", "selected": true, "svg": { @@ -967,7 +961,7 @@ { "uid": "ea0128855a25fc520b78658acfe68693", "css": "spray", - "code": 59569, + "code": 59531, "src": "custom_icons", "selected": true, "svg": { @@ -981,7 +975,7 @@ { "uid": "32b0960726db55c7f26620e15f83acd9", "css": "zoom", - "code": 59415, + "code": 59532, "src": "custom_icons", "selected": true, "svg": { @@ -995,7 +989,7 @@ { "uid": "22856e2f42e364e7e363348542b46062", "css": "power_old", - "code": 59419, + "code": 59533, "src": "custom_icons", "selected": true, "svg": { @@ -1015,7 +1009,7 @@ { "uid": "844ca62d81744d1ca4b59a4763aeca86", "css": "menu", - "code": 59440, + "code": 59534, "src": "custom_icons", "selected": true, "svg": { @@ -1029,7 +1023,7 @@ { "uid": "4b4d5e5ee8884c2f545869496dcb525b", "css": "lock", - "code": 59469, + "code": 59535, "src": "custom_icons", "selected": true, "svg": { @@ -1039,6 +1033,34 @@ "search": [ "lock" ] + }, + { + "uid": "9515bb59fd462b77f0d088978c339778", + "css": "eye", + "code": 59492, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M450 0L400 50 350 100 300 150 250 200 200 250 150 300 100 350 50 400 0 450V550L50 600 100 650 150 700 200 750 250 800 300 850 350 900 400 950 450 1000H550 650 750 850 950 1050 1150L1200 950 1250 900 1300 850 1350 800 1400 750 1450 700 1500 650 1550 600 1600 550V450L1550 400 1500 350 1450 300 1400 250 1350 200 1300 150 1250 100 1200 50 1150 0H1050 950 850 750 650 550ZM650 200H750 850 950L1000 250 1050 300 1100 350 1150 400 1200 450V550L1150 600 1100 650 1050 700 1000 750 950 800H850 750 650L600 750 550 700 500 650 450 600 400 550V450L450 400 500 350 550 300 600 250ZM750 400L700 450V550L750 600H850L900 550V450L850 400Z", + "width": 1600 + }, + "search": [ + "eye" + ] + }, + { + "uid": "fdd7088d0019bb1033df645f01981429", + "css": "eye-off", + "code": 59493, + "src": "custom_icons", + "selected": true, + "svg": { + "path": "M1041.7 0L1000 41.7 958.3 83.3 916.7 125 875 166.7 833.3 208.3 791.7 250 750 291.7 708.3 333.3 666.7 375 625 416.7 583.3 458.3 541.7 500 500 541.7 458.3 583.3 416.7 625 375 666.7 333.3 708.3 291.7 750 250 791.7 208.3 833.3 166.7 875V958.3L208.3 1000H291.7L333.3 958.3 375 916.7 416.7 875 458.3 833.3 500 791.7 541.7 750 583.3 708.3 625 666.7 666.7 625 708.3 583.3 750 541.7 791.7 500 833.3 458.3 875 416.7 916.7 375 958.3 333.3 1000 291.7 1041.7 250 1083.3 208.3 1125 166.7 1166.7 125V41.7L1125 0ZM375 83.3L333.3 125 291.7 166.7 250 208.3 208.3 250 166.7 291.7 125 333.3 83.3 375 41.7 416.7 0 458.3V541.7L41.7 583.3 83.3 625 125 666.7H208.3L250 625 291.7 583.3 333.3 541.7V458.3L375 416.7 416.7 375 458.3 333.3 500 291.7 541.7 250H625L666.7 208.3 708.3 166.7 750 125 708.3 83.3H625 541.7 458.3ZM1125 333.3L1083.3 375 1041.7 416.7 1000 458.3V541.7L958.3 583.3 916.7 625 875 666.7 833.3 708.3 791.7 750H708.3L666.7 791.7 625 833.3 583.3 875 625 916.7H708.3 791.7 875 958.3L1000 875 1041.7 833.3 1083.3 791.7 1125 750 1166.7 708.3 1208.3 666.7 1250 625 1291.7 583.3 1333.3 541.7V458.3L1291.7 416.7 1250 375 1208.3 333.3Z", + "width": 1333 + }, + "search": [ + "eye-off" + ] } ] } \ No newline at end of file diff --git a/core/assets-raw/icons/eye-off.png b/core/assets-raw/icons/eye-off.png new file mode 100644 index 0000000000..cf304c9f77 Binary files /dev/null and b/core/assets-raw/icons/eye-off.png differ diff --git a/core/assets-raw/icons/eye.png b/core/assets-raw/icons/eye.png new file mode 100644 index 0000000000..1a14383523 Binary files /dev/null and b/core/assets-raw/icons/eye.png differ diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index ec291c3e34..96b3052e8b 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -189,6 +189,10 @@ servers.local = Local Servers servers.remote = Remote Servers servers.global = Community Servers +servers.showhidden = Show Hidden Servers +server.shown = Shown +server.hidden = Hidden + trace = Trace Player trace.playername = Player name: [accent]{0} trace.ip = IP: [accent]{0} @@ -503,7 +507,7 @@ zone.objective = [lightgray]Objective: [accent]{0} zone.objective.survival = Survive zone.objective.attack = Destroy Enemy Core add = Add... -boss.health = Boss Health +boss.health = Guardian Health connectfail = [scarlet]Connection error:\n\n[accent]{0} error.unreachable = Server unreachable.\nIs the address spelled correctly? @@ -667,6 +671,7 @@ ability.repairfield = Repair Field ability.statusfield = Status Field ability.unitspawn = {0} Factory ability.shieldregenfield = Shield Regen Field +ability.movelightning = Movement Lightning bar.drilltierreq = Better Drill Required bar.noresources = Missing Resources @@ -1306,8 +1311,8 @@ block.inverted-sorter.description = Similar to a standard sorter, but outputs se block.router.description = Distributes input items to 3 output directions equally. block.router.details = A necessary evil. Using next to production inputs is not advised, as they will get clogged by output. block.distributor.description = Distributes input items to 7 output directions equally. -block.overflow-gate.description = Only outputs items to the left and right if the front path is blocked. -block.underflow-gate.description = Opposite of an overflow gate. Outputs to the front if the left and right paths are blocked. +block.overflow-gate.description = Only outputs items to the left and right if the front path is blocked. Cannot be used next to other gates. +block.underflow-gate.description = Opposite of an overflow gate. Outputs to the front if the left and right paths are blocked. Cannot be used next to other gates. block.mass-driver.description = Long-range item transport structure. Collects batches of items and shoots them to other mass drivers. block.mechanical-pump.description = Pumps and outputs liquids. Does not require power. block.rotary-pump.description = Pumps and outputs liquids. Requires power. diff --git a/core/assets/fonts/font.woff b/core/assets/fonts/font.woff index cb628c6ab5..d294b8c83a 100644 Binary files a/core/assets/fonts/font.woff and b/core/assets/fonts/font.woff differ diff --git a/core/assets/fonts/icon.ttf b/core/assets/fonts/icon.ttf index c6f00c3daf..c70f8c89cc 100644 Binary files a/core/assets/fonts/icon.ttf and b/core/assets/fonts/icon.ttf differ diff --git a/core/assets/music/boss1.mp3 b/core/assets/music/boss1.mp3 new file mode 100644 index 0000000000..4a54f750c9 Binary files /dev/null and b/core/assets/music/boss1.mp3 differ diff --git a/core/assets/music/boss2.mp3 b/core/assets/music/boss2.mp3 new file mode 100644 index 0000000000..cd9eaf1b25 Binary files /dev/null and b/core/assets/music/boss2.mp3 differ diff --git a/core/assets/music/editor.mp3 b/core/assets/music/editor.mp3 new file mode 100644 index 0000000000..0b3a8e6182 Binary files /dev/null and b/core/assets/music/editor.mp3 differ diff --git a/core/assets/music/editor.ogg b/core/assets/music/editor.ogg deleted file mode 100644 index 61348f1b75..0000000000 Binary files a/core/assets/music/editor.ogg and /dev/null differ diff --git a/core/assets/music/game1.mp3 b/core/assets/music/game1.mp3 new file mode 100644 index 0000000000..bfb9b3d468 Binary files /dev/null and b/core/assets/music/game1.mp3 differ diff --git a/core/assets/music/game1.ogg b/core/assets/music/game1.ogg deleted file mode 100644 index d69bb0e931..0000000000 Binary files a/core/assets/music/game1.ogg and /dev/null differ diff --git a/core/assets/music/game2.mp3 b/core/assets/music/game2.mp3 new file mode 100644 index 0000000000..baeddf2914 Binary files /dev/null and b/core/assets/music/game2.mp3 differ diff --git a/core/assets/music/game2.ogg b/core/assets/music/game2.ogg deleted file mode 100644 index 9cf7898026..0000000000 Binary files a/core/assets/music/game2.ogg and /dev/null differ diff --git a/core/assets/music/game3.mp3 b/core/assets/music/game3.mp3 new file mode 100644 index 0000000000..e7f8e34f75 Binary files /dev/null and b/core/assets/music/game3.mp3 differ diff --git a/core/assets/music/game3.ogg b/core/assets/music/game3.ogg deleted file mode 100644 index 657848a0da..0000000000 Binary files a/core/assets/music/game3.ogg and /dev/null differ diff --git a/core/assets/music/game4.mp3 b/core/assets/music/game4.mp3 new file mode 100644 index 0000000000..c21cf226f0 Binary files /dev/null and b/core/assets/music/game4.mp3 differ diff --git a/core/assets/music/game4.ogg b/core/assets/music/game4.ogg deleted file mode 100644 index 051c414540..0000000000 Binary files a/core/assets/music/game4.ogg and /dev/null differ diff --git a/core/assets/music/game5.mp3 b/core/assets/music/game5.mp3 new file mode 100644 index 0000000000..2bcc7e7a94 Binary files /dev/null and b/core/assets/music/game5.mp3 differ diff --git a/core/assets/music/game5.ogg b/core/assets/music/game5.ogg deleted file mode 100644 index d988882f7a..0000000000 Binary files a/core/assets/music/game5.ogg and /dev/null differ diff --git a/core/assets/music/game6.mp3 b/core/assets/music/game6.mp3 new file mode 100644 index 0000000000..9e0cfc97d6 Binary files /dev/null and b/core/assets/music/game6.mp3 differ diff --git a/core/assets/music/game6.ogg b/core/assets/music/game6.ogg deleted file mode 100644 index 45b063ae9c..0000000000 Binary files a/core/assets/music/game6.ogg and /dev/null differ diff --git a/core/assets/music/game7.mp3 b/core/assets/music/game7.mp3 new file mode 100644 index 0000000000..4a8d5187b8 Binary files /dev/null and b/core/assets/music/game7.mp3 differ diff --git a/core/assets/music/game7.ogg b/core/assets/music/game7.ogg deleted file mode 100644 index 6a1011657c..0000000000 Binary files a/core/assets/music/game7.ogg and /dev/null differ diff --git a/core/assets/music/game8.mp3 b/core/assets/music/game8.mp3 new file mode 100644 index 0000000000..a2cebbc465 Binary files /dev/null and b/core/assets/music/game8.mp3 differ diff --git a/core/assets/music/game9.mp3 b/core/assets/music/game9.mp3 new file mode 100644 index 0000000000..a852b4c4c9 Binary files /dev/null and b/core/assets/music/game9.mp3 differ diff --git a/core/assets/music/land.mp3 b/core/assets/music/land.mp3 new file mode 100644 index 0000000000..80720c478c Binary files /dev/null and b/core/assets/music/land.mp3 differ diff --git a/core/assets/music/land.ogg b/core/assets/music/land.ogg deleted file mode 100644 index 800b253656..0000000000 Binary files a/core/assets/music/land.ogg and /dev/null differ diff --git a/core/assets/music/launch.mp3 b/core/assets/music/launch.mp3 new file mode 100644 index 0000000000..7aeb2a3340 Binary files /dev/null and b/core/assets/music/launch.mp3 differ diff --git a/core/assets/music/launch.ogg b/core/assets/music/launch.ogg deleted file mode 100644 index 1da1a065c6..0000000000 Binary files a/core/assets/music/launch.ogg and /dev/null differ diff --git a/core/assets/music/menu.mp3 b/core/assets/music/menu.mp3 new file mode 100644 index 0000000000..6423eba4b2 Binary files /dev/null and b/core/assets/music/menu.mp3 differ diff --git a/core/assets/music/menu.ogg b/core/assets/music/menu.ogg deleted file mode 100644 index c23fe679fb..0000000000 Binary files a/core/assets/music/menu.ogg and /dev/null differ diff --git a/core/assets/sounds/artillery.mp3 b/core/assets/sounds/artillery.mp3 new file mode 100644 index 0000000000..640b133984 Binary files /dev/null and b/core/assets/sounds/artillery.mp3 differ diff --git a/core/assets/sounds/artillery.ogg b/core/assets/sounds/artillery.ogg deleted file mode 100644 index d9f8b74d75..0000000000 Binary files a/core/assets/sounds/artillery.ogg and /dev/null differ diff --git a/core/assets/sounds/back.mp3 b/core/assets/sounds/back.mp3 new file mode 100644 index 0000000000..dc47bc9ac5 Binary files /dev/null and b/core/assets/sounds/back.mp3 differ diff --git a/core/assets/sounds/back.ogg b/core/assets/sounds/back.ogg deleted file mode 100644 index 381cf83079..0000000000 Binary files a/core/assets/sounds/back.ogg and /dev/null differ diff --git a/core/assets/sounds/bang.mp3 b/core/assets/sounds/bang.mp3 new file mode 100644 index 0000000000..ebe5ffe987 Binary files /dev/null and b/core/assets/sounds/bang.mp3 differ diff --git a/core/assets/sounds/bang.ogg b/core/assets/sounds/bang.ogg deleted file mode 100644 index 29cde62552..0000000000 Binary files a/core/assets/sounds/bang.ogg and /dev/null differ diff --git a/core/assets/sounds/beam.mp3 b/core/assets/sounds/beam.mp3 new file mode 100644 index 0000000000..9d0a0805f0 Binary files /dev/null and b/core/assets/sounds/beam.mp3 differ diff --git a/core/assets/sounds/beam.ogg b/core/assets/sounds/beam.ogg deleted file mode 100644 index 9b39f2363c..0000000000 Binary files a/core/assets/sounds/beam.ogg and /dev/null differ diff --git a/core/assets/sounds/bigshot.mp3 b/core/assets/sounds/bigshot.mp3 new file mode 100644 index 0000000000..eb47fd470e Binary files /dev/null and b/core/assets/sounds/bigshot.mp3 differ diff --git a/core/assets/sounds/bigshot.ogg b/core/assets/sounds/bigshot.ogg deleted file mode 100644 index 3218eec651..0000000000 Binary files a/core/assets/sounds/bigshot.ogg and /dev/null differ diff --git a/core/assets/sounds/boom.mp3 b/core/assets/sounds/boom.mp3 new file mode 100644 index 0000000000..1b12d3bc7b Binary files /dev/null and b/core/assets/sounds/boom.mp3 differ diff --git a/core/assets/sounds/boom.ogg b/core/assets/sounds/boom.ogg deleted file mode 100644 index 19f41d80b2..0000000000 Binary files a/core/assets/sounds/boom.ogg and /dev/null differ diff --git a/core/assets/sounds/break.mp3 b/core/assets/sounds/break.mp3 new file mode 100644 index 0000000000..3abc129cdf Binary files /dev/null and b/core/assets/sounds/break.mp3 differ diff --git a/core/assets/sounds/break.ogg b/core/assets/sounds/break.ogg deleted file mode 100644 index 30ca95aea2..0000000000 Binary files a/core/assets/sounds/break.ogg and /dev/null differ diff --git a/core/assets/sounds/build.mp3 b/core/assets/sounds/build.mp3 new file mode 100644 index 0000000000..3754346c3a Binary files /dev/null and b/core/assets/sounds/build.mp3 differ diff --git a/core/assets/sounds/build.ogg b/core/assets/sounds/build.ogg deleted file mode 100644 index 8235d41eb9..0000000000 Binary files a/core/assets/sounds/build.ogg and /dev/null differ diff --git a/core/assets/sounds/buttonClick.mp3 b/core/assets/sounds/buttonClick.mp3 new file mode 100644 index 0000000000..c9afb61ca6 Binary files /dev/null and b/core/assets/sounds/buttonClick.mp3 differ diff --git a/core/assets/sounds/buttonClick.ogg b/core/assets/sounds/buttonClick.ogg deleted file mode 100644 index 5f225eadcc..0000000000 Binary files a/core/assets/sounds/buttonClick.ogg and /dev/null differ diff --git a/core/assets/sounds/click.mp3 b/core/assets/sounds/click.mp3 new file mode 100644 index 0000000000..ff1a219497 Binary files /dev/null and b/core/assets/sounds/click.mp3 differ diff --git a/core/assets/sounds/click.ogg b/core/assets/sounds/click.ogg deleted file mode 100644 index 4960f9098f..0000000000 Binary files a/core/assets/sounds/click.ogg and /dev/null differ diff --git a/core/assets/sounds/combustion.mp3 b/core/assets/sounds/combustion.mp3 new file mode 100644 index 0000000000..affec20fbc Binary files /dev/null and b/core/assets/sounds/combustion.mp3 differ diff --git a/core/assets/sounds/combustion.ogg b/core/assets/sounds/combustion.ogg deleted file mode 100644 index 6aab153a47..0000000000 Binary files a/core/assets/sounds/combustion.ogg and /dev/null differ diff --git a/core/assets/sounds/conveyor.mp3 b/core/assets/sounds/conveyor.mp3 new file mode 100644 index 0000000000..0d11430a16 Binary files /dev/null and b/core/assets/sounds/conveyor.mp3 differ diff --git a/core/assets/sounds/conveyor.ogg b/core/assets/sounds/conveyor.ogg deleted file mode 100644 index 9f989d70d0..0000000000 Binary files a/core/assets/sounds/conveyor.ogg and /dev/null differ diff --git a/core/assets/sounds/corexplode.mp3 b/core/assets/sounds/corexplode.mp3 new file mode 100644 index 0000000000..80b8317f95 Binary files /dev/null and b/core/assets/sounds/corexplode.mp3 differ diff --git a/core/assets/sounds/corexplode.ogg b/core/assets/sounds/corexplode.ogg deleted file mode 100644 index b26ff4a64c..0000000000 Binary files a/core/assets/sounds/corexplode.ogg and /dev/null differ diff --git a/core/assets/sounds/cutter.mp3 b/core/assets/sounds/cutter.mp3 new file mode 100644 index 0000000000..052f8cec95 Binary files /dev/null and b/core/assets/sounds/cutter.mp3 differ diff --git a/core/assets/sounds/cutter.ogg b/core/assets/sounds/cutter.ogg deleted file mode 100644 index 313159006e..0000000000 Binary files a/core/assets/sounds/cutter.ogg and /dev/null differ diff --git a/core/assets/sounds/door.mp3 b/core/assets/sounds/door.mp3 new file mode 100644 index 0000000000..3a1936db22 Binary files /dev/null and b/core/assets/sounds/door.mp3 differ diff --git a/core/assets/sounds/door.ogg b/core/assets/sounds/door.ogg deleted file mode 100644 index 121b3c3037..0000000000 Binary files a/core/assets/sounds/door.ogg and /dev/null differ diff --git a/core/assets/sounds/drill.mp3 b/core/assets/sounds/drill.mp3 new file mode 100644 index 0000000000..784db23ce9 Binary files /dev/null and b/core/assets/sounds/drill.mp3 differ diff --git a/core/assets/sounds/drill.ogg b/core/assets/sounds/drill.ogg deleted file mode 100644 index f21898b646..0000000000 Binary files a/core/assets/sounds/drill.ogg and /dev/null differ diff --git a/core/assets/sounds/explosion.mp3 b/core/assets/sounds/explosion.mp3 new file mode 100644 index 0000000000..65a122307b Binary files /dev/null and b/core/assets/sounds/explosion.mp3 differ diff --git a/core/assets/sounds/explosion.ogg b/core/assets/sounds/explosion.ogg deleted file mode 100644 index 5f4a69281d..0000000000 Binary files a/core/assets/sounds/explosion.ogg and /dev/null differ diff --git a/core/assets/sounds/explosionbig.mp3 b/core/assets/sounds/explosionbig.mp3 new file mode 100644 index 0000000000..869079ea61 Binary files /dev/null and b/core/assets/sounds/explosionbig.mp3 differ diff --git a/core/assets/sounds/explosionbig.ogg b/core/assets/sounds/explosionbig.ogg deleted file mode 100644 index 30cb7933f0..0000000000 Binary files a/core/assets/sounds/explosionbig.ogg and /dev/null differ diff --git a/core/assets/sounds/fire.mp3 b/core/assets/sounds/fire.mp3 new file mode 100644 index 0000000000..d00468b5c4 Binary files /dev/null and b/core/assets/sounds/fire.mp3 differ diff --git a/core/assets/sounds/fire.ogg b/core/assets/sounds/fire.ogg deleted file mode 100644 index 0201ee8ea4..0000000000 Binary files a/core/assets/sounds/fire.ogg and /dev/null differ diff --git a/core/assets/sounds/flame.mp3 b/core/assets/sounds/flame.mp3 new file mode 100644 index 0000000000..e1ffbb0c10 Binary files /dev/null and b/core/assets/sounds/flame.mp3 differ diff --git a/core/assets/sounds/flame.ogg b/core/assets/sounds/flame.ogg deleted file mode 100644 index ef203e0524..0000000000 Binary files a/core/assets/sounds/flame.ogg and /dev/null differ diff --git a/core/assets/sounds/flame2.mp3 b/core/assets/sounds/flame2.mp3 new file mode 100644 index 0000000000..6e61ef2d9c Binary files /dev/null and b/core/assets/sounds/flame2.mp3 differ diff --git a/core/assets/sounds/flame2.ogg b/core/assets/sounds/flame2.ogg deleted file mode 100644 index 812774a6e6..0000000000 Binary files a/core/assets/sounds/flame2.ogg and /dev/null differ diff --git a/core/assets/sounds/grinding.mp3 b/core/assets/sounds/grinding.mp3 new file mode 100644 index 0000000000..102e0b462e Binary files /dev/null and b/core/assets/sounds/grinding.mp3 differ diff --git a/core/assets/sounds/grinding.ogg b/core/assets/sounds/grinding.ogg deleted file mode 100644 index f78d2c4e67..0000000000 Binary files a/core/assets/sounds/grinding.ogg and /dev/null differ diff --git a/core/assets/sounds/hum.mp3 b/core/assets/sounds/hum.mp3 new file mode 100644 index 0000000000..55d477dca5 Binary files /dev/null and b/core/assets/sounds/hum.mp3 differ diff --git a/core/assets/sounds/hum.ogg b/core/assets/sounds/hum.ogg deleted file mode 100644 index 184504f3dd..0000000000 Binary files a/core/assets/sounds/hum.ogg and /dev/null differ diff --git a/core/assets/sounds/laser.mp3 b/core/assets/sounds/laser.mp3 new file mode 100644 index 0000000000..63decc2696 Binary files /dev/null and b/core/assets/sounds/laser.mp3 differ diff --git a/core/assets/sounds/laser.ogg b/core/assets/sounds/laser.ogg deleted file mode 100644 index 3a727c5053..0000000000 Binary files a/core/assets/sounds/laser.ogg and /dev/null differ diff --git a/core/assets/sounds/laserbig.mp3 b/core/assets/sounds/laserbig.mp3 new file mode 100644 index 0000000000..a95bf7908d Binary files /dev/null and b/core/assets/sounds/laserbig.mp3 differ diff --git a/core/assets/sounds/laserbig.ogg b/core/assets/sounds/laserbig.ogg deleted file mode 100644 index 4aa6658cf6..0000000000 Binary files a/core/assets/sounds/laserbig.ogg and /dev/null differ diff --git a/core/assets/sounds/laserblast.mp3 b/core/assets/sounds/laserblast.mp3 new file mode 100644 index 0000000000..a19fdf379d Binary files /dev/null and b/core/assets/sounds/laserblast.mp3 differ diff --git a/core/assets/sounds/laserblast.ogg b/core/assets/sounds/laserblast.ogg deleted file mode 100644 index 6df3b14284..0000000000 Binary files a/core/assets/sounds/laserblast.ogg and /dev/null differ diff --git a/core/assets/sounds/lasercharge.mp3 b/core/assets/sounds/lasercharge.mp3 new file mode 100644 index 0000000000..5f325c8e99 Binary files /dev/null and b/core/assets/sounds/lasercharge.mp3 differ diff --git a/core/assets/sounds/lasercharge.ogg b/core/assets/sounds/lasercharge.ogg deleted file mode 100644 index 7e50df3661..0000000000 Binary files a/core/assets/sounds/lasercharge.ogg and /dev/null differ diff --git a/core/assets/sounds/lasercharge2.mp3 b/core/assets/sounds/lasercharge2.mp3 new file mode 100644 index 0000000000..ae31defa98 Binary files /dev/null and b/core/assets/sounds/lasercharge2.mp3 differ diff --git a/core/assets/sounds/lasercharge2.ogg b/core/assets/sounds/lasercharge2.ogg deleted file mode 100644 index 2a737e5f63..0000000000 Binary files a/core/assets/sounds/lasercharge2.ogg and /dev/null differ diff --git a/core/assets/sounds/lasershoot.mp3 b/core/assets/sounds/lasershoot.mp3 new file mode 100644 index 0000000000..a63664ac3d Binary files /dev/null and b/core/assets/sounds/lasershoot.mp3 differ diff --git a/core/assets/sounds/lasershoot.ogg b/core/assets/sounds/lasershoot.ogg deleted file mode 100644 index d25c17a4cb..0000000000 Binary files a/core/assets/sounds/lasershoot.ogg and /dev/null differ diff --git a/core/assets/sounds/machine.mp3 b/core/assets/sounds/machine.mp3 new file mode 100644 index 0000000000..a30f8672b2 Binary files /dev/null and b/core/assets/sounds/machine.mp3 differ diff --git a/core/assets/sounds/machine.ogg b/core/assets/sounds/machine.ogg deleted file mode 100644 index 42429721a0..0000000000 Binary files a/core/assets/sounds/machine.ogg and /dev/null differ diff --git a/core/assets/sounds/message.mp3 b/core/assets/sounds/message.mp3 new file mode 100644 index 0000000000..63d436e806 Binary files /dev/null and b/core/assets/sounds/message.mp3 differ diff --git a/core/assets/sounds/message.ogg b/core/assets/sounds/message.ogg deleted file mode 100644 index 2db223d24e..0000000000 Binary files a/core/assets/sounds/message.ogg and /dev/null differ diff --git a/core/assets/sounds/minebeam.mp3 b/core/assets/sounds/minebeam.mp3 new file mode 100644 index 0000000000..dceaca8b6a Binary files /dev/null and b/core/assets/sounds/minebeam.mp3 differ diff --git a/core/assets/sounds/missile.mp3 b/core/assets/sounds/missile.mp3 new file mode 100644 index 0000000000..45b3a6519d Binary files /dev/null and b/core/assets/sounds/missile.mp3 differ diff --git a/core/assets/sounds/missile.ogg b/core/assets/sounds/missile.ogg deleted file mode 100644 index eb13976d87..0000000000 Binary files a/core/assets/sounds/missile.ogg and /dev/null differ diff --git a/core/assets/sounds/mud.mp3 b/core/assets/sounds/mud.mp3 new file mode 100644 index 0000000000..73d726b53f Binary files /dev/null and b/core/assets/sounds/mud.mp3 differ diff --git a/core/assets/sounds/mud.ogg b/core/assets/sounds/mud.ogg deleted file mode 100644 index 8eb75cb67e..0000000000 Binary files a/core/assets/sounds/mud.ogg and /dev/null differ diff --git a/core/assets/sounds/pew.mp3 b/core/assets/sounds/pew.mp3 new file mode 100644 index 0000000000..5e70e5e7a1 Binary files /dev/null and b/core/assets/sounds/pew.mp3 differ diff --git a/core/assets/sounds/pew.ogg b/core/assets/sounds/pew.ogg deleted file mode 100644 index eb960f5537..0000000000 Binary files a/core/assets/sounds/pew.ogg and /dev/null differ diff --git a/core/assets/sounds/pew_.mp3 b/core/assets/sounds/pew_.mp3 new file mode 100644 index 0000000000..d7e610f4a6 Binary files /dev/null and b/core/assets/sounds/pew_.mp3 differ diff --git a/core/assets/sounds/pew_.ogg b/core/assets/sounds/pew_.ogg deleted file mode 100644 index 0c1df7f711..0000000000 Binary files a/core/assets/sounds/pew_.ogg and /dev/null differ diff --git a/core/assets/sounds/place.mp3 b/core/assets/sounds/place.mp3 new file mode 100644 index 0000000000..6cae487e8e Binary files /dev/null and b/core/assets/sounds/place.mp3 differ diff --git a/core/assets/sounds/place.ogg b/core/assets/sounds/place.ogg deleted file mode 100644 index ff1d05c211..0000000000 Binary files a/core/assets/sounds/place.ogg and /dev/null differ diff --git a/core/assets/sounds/press.mp3 b/core/assets/sounds/press.mp3 new file mode 100644 index 0000000000..871d9cd07c Binary files /dev/null and b/core/assets/sounds/press.mp3 differ diff --git a/core/assets/sounds/press.ogg b/core/assets/sounds/press.ogg deleted file mode 100644 index 7085dc00a0..0000000000 Binary files a/core/assets/sounds/press.ogg and /dev/null differ diff --git a/core/assets/sounds/pulse.mp3 b/core/assets/sounds/pulse.mp3 new file mode 100644 index 0000000000..fdc28e2517 Binary files /dev/null and b/core/assets/sounds/pulse.mp3 differ diff --git a/core/assets/sounds/pulse.ogg b/core/assets/sounds/pulse.ogg deleted file mode 100644 index 6c135c8a07..0000000000 Binary files a/core/assets/sounds/pulse.ogg and /dev/null differ diff --git a/core/assets/sounds/railgun.mp3 b/core/assets/sounds/railgun.mp3 new file mode 100644 index 0000000000..813f4f17cf Binary files /dev/null and b/core/assets/sounds/railgun.mp3 differ diff --git a/core/assets/sounds/railgun.ogg b/core/assets/sounds/railgun.ogg deleted file mode 100644 index d8de298916..0000000000 Binary files a/core/assets/sounds/railgun.ogg and /dev/null differ diff --git a/core/assets/sounds/rain.mp3 b/core/assets/sounds/rain.mp3 new file mode 100644 index 0000000000..35ce7f2554 Binary files /dev/null and b/core/assets/sounds/rain.mp3 differ diff --git a/core/assets/sounds/rain.ogg b/core/assets/sounds/rain.ogg deleted file mode 100644 index ecf90ea73d..0000000000 Binary files a/core/assets/sounds/rain.ogg and /dev/null differ diff --git a/core/assets/sounds/release.mp3 b/core/assets/sounds/release.mp3 new file mode 100644 index 0000000000..e2941e1485 Binary files /dev/null and b/core/assets/sounds/release.mp3 differ diff --git a/core/assets/sounds/release.ogg b/core/assets/sounds/release.ogg deleted file mode 100644 index 89efd2ca2e..0000000000 Binary files a/core/assets/sounds/release.ogg and /dev/null differ diff --git a/core/assets/sounds/respawn.mp3 b/core/assets/sounds/respawn.mp3 new file mode 100644 index 0000000000..b26350b487 Binary files /dev/null and b/core/assets/sounds/respawn.mp3 differ diff --git a/core/assets/sounds/respawn.ogg b/core/assets/sounds/respawn.ogg deleted file mode 100644 index b194989ebf..0000000000 Binary files a/core/assets/sounds/respawn.ogg and /dev/null differ diff --git a/core/assets/sounds/respawning.mp3 b/core/assets/sounds/respawning.mp3 new file mode 100644 index 0000000000..b4ec328980 Binary files /dev/null and b/core/assets/sounds/respawning.mp3 differ diff --git a/core/assets/sounds/respawning.ogg b/core/assets/sounds/respawning.ogg deleted file mode 100644 index cc0e4332f8..0000000000 Binary files a/core/assets/sounds/respawning.ogg and /dev/null differ diff --git a/core/assets/sounds/sap.mp3 b/core/assets/sounds/sap.mp3 new file mode 100644 index 0000000000..3469e73b5f Binary files /dev/null and b/core/assets/sounds/sap.mp3 differ diff --git a/core/assets/sounds/sap.ogg b/core/assets/sounds/sap.ogg deleted file mode 100644 index d84c282d02..0000000000 Binary files a/core/assets/sounds/sap.ogg and /dev/null differ diff --git a/core/assets/sounds/shield.mp3 b/core/assets/sounds/shield.mp3 new file mode 100644 index 0000000000..560a8b181e Binary files /dev/null and b/core/assets/sounds/shield.mp3 differ diff --git a/core/assets/sounds/shield.ogg b/core/assets/sounds/shield.ogg deleted file mode 100644 index b427a07286..0000000000 Binary files a/core/assets/sounds/shield.ogg and /dev/null differ diff --git a/core/assets/sounds/shoot.mp3 b/core/assets/sounds/shoot.mp3 new file mode 100644 index 0000000000..c026c002ed Binary files /dev/null and b/core/assets/sounds/shoot.mp3 differ diff --git a/core/assets/sounds/shoot.ogg b/core/assets/sounds/shoot.ogg deleted file mode 100644 index d4b1c791c6..0000000000 Binary files a/core/assets/sounds/shoot.ogg and /dev/null differ diff --git a/core/assets/sounds/shootBig.mp3 b/core/assets/sounds/shootBig.mp3 new file mode 100644 index 0000000000..2164a6c1d4 Binary files /dev/null and b/core/assets/sounds/shootBig.mp3 differ diff --git a/core/assets/sounds/shootBig.ogg b/core/assets/sounds/shootBig.ogg deleted file mode 100644 index 9bc3bf055d..0000000000 Binary files a/core/assets/sounds/shootBig.ogg and /dev/null differ diff --git a/core/assets/sounds/shootSnap.mp3 b/core/assets/sounds/shootSnap.mp3 new file mode 100644 index 0000000000..0b66067f98 Binary files /dev/null and b/core/assets/sounds/shootSnap.mp3 differ diff --git a/core/assets/sounds/shootSnap.ogg b/core/assets/sounds/shootSnap.ogg deleted file mode 100644 index 17826bb5c0..0000000000 Binary files a/core/assets/sounds/shootSnap.ogg and /dev/null differ diff --git a/core/assets/sounds/shotgun.mp3 b/core/assets/sounds/shotgun.mp3 new file mode 100644 index 0000000000..3cd876ec0e Binary files /dev/null and b/core/assets/sounds/shotgun.mp3 differ diff --git a/core/assets/sounds/shotgun.ogg b/core/assets/sounds/shotgun.ogg deleted file mode 100644 index 47d5213579..0000000000 Binary files a/core/assets/sounds/shotgun.ogg and /dev/null differ diff --git a/core/assets/sounds/smelter.mp3 b/core/assets/sounds/smelter.mp3 new file mode 100644 index 0000000000..b902624932 Binary files /dev/null and b/core/assets/sounds/smelter.mp3 differ diff --git a/core/assets/sounds/smelter.ogg b/core/assets/sounds/smelter.ogg deleted file mode 100644 index 86bbaf63de..0000000000 Binary files a/core/assets/sounds/smelter.ogg and /dev/null differ diff --git a/core/assets/sounds/spark.mp3 b/core/assets/sounds/spark.mp3 new file mode 100644 index 0000000000..bf30b670a6 Binary files /dev/null and b/core/assets/sounds/spark.mp3 differ diff --git a/core/assets/sounds/spark.ogg b/core/assets/sounds/spark.ogg deleted file mode 100644 index ac61a476de..0000000000 Binary files a/core/assets/sounds/spark.ogg and /dev/null differ diff --git a/core/assets/sounds/splash.mp3 b/core/assets/sounds/splash.mp3 new file mode 100644 index 0000000000..69b79e154d Binary files /dev/null and b/core/assets/sounds/splash.mp3 differ diff --git a/core/assets/sounds/splash.ogg b/core/assets/sounds/splash.ogg deleted file mode 100644 index 59a77836c4..0000000000 Binary files a/core/assets/sounds/splash.ogg and /dev/null differ diff --git a/core/assets/sounds/spray.mp3 b/core/assets/sounds/spray.mp3 new file mode 100644 index 0000000000..f8e01f3690 Binary files /dev/null and b/core/assets/sounds/spray.mp3 differ diff --git a/core/assets/sounds/spray.ogg b/core/assets/sounds/spray.ogg deleted file mode 100644 index b781d106db..0000000000 Binary files a/core/assets/sounds/spray.ogg and /dev/null differ diff --git a/core/assets/sounds/steam.mp3 b/core/assets/sounds/steam.mp3 new file mode 100644 index 0000000000..3e19d755b5 Binary files /dev/null and b/core/assets/sounds/steam.mp3 differ diff --git a/core/assets/sounds/steam.ogg b/core/assets/sounds/steam.ogg deleted file mode 100644 index 9b65bac938..0000000000 Binary files a/core/assets/sounds/steam.ogg and /dev/null differ diff --git a/core/assets/sounds/swish.mp3 b/core/assets/sounds/swish.mp3 new file mode 100644 index 0000000000..5d29b3c422 Binary files /dev/null and b/core/assets/sounds/swish.mp3 differ diff --git a/core/assets/sounds/swish.ogg b/core/assets/sounds/swish.ogg deleted file mode 100644 index 4b6e5eec53..0000000000 Binary files a/core/assets/sounds/swish.ogg and /dev/null differ diff --git a/core/assets/sounds/techloop.mp3 b/core/assets/sounds/techloop.mp3 new file mode 100644 index 0000000000..d52ef2b73d Binary files /dev/null and b/core/assets/sounds/techloop.mp3 differ diff --git a/core/assets/sounds/techloop.ogg b/core/assets/sounds/techloop.ogg deleted file mode 100644 index 125ac36718..0000000000 Binary files a/core/assets/sounds/techloop.ogg and /dev/null differ diff --git a/core/assets/sounds/thruster.mp3 b/core/assets/sounds/thruster.mp3 new file mode 100644 index 0000000000..059711d30b Binary files /dev/null and b/core/assets/sounds/thruster.mp3 differ diff --git a/core/assets/sounds/thruster.ogg b/core/assets/sounds/thruster.ogg deleted file mode 100644 index cba59f95ab..0000000000 Binary files a/core/assets/sounds/thruster.ogg and /dev/null differ diff --git a/core/assets/sounds/tractorbeam.mp3 b/core/assets/sounds/tractorbeam.mp3 new file mode 100644 index 0000000000..cdf60a0a48 Binary files /dev/null and b/core/assets/sounds/tractorbeam.mp3 differ diff --git a/core/assets/sounds/tractorbeam.ogg b/core/assets/sounds/tractorbeam.ogg deleted file mode 100644 index 4c307c4e08..0000000000 Binary files a/core/assets/sounds/tractorbeam.ogg and /dev/null differ diff --git a/core/assets/sounds/unlock.mp3 b/core/assets/sounds/unlock.mp3 new file mode 100644 index 0000000000..7549ce044e Binary files /dev/null and b/core/assets/sounds/unlock.mp3 differ diff --git a/core/assets/sounds/unlock.ogg b/core/assets/sounds/unlock.ogg deleted file mode 100644 index 7149b695be..0000000000 Binary files a/core/assets/sounds/unlock.ogg and /dev/null differ diff --git a/core/assets/sounds/wave.mp3 b/core/assets/sounds/wave.mp3 new file mode 100644 index 0000000000..2b6819ce92 Binary files /dev/null and b/core/assets/sounds/wave.mp3 differ diff --git a/core/assets/sounds/wave.ogg b/core/assets/sounds/wave.ogg deleted file mode 100644 index bf74702474..0000000000 Binary files a/core/assets/sounds/wave.ogg and /dev/null differ diff --git a/core/assets/sounds/wind.mp3 b/core/assets/sounds/wind.mp3 new file mode 100644 index 0000000000..9328f354b4 Binary files /dev/null and b/core/assets/sounds/wind.mp3 differ diff --git a/core/assets/sounds/wind.ogg b/core/assets/sounds/wind.ogg deleted file mode 100644 index aeabe4802b..0000000000 Binary files a/core/assets/sounds/wind.ogg and /dev/null differ diff --git a/core/assets/sounds/wind2.mp3 b/core/assets/sounds/wind2.mp3 new file mode 100644 index 0000000000..7b7381b900 Binary files /dev/null and b/core/assets/sounds/wind2.mp3 differ diff --git a/core/assets/sounds/wind2.ogg b/core/assets/sounds/wind2.ogg deleted file mode 100644 index 3900ba35a1..0000000000 Binary files a/core/assets/sounds/wind2.ogg and /dev/null differ diff --git a/core/assets/sounds/windhowl.mp3 b/core/assets/sounds/windhowl.mp3 new file mode 100644 index 0000000000..aa67453a7b Binary files /dev/null and b/core/assets/sounds/windhowl.mp3 differ diff --git a/core/assets/sounds/windhowl.ogg b/core/assets/sounds/windhowl.ogg deleted file mode 100644 index de7526a616..0000000000 Binary files a/core/assets/sounds/windhowl.ogg and /dev/null differ diff --git a/core/assets/sounds/windowHide.mp3 b/core/assets/sounds/windowHide.mp3 new file mode 100644 index 0000000000..6778aa0e8a Binary files /dev/null and b/core/assets/sounds/windowHide.mp3 differ diff --git a/core/assets/sounds/windowHide.ogg b/core/assets/sounds/windowHide.ogg deleted file mode 100644 index 9039d4e3b4..0000000000 Binary files a/core/assets/sounds/windowHide.ogg and /dev/null differ diff --git a/core/src/mindustry/Vars.java b/core/src/mindustry/Vars.java index 8549513861..1cbcbaf468 100644 --- a/core/src/mindustry/Vars.java +++ b/core/src/mindustry/Vars.java @@ -67,7 +67,7 @@ public class Vars implements Loadable{ /** URL of the github issue report template.*/ public static final String reportIssueURL = "https://github.com/Anuken/Mindustry/issues/new?labels=bug&template=bug_report.md"; /** list of built-in servers.*/ - public static final Seq defaultServers = Seq.with(); + public static final Seq defaultServers = Seq.with(); /** maximum distance between mine and core that supports automatic transferring */ public static final float mineTransferRange = 220f; /** max chat message length */ diff --git a/core/src/mindustry/ai/Pathfinder.java b/core/src/mindustry/ai/Pathfinder.java index b7b0cfc907..d36cb32291 100644 --- a/core/src/mindustry/ai/Pathfinder.java +++ b/core/src/mindustry/ai/Pathfinder.java @@ -445,13 +445,12 @@ public class Pathfinder implements Runnable{ public void getPositions(IntSeq out){ out.add(Point2.pack(World.toTile(position.getX()), World.toTile(position.getY()))); } - } /** * Data for a flow field to some set of destinations. * Concrete subclasses must specify a way to fetch costs and destinations. - * */ + */ public static abstract class Flowfield{ /** Refresh rate in milliseconds. Return any number <= 0 to disable. */ protected int refreshRate; diff --git a/core/src/mindustry/ai/formations/Formation.java b/core/src/mindustry/ai/formations/Formation.java index 16db811b2f..db2ce02e14 100644 --- a/core/src/mindustry/ai/formations/Formation.java +++ b/core/src/mindustry/ai/formations/Formation.java @@ -17,10 +17,8 @@ import arc.struct.*; * @author davebaol */ public class Formation{ - /** A list of slots assignments. */ public Seq slotAssignments; - /** The anchor point of this formation. */ public Vec3 anchor; /** The formation pattern */ @@ -138,7 +136,6 @@ public class Formation{ * @return {@code false} if no more slots are available; {@code true} otherwise. */ public boolean addMember(FormationMember member){ - // Check if the pattern supports one more slot if(pattern.supportsSlots(slotAssignments.size + 1)){ // Add a new slot assignment diff --git a/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java index 35fd74f789..89e51054d2 100644 --- a/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/FreeSlotAssignmentStrategy.java @@ -16,8 +16,9 @@ public class FreeSlotAssignmentStrategy implements SlotAssignmentStrategy{ public void updateSlotAssignments(Seq assignments){ // A very simple assignment algorithm: we simply go through // each assignment in the list and assign sequential slot numbers - for(int i = 0; i < assignments.size; i++) + for(int i = 0; i < assignments.size; i++){ assignments.get(i).slotNumber = i; + } } @Override diff --git a/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java b/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java index f3f3c09bed..59c933c205 100644 --- a/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java +++ b/core/src/mindustry/ai/formations/SoftRoleSlotAssignmentStrategy.java @@ -51,7 +51,6 @@ public class SoftRoleSlotAssignmentStrategy extends BoundedSlotAssignmentStrateg @Override public void updateSlotAssignments(Seq assignments){ - // Holds a list of member and slot data for each member. Seq memberData = new Seq<>(); @@ -125,7 +124,6 @@ public class SoftRoleSlotAssignmentStrategy extends BoundedSlotAssignmentStrateg // Some sensible action should be taken, such as reporting to the player. throw new ArcRuntimeException("SoftRoleSlotAssignmentStrategy cannot find valid slot assignment for member " + memberDatum.member); } - } static class CostAndSlot implements Comparable{ diff --git a/core/src/mindustry/ai/types/BuilderAI.java b/core/src/mindustry/ai/types/BuilderAI.java index abaffecd40..76200981ac 100644 --- a/core/src/mindustry/ai/types/BuilderAI.java +++ b/core/src/mindustry/ai/types/BuilderAI.java @@ -71,7 +71,7 @@ public class BuilderAI extends AIController{ Units.nearby(unit.team, unit.x, unit.y, buildRadius, u -> { if(found) return; - if(u instanceof Builderc b && u != unit && ((Builderc)u).activelyBuilding()){ + if(u instanceof Builderc b && u != unit && b.activelyBuilding()){ BuildPlan plan = b.buildPlan(); Building build = world.build(plan.x, plan.y); @@ -119,7 +119,7 @@ public class BuilderAI extends AIController{ public boolean useFallback(){ return state.rules.waves && unit.team == state.rules.waveTeam && !unit.team.rules().ai; } - + @Override public boolean shouldShoot(){ return !((Builderc)unit).isBuilding(); diff --git a/core/src/mindustry/ai/types/FormationAI.java b/core/src/mindustry/ai/types/FormationAI.java index 002c52a75c..98f4874779 100644 --- a/core/src/mindustry/ai/types/FormationAI.java +++ b/core/src/mindustry/ai/types/FormationAI.java @@ -2,17 +2,13 @@ package mindustry.ai.types; import arc.math.*; import arc.math.geom.*; -import arc.struct.*; import arc.util.*; import mindustry.ai.formations.*; import mindustry.entities.units.*; import mindustry.gen.*; -import mindustry.type.*; -import mindustry.world.*; import mindustry.world.blocks.storage.CoreBlock.*; public class FormationAI extends AIController implements FormationMember{ - private static Seq tiles = new Seq<>(); public Unit leader; private Vec3 target = new Vec3(); @@ -30,9 +26,8 @@ public class FormationAI extends AIController implements FormationMember{ @Override public void updateUnit(){ - UnitType type = unit.type; - if(leader.dead){ + if(leader == null || leader.dead){ unit.resetController(); return; } diff --git a/core/src/mindustry/ai/types/LogicAI.java b/core/src/mindustry/ai/types/LogicAI.java index da86af9f59..20650efe53 100644 --- a/core/src/mindustry/ai/types/LogicAI.java +++ b/core/src/mindustry/ai/types/LogicAI.java @@ -104,9 +104,7 @@ public class LogicAI extends AIController{ //look where moving if there's nothing to aim at if(!shoot){ - if(unit.moving()){ - unit.lookAt(unit.vel().angle()); - } + unit.lookAt(unit.prefRotation()); }else if(unit.hasWeapons()){ //if there is, look at the object unit.lookAt(unit.mounts[0].aimX, unit.mounts[0].aimY); } diff --git a/core/src/mindustry/ai/types/MinerAI.java b/core/src/mindustry/ai/types/MinerAI.java index 1bb808d377..ae18e8085b 100644 --- a/core/src/mindustry/ai/types/MinerAI.java +++ b/core/src/mindustry/ai/types/MinerAI.java @@ -79,5 +79,4 @@ public class MinerAI extends AIController{ @Override protected void updateTargeting(){ } - } diff --git a/core/src/mindustry/ai/types/RepairAI.java b/core/src/mindustry/ai/types/RepairAI.java index 36504f908d..eb066e212c 100644 --- a/core/src/mindustry/ai/types/RepairAI.java +++ b/core/src/mindustry/ai/types/RepairAI.java @@ -36,12 +36,11 @@ public class RepairAI extends AIController{ Building target = Units.findDamagedTile(unit.team, unit.x, unit.y); if(target instanceof ConstructBuild) target = null; - + if(target == null){ super.updateTargeting(); }else{ this.target = target; } } - } diff --git a/core/src/mindustry/ai/types/SuicideAI.java b/core/src/mindustry/ai/types/SuicideAI.java index 1bda2c4b81..1143f31675 100644 --- a/core/src/mindustry/ai/types/SuicideAI.java +++ b/core/src/mindustry/ai/types/SuicideAI.java @@ -31,7 +31,7 @@ public class SuicideAI extends GroundAI{ if(!Units.invalidateTarget(target, unit, unit.range()) && unit.hasWeapons()){ rotate = true; shoot = unit.within(target, unit.type.weapons.first().bullet.range() + - (target instanceof Building ? ((Building)target).block.size * Vars.tilesize / 2f : ((Hitboxc)target).hitSize() / 2f)); + (target instanceof Building b ? b.block.size * Vars.tilesize / 2f : ((Hitboxc)target).hitSize() / 2f)); if(unit.type.hasWeapons()){ unit.aimLook(Predict.intercept(unit, target, unit.type.weapons.first().bullet.speed)); @@ -68,7 +68,6 @@ public class SuicideAI extends GroundAI{ unit.moveAt(vec.set(target).sub(unit).limit(unit.speed())); } } - } if(!moveToTarget){ diff --git a/core/src/mindustry/audio/LoopControl.java b/core/src/mindustry/audio/LoopControl.java index 56f06d9e1b..2419406176 100644 --- a/core/src/mindustry/audio/LoopControl.java +++ b/core/src/mindustry/audio/LoopControl.java @@ -41,7 +41,7 @@ public class LoopControl{ data.soundID = -1; return; } - sound.setPan(data.soundID, pan, data.curVolume); + sound.set(data.soundID, pan, data.curVolume); } data.volume = 0f; diff --git a/core/src/mindustry/audio/MusicControl.java b/core/src/mindustry/audio/MusicControl.java index 85979e4f65..33fd752d48 100644 --- a/core/src/mindustry/audio/MusicControl.java +++ b/core/src/mindustry/audio/MusicControl.java @@ -6,6 +6,7 @@ import arc.audio.SoloudAudio.*; import arc.math.*; import arc.struct.*; import arc.util.*; +import mindustry.content.*; import mindustry.game.EventType.*; import mindustry.gen.*; @@ -13,12 +14,14 @@ import static mindustry.Vars.*; /** Controls playback of multiple music tracks.*/ public class MusicControl{ - protected static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.5f; + protected static final float finTime = 120f, foutTime = 120f, musicInterval = 60 * 60 * 3f, musicChance = 0.6f, musicWaveChance = 0.46f; /** normal, ambient music, plays at any time */ public Seq ambientMusic = Seq.with(); /** darker music, used in times of conflict */ public Seq darkMusic = Seq.with(); + /** music used explicitly after boss spawns */ + public Seq bossMusic = Seq.with(); protected Music lastRandomPlayed; protected Interval timer = new Interval(); @@ -35,8 +38,12 @@ public class MusicControl{ Events.on(ClientLoadEvent.class, e -> reload()); //only run music 10 seconds after a wave spawns - Events.on(WaveEvent.class, e -> Time.run(60f * 10f, () -> { - if(Mathf.chance(musicWaveChance)){ + Events.on(WaveEvent.class, e -> Time.run(Mathf.random(8f, 15f) * 60f, () -> { + boolean boss = state.rules.spawns.contains(group -> group.getSpawned(state.wave - 2) > 0 && group.effect == StatusEffects.boss); + + if(boss){ + playOnce(bossMusic.random(lastRandomPlayed)); + }else if(Mathf.chance(musicWaveChance)){ playRandom(); } })); @@ -45,8 +52,9 @@ public class MusicControl{ protected void reload(){ current = null; fade = 0f; - ambientMusic = Seq.with(Musics.game1, Musics.game3, Musics.game4, Musics.game6); - darkMusic = Seq.with(Musics.game2, Musics.game5, Musics.game7); + ambientMusic = Seq.with(Musics.game1, Musics.game3, Musics.game6, Musics.game8, Musics.game9); + darkMusic = Seq.with(Musics.game2, Musics.game5, Musics.game7, Musics.game4); + bossMusic = Seq.with(Musics.boss1, Musics.boss2, Musics.game2, Musics.game5); } public void stop(){ diff --git a/core/src/mindustry/audio/SoundLoop.java b/core/src/mindustry/audio/SoundLoop.java index a4b229b147..59e831b3e0 100644 --- a/core/src/mindustry/audio/SoundLoop.java +++ b/core/src/mindustry/audio/SoundLoop.java @@ -23,7 +23,6 @@ public class SoundLoop{ if(id < 0){ if(play){ id = sound.loop(sound.calcVolume(x, y) * volume * baseVolume, 1f, sound.calcPan(x, y)); - Log.info("playing, id = @", id); } }else{ //fade the sound in or out @@ -38,7 +37,7 @@ public class SoundLoop{ } } - sound.setPan(id, sound.calcPan(x, y), sound.calcVolume(x, y) * volume * baseVolume); + sound.set(id, sound.calcPan(x, y), sound.calcVolume(x, y) * volume * baseVolume); } } diff --git a/core/src/mindustry/content/Fx.java b/core/src/mindustry/content/Fx.java index 1ccabafe6d..ef2973f19e 100644 --- a/core/src/mindustry/content/Fx.java +++ b/core/src/mindustry/content/Fx.java @@ -389,7 +389,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); - }), hitBulletBig = new Effect(13, e -> { @@ -400,7 +399,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1.5f); }); - }), hitFlameSmall = new Effect(14, e -> { @@ -411,7 +409,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 3 + 1f); }); - }), hitLiquid = new Effect(16, e -> { @@ -420,7 +417,6 @@ public class Fx{ randLenVectors(e.id, 5, e.fin() * 15f, e.rotation, 60f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 2f); }); - }), hitLancer = new Effect(12, e -> { @@ -431,7 +427,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); - }), hitMeltdown = new Effect(12, e -> { @@ -442,7 +437,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); - }), hitMeltHeal = new Effect(12, e -> { @@ -453,7 +447,6 @@ public class Fx{ float ang = Mathf.angle(x, y); lineAngle(e.x + x, e.y + y, ang, e.fout() * 4 + 1f); }); - }), instBomb = new Effect(15f, 100f, e -> { @@ -553,8 +546,8 @@ public class Fx{ }), flakExplosion = new Effect(20, e -> { - color(Pal.bulletYellow); + e.scaled(6, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 10f); @@ -572,12 +565,11 @@ public class Fx{ randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), plasticExplosion = new Effect(24, e -> { - color(Pal.plastaniumFront); + e.scaled(7, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 24f); @@ -595,12 +587,11 @@ public class Fx{ randLenVectors(e.id + 1, 4, 1f + 25f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), plasticExplosionFlak = new Effect(28, e -> { - color(Pal.plastaniumFront); + e.scaled(7, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 34f); @@ -618,12 +609,11 @@ public class Fx{ randLenVectors(e.id + 1, 4, 1f + 30f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), blastExplosion = new Effect(22, e -> { - color(Pal.missileYellow); + e.scaled(6, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 15f); @@ -641,12 +631,11 @@ public class Fx{ randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), sapExplosion = new Effect(25, e -> { - color(Pal.sapBullet); + e.scaled(6, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 80f); @@ -664,12 +653,11 @@ public class Fx{ randLenVectors(e.id + 1, 8, 1f + 60f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), massiveExplosion = new Effect(30, e -> { - color(Pal.missileYellow); + e.scaled(7, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 4f + i.fin() * 30f); @@ -687,7 +675,6 @@ public class Fx{ randLenVectors(e.id + 1, 6, 1f + 29f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 4f); }); - }), artilleryTrail = new Effect(50, e -> { @@ -712,8 +699,8 @@ public class Fx{ }), flakExplosionBig = new Effect(30, e -> { - color(Pal.bulletYellowBack); + e.scaled(6, i -> { stroke(3f * i.fout()); Lines.circle(e.x, e.y, 3f + i.fin() * 25f); @@ -731,7 +718,6 @@ public class Fx{ randLenVectors(e.id + 1, 4, 1f + 23f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), burning = new Effect(35f, e -> { @@ -740,7 +726,6 @@ public class Fx{ randLenVectors(e.id, 3, 2f + e.fin() * 7f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.1f + e.fout() * 1.4f); }); - }), fire = new Effect(50f, e -> { @@ -761,7 +746,6 @@ public class Fx{ randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); }); - }), steam = new Effect(35f, e -> { @@ -770,7 +754,6 @@ public class Fx{ randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.2f + e.fslope() * 1.5f); }); - }), fireballsmoke = new Effect(25f, e -> { @@ -779,7 +762,6 @@ public class Fx{ randLenVectors(e.id, 1, 2f + e.fin() * 7f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); }); - }), ballfire = new Effect(25f, e -> { @@ -788,7 +770,6 @@ public class Fx{ randLenVectors(e.id, 2, 2f + e.fin() * 7f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.2f + e.fout() * 1.5f); }); - }), freezing = new Effect(40f, e -> { @@ -797,7 +778,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 1.2f); }); - }), melting = new Effect(40f, e -> { @@ -806,7 +786,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + e.fin() * 3f, (x, y) -> { Fill.circle(e.x + x, e.y + y, .2f + e.fout() * 1.2f); }); - }), wet = new Effect(80f, e -> { @@ -815,7 +794,7 @@ public class Fx{ Fill.circle(e.x, e.y, e.fout() * 1f); }), - + muddy = new Effect(80f, e -> { color(Color.valueOf("432722")); alpha(Mathf.clamp(e.fin() * 2f)); @@ -829,7 +808,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { Fill.square(e.x + x, e.y + y, e.fslope() * 1.1f, 45f); }); - }), sporeSlowed = new Effect(40f, e -> { @@ -844,7 +822,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 1f); }); - }), overdriven = new Effect(20f, e -> { @@ -853,7 +830,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + e.fin() * 2f, (x, y) -> { Fill.square(e.x + x, e.y + y, e.fout() * 2.3f + 0.5f); }); - }), overclocked = new Effect(50f, e -> { @@ -962,7 +938,6 @@ public class Fx{ randLenVectors(e.id + 1, 9, 1f + 23f * e.finpow(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), 1f + e.fout() * 3f); }); - }), blockExplosionSmoke = new Effect(30, e -> { @@ -972,7 +947,6 @@ public class Fx{ Fill.circle(e.x + x, e.y + y, e.fout() * 3f); Fill.circle(e.x + x / 2f, e.y + y / 2f, e.fout() * 1f); }); - }), shootSmall = new Effect(8, e -> { @@ -1002,7 +976,6 @@ public class Fx{ randLenVectors(e.id, 5, e.finpow() * 6f, e.rotation, 20f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 1.5f); }); - }), shootBig = new Effect(9, e -> { @@ -1025,7 +998,6 @@ public class Fx{ randLenVectors(e.id, 8, e.finpow() * 19f, e.rotation, 10f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 2f + 0.2f); }); - }), shootBigSmoke2 = new Effect(18f, e -> { @@ -1034,7 +1006,6 @@ public class Fx{ randLenVectors(e.id, 9, e.finpow() * 23f, e.rotation, 20f, (x, y) -> { Fill.circle(e.x + x, e.y + y, e.fout() * 2.4f + 0.2f); }); - }), shootSmallFlame = new Effect(32f, 80f, e -> { @@ -1043,7 +1014,6 @@ public class Fx{ randLenVectors(e.id, 8, e.finpow() * 60f, e.rotation, 10f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.5f); }); - }), shootPyraFlame = new Effect(33f, 80f, e -> { @@ -1052,7 +1022,6 @@ public class Fx{ randLenVectors(e.id, 10, e.finpow() * 70f, e.rotation, 10f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.65f + e.fout() * 1.6f); }); - }), shootLiquid = new Effect(40f, 80f, e -> { @@ -1061,7 +1030,6 @@ public class Fx{ randLenVectors(e.id, 6, e.finpow() * 60f, e.rotation, 11f, (x, y) -> { Fill.circle(e.x + x, e.y + y, 0.5f + e.fout() * 2.5f); }); - }), casing1 = new Effect(30f, e -> { @@ -1197,7 +1165,6 @@ public class Fx{ for(int i : Mathf.signs){ Drawf.tri(e.x, e.y, 4f * e.fout(), 29f, e.rotation + 90f * i); } - }), lancerLaserShootSmoke = new Effect(26f, e -> { @@ -1207,7 +1174,6 @@ public class Fx{ randLenVectors(e.id, 7, length, e.rotation, 0f, (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fout() * 9f); }); - }), lancerLaserCharge = new Effect(38f, e -> { @@ -1216,7 +1182,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 3f + 1f); }); - }), lancerLaserChargeBegin = new Effect(60f, e -> { @@ -1233,7 +1198,6 @@ public class Fx{ randLenVectors(e.id, 2, 1f + 20f * e.fout(), e.rotation, 120f, (x, y) -> { Drawf.tri(e.x + x, e.y + y, e.fslope() * 3f + 1, e.fslope() * 3f + 1, Mathf.angle(x, y)); }); - }), sparkShoot = new Effect(12f, e -> { @@ -1243,7 +1207,6 @@ public class Fx{ randLenVectors(e.id, 7, 25f * e.finpow(), e.rotation, 3f, (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 5f + 0.5f); }); - }), lightningShoot = new Effect(12f, e -> { @@ -1372,21 +1335,21 @@ public class Fx{ Fill.square(e.x + x, e.y + y, e.fout() * 2.5f + 0.5f, 45); }); }), - + pulverizeSmall = new Effect(30, e -> { randLenVectors(e.id, 3, e.fin() * 5f, (x, y) -> { color(Pal.stoneGray); Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); }); }), - + pulverizeMedium = new Effect(30, e -> { randLenVectors(e.id, 5, 3f + e.fin() * 8f, (x, y) -> { color(Pal.stoneGray); Fill.square(e.x + x, e.y + y, e.fout() * 1f + 0.5f, 45); }); }), - + producesmoke = new Effect(12, e -> { randLenVectors(e.id, 8, 4f + e.fin() * 18f, (x, y) -> { color(Color.white, Pal.accent, e.fin()); @@ -1401,21 +1364,21 @@ public class Fx{ Fill.circle(e.x + x, e.y + y, 0.5f + fout * 4f); }); }), - + smeltsmoke = new Effect(15, e -> { randLenVectors(e.id, 6, 4f + e.fin() * 5f, (x, y) -> { color(Color.white, e.color, e.fin()); Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); }); }), - + formsmoke = new Effect(40, e -> { randLenVectors(e.id, 6, 5f + e.fin() * 8f, (x, y) -> { color(Pal.plasticSmoke, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, 0.2f + e.fout() * 2f, 45); }); }), - + blastsmoke = new Effect(26, e -> { randLenVectors(e.id, 12, 1f + e.fin() * 23f, (x, y) -> { float size = 2f + e.fout() * 6f; @@ -1423,7 +1386,7 @@ public class Fx{ Fill.circle(e.x + x, e.y + y, size/2f); }); }), - + lava = new Effect(18, e -> { randLenVectors(e.id, 3, 1f + e.fin() * 10f, (x, y) -> { float size = e.fslope() * 4f; @@ -1431,50 +1394,58 @@ public class Fx{ Fill.circle(e.x + x, e.y + y, size/2f); }); }), - + dooropen = new Effect(10, e -> { stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize / 2f + e.fin() * 2f); }), - + doorclose = new Effect(10, e -> { stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize / 2f + e.fout() * 2f); }), + dooropenlarge = new Effect(10, e -> { stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize + e.fin() * 2f); }), + doorcloselarge = new Effect(10, e -> { stroke(e.fout() * 1.6f); Lines.square(e.x, e.y, tilesize + e.fout() * 2f); }), + purify = new Effect(10, e -> { color(Color.royal, Color.gray, e.fin()); stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); }), + purifyoil = new Effect(10, e -> { color(Color.black, Color.gray, e.fin()); stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); }), + purifystone = new Effect(10, e -> { color(Color.orange, Color.gray, e.fin()); stroke(2f); Lines.spikes(e.x, e.y, e.fin() * 4f, 2, 6); }), + generate = new Effect(11, e -> { color(Color.orange, Color.yellow, e.fin()); stroke(1f); Lines.spikes(e.x, e.y, e.fin() * 5f, 2, 8); }), + mine = new Effect(20, e -> { randLenVectors(e.id, 6, 3f + e.fin() * 6f, (x, y) -> { color(e.color, Color.lightGray, e.fin()); Fill.square(e.x + x, e.y + y, e.fout() * 2f, 45); }); }), + mineBig = new Effect(30, e -> { randLenVectors(e.id, 6, 4f + e.fin() * 8f, (x, y) -> { color(e.color, Color.lightGray, e.fin()); @@ -1488,12 +1459,14 @@ public class Fx{ Fill.square(e.x + x, e.y + y, e.fout() * 2f + 0.5f, 45); }); }), + smelt = new Effect(20, e -> { randLenVectors(e.id, 6, 2f + e.fin() * 5f, (x, y) -> { color(Color.white, e.color, e.fin()); Fill.square(e.x + x, e.y + y, 0.5f + e.fout() * 2f, 45); }); }), + teleportActivate = new Effect(50, e -> { color(e.color); @@ -1507,8 +1480,8 @@ public class Fx{ randLenVectors(e.id, 30, 4f + 40f * e.fin(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); - }), + teleport = new Effect(60, e -> { color(e.color); stroke(e.fin() * 2f); @@ -1517,8 +1490,8 @@ public class Fx{ randLenVectors(e.id, 20, 6f + 20f * e.fout(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fin() * 4f + 1f); }); - }), + teleportOut = new Effect(20, e -> { color(e.color); stroke(e.fout() * 2f); @@ -1527,7 +1500,6 @@ public class Fx{ randLenVectors(e.id, 20, 4f + 20f * e.fin(), (x, y) -> { lineAngle(e.x + x, e.y + y, Mathf.angle(x, y), e.fslope() * 4f + 1f); }); - }), ripple = new Effect(30, e -> { @@ -1611,7 +1583,6 @@ public class Fx{ float radius = unit.hitSize() * 1.3f; - e.scaled(16f, c -> { color(Pal.shield); stroke(c.fout() * 2f + 0.1f); diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 5e3de00a61..37d59bf84b 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -21,7 +21,7 @@ public class UnitTypes implements ContentList{ public static @EntityDef({Unitc.class, Mechc.class}) UnitType mace, dagger, crawler, fortress, scepter, reign; //mech + builder + miner - public static @EntityDef({Unitc.class, Mechc.class, Builderc.class, Minerc.class}) UnitType nova, pulsar, quasar; + public static @EntityDef({Unitc.class, Mechc.class, Builderc.class}) UnitType nova, pulsar, quasar; //mech public static @EntityDef({Unitc.class, Mechc.class}) UnitType vela; @@ -35,23 +35,23 @@ public class UnitTypes implements ContentList{ //air (no special traits) public static @EntityDef({Unitc.class}) UnitType flare, eclipse, horizon, zenith, antumbra; - //air + mining - public static @EntityDef({Unitc.class, Minerc.class}) UnitType mono; + //air, legacy mining + public static @EntityDef(value = {Unitc.class}, legacy = true) UnitType mono; //air + building + mining - public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType poly; + public static @EntityDef({Unitc.class, Builderc.class}) UnitType poly; //air + building + mining + payload - public static @EntityDef({Unitc.class, Builderc.class, Minerc.class, Payloadc.class}) UnitType mega; + public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType mega; //air + building + payload - public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class}) UnitType quad; + public static @EntityDef(value = {Unitc.class, Builderc.class, Payloadc.class}, legacy = true) UnitType quad; //air + building + payload public static @EntityDef({Unitc.class, Builderc.class, Payloadc.class, AmmoDistributec.class}) UnitType oct; //air + building + mining - public static @EntityDef({Unitc.class, Builderc.class, Minerc.class}) UnitType alpha, beta, gamma; + public static @EntityDef({Unitc.class, Builderc.class}) UnitType alpha, beta, gamma; //water public static @EntityDef({Unitc.class, WaterMovec.class}) UnitType risso, minke, bryde, sei, omura; @@ -928,7 +928,7 @@ public class UnitTypes implements ContentList{ smokeEffect = Fx.shootSmallSmoke; ammoMultiplier = 2; }}; - shootSound = Sounds.shoot; + shootSound = Sounds.pew; }}); }}; @@ -1216,7 +1216,7 @@ public class UnitTypes implements ContentList{ reload = 30f; ejectEffect = Fx.none; recoil = 2f; - shootSound = Sounds.pew; + shootSound = Sounds.missile; shots = 1; velocityRnd = 0.5f; inaccuracy = 15f; @@ -1232,6 +1232,7 @@ public class UnitTypes implements ContentList{ smokeEffect = Fx.hitLaser; hitEffect = despawnEffect = Fx.hitLaser; frontColor = Color.white; + hitSound = Sounds.none; healPercent = 5.5f; collidesTeam = true; diff --git a/core/src/mindustry/core/ContentLoader.java b/core/src/mindustry/core/ContentLoader.java index 975bc4d1f8..b7c0fbd0e0 100644 --- a/core/src/mindustry/core/ContentLoader.java +++ b/core/src/mindustry/core/ContentLoader.java @@ -160,8 +160,8 @@ public class ContentLoader{ public void removeLast(){ if(lastAdded != null && contentMap[lastAdded.getContentType().ordinal()].peek() == lastAdded){ contentMap[lastAdded.getContentType().ordinal()].pop(); - if(lastAdded instanceof MappableContent){ - contentNameMap[lastAdded.getContentType().ordinal()].remove(((MappableContent)lastAdded).name); + if(lastAdded instanceof MappableContent c){ + contentNameMap[lastAdded.getContentType().ordinal()].remove(c.name); } } } diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 6e6592e42f..b492199be5 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -12,6 +12,7 @@ import arc.util.*; import mindustry.audio.*; import mindustry.content.*; import mindustry.core.GameState.*; +import mindustry.ctype.*; import mindustry.entities.*; import mindustry.game.EventType.*; import mindustry.game.*; @@ -290,7 +291,7 @@ public class Control implements ApplicationListener, Loadable{ //reset win wave?? state.rules.winWave = state.rules.attackMode ? -1 : sector.preset != null ? sector.preset.captureWave : 40; - //kill all units, since they should be dead anwyay + //kill all units, since they should be dead anyway Groups.unit.clear(); Groups.fire.clear(); @@ -400,8 +401,8 @@ public class Control implements ApplicationListener, Loadable{ try{ SaveIO.save(control.saves.getCurrent().file); Log.info("Saved on exit."); - }catch(Throwable e){ - e.printStackTrace(); + }catch(Throwable t){ + Log.err(t); } } diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 55df925737..05c9da481b 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -326,5 +326,4 @@ public class Logic implements ApplicationListener{ public boolean isWaitingWave(){ return (state.rules.waitEnemies || (state.wave >= state.rules.winWave && state.rules.winWave > 0)) && state.enemies > 0; } - } diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index 2ca19de419..055b6c71b5 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -32,7 +32,7 @@ import static mindustry.Vars.*; public class NetClient implements ApplicationListener{ private static final float dataTimeout = 60 * 18; private static final float playerSyncTime = 2; - public final static float viewScale = 2f; + public static final float viewScale = 2f; private long ping; private Interval timer = new Interval(5); @@ -234,7 +234,7 @@ public class NetClient implements ApplicationListener{ ui.join.connect(ip, port); } - + @Remote(targets = Loc.client) public static void ping(Player player, long time){ Call.pingResponse(player.con, time); @@ -439,7 +439,7 @@ public class NetClient implements ApplicationListener{ tile.build.readAll(Reads.get(input), tile.build.version()); } }catch(Exception e){ - e.printStackTrace(); + Log.err(e); } } @@ -577,8 +577,8 @@ public class NetClient implements ApplicationListener{ //prevent buffer overflow by checking config length for(int i = 0; i < usedRequests; i++){ BuildPlan plan = player.builder().plans().get(i); - if(plan.config instanceof byte[]){ - int length = ((byte[])plan.config).length; + if(plan.config instanceof byte[] b){ + int length = b.length; totalLength += length; } @@ -604,7 +604,7 @@ public class NetClient implements ApplicationListener{ unit.x, unit.y, player.unit().aimX(), player.unit().aimY(), unit.rotation, - unit instanceof Mechc ? ((Mechc)unit).baseRotation() : 0, + unit instanceof Mechc m ? m.baseRotation() : 0, unit.vel.x, unit.vel.y, player.miner().mineTile(), player.boosting, player.shooting, ui.chatfrag.shown(), control.input.isBuilding, diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index c6709d2259..3f1de4d98a 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -164,7 +164,7 @@ public class NetServer implements ApplicationListener{ info.id = packet.uuid; admins.save(); Call.infoMessage(con, "You are not whitelisted here."); - Log.info("&lcDo &lywhitelist-add @&lc to whitelist the player &lb'@'", packet.uuid, packet.name); + info("&lcDo &lywhitelist-add @&lc to whitelist the player &lb'@'", packet.uuid, packet.name); con.kick(KickReason.whitelist); return; } @@ -226,8 +226,8 @@ public class NetServer implements ApplicationListener{ writeBuffer.reset(); player.write(outputBuffer); }catch(Throwable t){ - t.printStackTrace(); con.kick(KickReason.nameEmpty); + err(t); return; } @@ -248,10 +248,10 @@ public class NetServer implements ApplicationListener{ try{ RemoteReadServer.readPacket(packet.reader(), packet.type, con.player); }catch(ValidateException e){ - Log.debug("Validation failed for '@': @", e.player, e.getMessage()); + debug("Validation failed for '@': @", e.player, e.getMessage()); }catch(RuntimeException e){ if(e.getCause() instanceof ValidateException v){ - Log.debug("Validation failed for '@': @", v.player, v.getMessage()); + debug("Validation failed for '@': @", v.player, v.getMessage()); }else{ throw e; } @@ -305,7 +305,7 @@ public class NetServer implements ApplicationListener{ player.sendMessage("[scarlet]You must be admin to use this command."); return; } - + Groups.player.each(Player::admin, a -> a.sendMessage(args[0], player, "[#" + Pal.adminChat.toString() + "]" + NetClient.colorizeName(player.id, player.name))); }); @@ -418,7 +418,7 @@ public class NetServer implements ApplicationListener{ VoteSession session = new VoteSession(currentlyKicking, found); session.vote(player, 1); - vtime.reset(); + vtime.reset(); currentlyKicking[0] = session; } }else{ @@ -493,7 +493,7 @@ public class NetServer implements ApplicationListener{ data.stream = new ByteArrayInputStream(stream.toByteArray()); player.con.sendStream(data); - Log.debug("Packed @ bytes of world data.", stream.size()); + debug("Packed @ bytes of world data.", stream.size()); } public void addPacketHandler(String type, Cons2 handler){ @@ -505,7 +505,7 @@ public class NetServer implements ApplicationListener{ } public static void onDisconnect(Player player, String reason){ - //singleplayer multiplayer wierdness + //singleplayer multiplayer weirdness if(player.con == null){ player.remove(); return; @@ -519,7 +519,7 @@ public class NetServer implements ApplicationListener{ } String message = Strings.format("&lb@&fi&lk has disconnected. &fi&lk[&lb@&fi&lk] (@)", player.name, player.uuid(), reason); - if(Config.showConnectMessages.bool()) Log.info(message); + if(Config.showConnectMessages.bool()) info(message); } player.remove(); @@ -539,7 +539,7 @@ public class NetServer implements ApplicationListener{ public static void serverPacketUnreliable(Player player, String type, String contents){ serverPacketReliable(player, type, contents); } - + private static boolean invalid(float f){ return Float.isInfinite(f) || Float.isNaN(f); } @@ -702,15 +702,14 @@ public class NetServer implements ApplicationListener{ @Remote(targets = Loc.client, called = Loc.server) public static void adminRequest(Player player, Player other, AdminAction action){ - if(!player.admin){ - Log.warn("ACCESS DENIED: Player @ / @ attempted to perform admin action '@' on '@' without proper security access.", + warn("ACCESS DENIED: Player @ / @ attempted to perform admin action '@' on '@' without proper security access.", player.name, player.con.address, action.name(), other == null ? null : other.name); return; } if(other == null || ((other.admin && !player.isLocal()) && other != player)){ - Log.warn("@ attempted to perform admin action on nonexistant or admin player.", player.name); + warn("@ attempted to perform admin action on nonexistant or admin player.", player.name); return; } @@ -722,10 +721,10 @@ public class NetServer implements ApplicationListener{ netServer.admins.banPlayerIP(other.con.address); netServer.admins.banPlayerID(other.con.uuid); other.kick(KickReason.banned); - Log.info("&lc@ has banned @.", player.name, other.name); + info("&lc@ has banned @.", player.name, other.name); }else if(action == AdminAction.kick){ other.kick(KickReason.kick); - Log.info("&lc@ has kicked @.", player.name, other.name); + info("&lc@ has kicked @.", player.name, other.name); }else if(action == AdminAction.trace){ TraceInfo info = new TraceInfo(other.con.address, other.uuid(), other.con.modclient, other.con.mobile); if(player.con != null){ @@ -733,7 +732,7 @@ public class NetServer implements ApplicationListener{ }else{ NetClient.traceInfo(other, info); } - Log.info("&lc@ has requested trace info of @.", player.name, other.name); + info("&lc@ has requested trace info of @.", player.name, other.name); } } @@ -748,7 +747,7 @@ public class NetServer implements ApplicationListener{ if(Config.showConnectMessages.bool()){ Call.sendMessage("[accent]" + player.name + "[accent] has connected."); String message = Strings.format("&lb@&fi&lk has connected. &fi&lk[&lb@&fi&lk]", player.name, player.uuid()); - Log.info(message); + info(message); } if(!Config.motd.string().equalsIgnoreCase("off")){ @@ -773,7 +772,6 @@ public class NetServer implements ApplicationListener{ @Override public void update(){ - if(!headless && !closing && net.server() && state.isMenu()){ closing = true; ui.loadfrag.show("@server.closing"); @@ -799,7 +797,7 @@ public class NetServer implements ApplicationListener{ net.host(Config.port.num()); info("Opened a server on port @.", Config.port.num()); }catch(BindException e){ - Log.err("Unable to host: Port already in use! Make sure no other servers are running on the same port in your network."); + err("Unable to host: Port already in use! Make sure no other servers are running on the same port in your network."); state.set(State.menu); }catch(IOException e){ err(e); @@ -915,7 +913,6 @@ public class NetServer implements ApplicationListener{ } String checkColor(String str){ - for(int i = 1; i < str.length(); i++){ if(str.charAt(i) == ']'){ String color = str.substring(1, i); @@ -941,7 +938,6 @@ public class NetServer implements ApplicationListener{ } void sync(){ - try{ Groups.player.each(p -> !p.isLocal(), player -> { if(player.con == null || !player.con.isConnected()){ @@ -965,7 +961,7 @@ public class NetServer implements ApplicationListener{ } }catch(IOException e){ - e.printStackTrace(); + Log.err(e); } } diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 30a6c5db70..bdc9b77601 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -139,9 +139,9 @@ public class Renderer implements ApplicationListener{ } bloom = new Bloom(true); }catch(Throwable e){ - e.printStackTrace(); settings.put("bloom", false); ui.showErrorMessage("@error.bloom"); + Log.err(e); } } @@ -364,5 +364,4 @@ public class Renderer implements ApplicationListener{ buffer.dispose(); } - } diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 2a8c1925f8..4ce01d4961 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -104,7 +104,7 @@ public class UI implements ApplicationListener, Loadable{ Tooltips.getInstance().textProvider = text -> new Tooltip(t -> t.background(Styles.black5).margin(4f).add(text)); Core.settings.setErrorHandler(e -> { - e.printStackTrace(); + Log.err(e); Core.app.post(() -> showErrorMessage("Failed to access local storage.\nSettings will not be saved.")); }); diff --git a/core/src/mindustry/core/Version.java b/core/src/mindustry/core/Version.java index c2744700a4..bfde8ab511 100644 --- a/core/src/mindustry/core/Version.java +++ b/core/src/mindustry/core/Version.java @@ -46,6 +46,10 @@ public class Version{ } } + public static String buildString(){ + return build < 0 ? "custom" : build + (revision == 0 ? "" : "." + revision); + } + /** get menu version without colors */ public static String combined(){ if(build == -1){ diff --git a/core/src/mindustry/core/World.java b/core/src/mindustry/core/World.java index b2607aa68e..c4819ed222 100644 --- a/core/src/mindustry/core/World.java +++ b/core/src/mindustry/core/World.java @@ -445,7 +445,6 @@ public class World{ int err = dx - dy; int e2; while(true){ - if(cons.accept(x0, y0)) return true; if(x0 == x1 && y0 == y1) return false; diff --git a/core/src/mindustry/ctype/UnlockableContent.java b/core/src/mindustry/ctype/UnlockableContent.java index ab16eea106..57fcd76392 100644 --- a/core/src/mindustry/ctype/UnlockableContent.java +++ b/core/src/mindustry/ctype/UnlockableContent.java @@ -126,7 +126,7 @@ public abstract class UnlockableContent extends MappableContent{ } public boolean unlocked(){ - if(net != null && net.client()) return state.rules.researched.contains(name); + if(net != null && net.client()) return alwaysUnlocked || state.rules.researched.contains(name); return unlocked || alwaysUnlocked; } diff --git a/core/src/mindustry/editor/MapGenerateDialog.java b/core/src/mindustry/editor/MapGenerateDialog.java index 55576742c4..f6a87f77b1 100644 --- a/core/src/mindustry/editor/MapGenerateDialog.java +++ b/core/src/mindustry/editor/MapGenerateDialog.java @@ -404,7 +404,7 @@ public class MapGenerateDialog extends BaseDialog{ }); }catch(Exception e){ generating = false; - e.printStackTrace(); + Log.err(e); } world.setGenerating(false); }); diff --git a/core/src/mindustry/entities/Damage.java b/core/src/mindustry/entities/Damage.java index cd3777d063..631b6724f6 100644 --- a/core/src/mindustry/entities/Damage.java +++ b/core/src/mindustry/entities/Damage.java @@ -408,8 +408,7 @@ public class Damage{ } @Struct - static - class PropCellStruct{ + static class PropCellStruct{ byte x; byte y; short damage; diff --git a/core/src/mindustry/entities/EntityCollisions.java b/core/src/mindustry/entities/EntityCollisions.java index b4139991a4..3425314810 100644 --- a/core/src/mindustry/entities/EntityCollisions.java +++ b/core/src/mindustry/entities/EntityCollisions.java @@ -115,7 +115,6 @@ public class EntityCollisions{ @SuppressWarnings("unchecked") public void updatePhysics(EntityGroup group){ - QuadTree tree = group.tree(); tree.clear(); @@ -141,7 +140,6 @@ public class EntityCollisions{ } private void checkCollide(Hitboxc a, Hitboxc b){ - a.hitbox(this.r1); b.hitbox(this.r2); @@ -218,7 +216,6 @@ public class EntityCollisions{ @SuppressWarnings("unchecked") public void collide(EntityGroup groupa){ - groupa.each(solid -> { solid.hitbox(r1); r1.x += (solid.lastX() - solid.getX()); diff --git a/core/src/mindustry/entities/EntityGroup.java b/core/src/mindustry/entities/EntityGroup.java index 2135d9d6aa..50e97ccae4 100644 --- a/core/src/mindustry/entities/EntityGroup.java +++ b/core/src/mindustry/entities/EntityGroup.java @@ -183,8 +183,7 @@ public class EntityGroup implements Iterable{ array.each(Entityc::remove); array.clear(); - if(map != null) - map.clear(); + if(map != null) map.clear(); clearing = false; } diff --git a/core/src/mindustry/entities/abilities/StatusFieldAbility.java b/core/src/mindustry/entities/abilities/StatusFieldAbility.java index 857cfde5cf..a1bf47d408 100644 --- a/core/src/mindustry/entities/abilities/StatusFieldAbility.java +++ b/core/src/mindustry/entities/abilities/StatusFieldAbility.java @@ -28,7 +28,6 @@ public class StatusFieldAbility extends Ability{ timer += Time.delta; if(timer >= reload){ - Units.nearby(unit.team, unit.x, unit.y, range, other -> { other.apply(effect, duration); }); diff --git a/core/src/mindustry/entities/abilities/UnitSpawnAbility.java b/core/src/mindustry/entities/abilities/UnitSpawnAbility.java index 95eb3bcf5b..8aeba22a11 100644 --- a/core/src/mindustry/entities/abilities/UnitSpawnAbility.java +++ b/core/src/mindustry/entities/abilities/UnitSpawnAbility.java @@ -34,7 +34,6 @@ public class UnitSpawnAbility extends Ability{ timer += Time.delta; if(timer >= spawnTime && Units.canCreate(unit.team, type)){ - float x = unit.x + Angles.trnsx(unit.rotation, spawnY, spawnX), y = unit.y + Angles.trnsy(unit.rotation, spawnY, spawnX); spawnEffect.at(x, y); Unit u = type.create(unit.team); diff --git a/core/src/mindustry/entities/bullet/BulletType.java b/core/src/mindustry/entities/bullet/BulletType.java index 2d78be6229..4d635ab2db 100644 --- a/core/src/mindustry/entities/bullet/BulletType.java +++ b/core/src/mindustry/entities/bullet/BulletType.java @@ -165,7 +165,7 @@ public abstract class BulletType extends Content{ if(makeFire && tile.team != b.team){ Fires.create(tile.tile); } - + if(healPercent > 0f && tile.team == b.team && !(tile.block instanceof ConstructBlock)){ Fx.healBlockFull.at(tile.x, tile.y, tile.block.size, Pal.heal); tile.heal(healPercent / 100f * tile.maxHealth()); @@ -213,9 +213,9 @@ public abstract class BulletType extends Content{ if(status != StatusEffects.none){ Damage.status(b.team, x, y, splashDamageRadius, status, statusDuration, collidesAir, collidesGround); } - + if(healPercent > 0f){ - indexer.eachBlock(b.team, x, y, splashDamageRadius, other -> other.damaged(), other -> { + indexer.eachBlock(b.team, x, y, splashDamageRadius, Building::damaged, other -> { Fx.healBlockFull.at(other.x, other.y, other.block.size, Pal.heal); other.heal(healPercent / 100f * other.maxHealth()); }); @@ -253,8 +253,8 @@ public abstract class BulletType extends Content{ public void init(Bullet b){ - if(killShooter && b.owner() instanceof Healthc){ - ((Healthc)b.owner()).kill(); + if(killShooter && b.owner() instanceof Healthc h){ + h.kill(); } if(instantDisappear){ diff --git a/core/src/mindustry/entities/bullet/SapBulletType.java b/core/src/mindustry/entities/bullet/SapBulletType.java index 5eb1d1e294..bbe48017fd 100644 --- a/core/src/mindustry/entities/bullet/SapBulletType.java +++ b/core/src/mindustry/entities/bullet/SapBulletType.java @@ -62,17 +62,15 @@ public class SapBulletType extends BulletType{ if(target != null){ float result = Math.min(target.health(), damage); - if(b.owner instanceof Healthc){ - ((Healthc)b.owner).heal(result * sapStrength); + if(b.owner instanceof Healthc h){ + h.heal(result * sapStrength); } } if(target instanceof Hitboxc hit){ - hit.collision(b, hit.x(), hit.y()); b.collision(hit, hit.x(), hit.y()); }else if(target instanceof Building tile){ - if(tile.collide(b)){ tile.collision(b); hit(b, tile.x, tile.y); diff --git a/core/src/mindustry/entities/comp/BuilderComp.java b/core/src/mindustry/entities/comp/BuilderComp.java index 0ef4d8bed0..4d9f81fa65 100644 --- a/core/src/mindustry/entities/comp/BuilderComp.java +++ b/core/src/mindustry/entities/comp/BuilderComp.java @@ -27,7 +27,7 @@ abstract class BuilderComp implements Unitc{ @Import float x, y, rotation; - @SyncLocal Queue plans = new Queue<>(); + @SyncLocal Queue plans = new Queue<>(1); @SyncLocal transient boolean updateBuilding = true; @Override @@ -35,7 +35,6 @@ abstract class BuilderComp implements Unitc{ if(!updateBuilding) return; float finalPlaceDst = state.rules.infiniteResources ? Float.MAX_VALUE : buildingRange; - boolean infinite = state.rules.infiniteResources || team().rules().infiniteResources; Iterator it = plans.iterator(); @@ -69,10 +68,6 @@ abstract class BuilderComp implements Unitc{ Tile tile = world.tile(current.x, current.y); - if(within(tile, finalPlaceDst)){ - lookAt(angleTo(tile)); - } - if(!(tile.block() instanceof ConstructBlock)){ if(!current.initialized && !current.breaking && Build.validPlace(current.block, team(), current.x, current.y, current.rotation)){ boolean hasAll = infinite || !Structs.contains(current.block.requirements, i -> core != null && !core.items.has(i.item)); @@ -188,6 +183,10 @@ abstract class BuilderComp implements Unitc{ } boolean activelyBuilding(){ + //not actively building when not near the build plan + if(isBuilding() && !within(buildPlan(), state.rules.infiniteResources ? Float.MAX_VALUE : buildingRange)){ + return false; + } return isBuilding() && updateBuilding; } diff --git a/core/src/mindustry/entities/comp/MinerComp.java b/core/src/mindustry/entities/comp/MinerComp.java index bdeead4fe9..37a0fd2393 100644 --- a/core/src/mindustry/entities/comp/MinerComp.java +++ b/core/src/mindustry/entities/comp/MinerComp.java @@ -16,8 +16,8 @@ import mindustry.world.*; import static mindustry.Vars.*; @Component -abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{ - @Import float x, y, rotation; +abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{ + @Import float x, y, rotation, hitSize; @Import UnitType type; transient float mineTimer; @@ -28,7 +28,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{ } public boolean offloadImmediately(){ - return isPlayer(); + return this.self().isPlayer(); } boolean mining(){ @@ -63,7 +63,6 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{ mineTimer = 0f; }else if(mining()){ Item item = mineTile.drop(); - lookAt(angleTo(mineTile.worldx(), mineTile.worldy())); mineTimer += Time.delta *type.mineSpeed; if(Mathf.chance(0.06 * Time.delta)){ @@ -88,13 +87,17 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc, Unitc{ mineTimer = 0f; } } + + if(!headless){ + loops.play(type.mineSound, this, type.mineSoundVolume); + } } } @Override public void draw(){ if(!mining()) return; - float focusLen = hitSize() / 2f + Mathf.absin(Time.time(), 1.1f, 0.5f); + float focusLen = hitSize / 2f + Mathf.absin(Time.time(), 1.1f, 0.5f); float swingScl = 12f, swingMag = tilesize / 8f; float flashScl = 0.3f; diff --git a/core/src/mindustry/entities/comp/UnitComp.java b/core/src/mindustry/entities/comp/UnitComp.java index 814f2b72bf..4c199542c3 100644 --- a/core/src/mindustry/entities/comp/UnitComp.java +++ b/core/src/mindustry/entities/comp/UnitComp.java @@ -31,7 +31,7 @@ import mindustry.world.blocks.payloads.*; import static mindustry.Vars.*; @Component(base = true) -abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, Itemsc, Rotc, Unitc, Weaponsc, Drawc, Boundedc, Syncc, Shieldc, Commanderc, Displayable, Senseable, Ranged{ +abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, Itemsc, Rotc, Unitc, Weaponsc, Drawc, Boundedc, Syncc, Shieldc, Commanderc, Displayable, Senseable, Ranged, Minerc{ @Import boolean hovering, dead; @Import float x, y, rotation, elevation, maxHealth, drag, armor, hitSize, health, ammo, minFormationSpeed; @@ -84,6 +84,18 @@ abstract class UnitComp implements Healthc, Physicsc, Hitboxc, Statusc, Teamc, I controlling().each(cons); } + /** @return where the unit wants to look at. */ + public float prefRotation(){ + if(this instanceof Builderc builder && builder.activelyBuilding()){ + return angleTo(builder.buildPlan()); + }else if(mineTile() != null){ + return angleTo(mineTile()); + }else if(moving()){ + return vel().angle(); + } + return rotation; + } + @Override public float range(){ return type.range; diff --git a/core/src/mindustry/entities/units/AIController.java b/core/src/mindustry/entities/units/AIController.java index a861c81060..78ee1c1d3c 100644 --- a/core/src/mindustry/entities/units/AIController.java +++ b/core/src/mindustry/entities/units/AIController.java @@ -61,13 +61,10 @@ public class AIController implements UnitController{ } protected void updateVisuals(){ - if(unit.isFlying()){ unit.wobble(); - if(unit.moving()){ - unit.lookAt(unit.vel.angle()); - } + unit.lookAt(unit.prefRotation()); } } diff --git a/core/src/mindustry/entities/units/BuildPlan.java b/core/src/mindustry/entities/units/BuildPlan.java index 9d8e98a05f..16ec45cb07 100644 --- a/core/src/mindustry/entities/units/BuildPlan.java +++ b/core/src/mindustry/entities/units/BuildPlan.java @@ -9,7 +9,7 @@ import mindustry.world.*; import static mindustry.Vars.*; /** Class for storing build requests. Can be either a place or remove request. */ -public class BuildPlan{ +public class BuildPlan implements Position{ /** Position and rotation of this request. */ public int x, y, rotation; /** Block being placed. If null, this is a breaking request.*/ @@ -127,11 +127,11 @@ public class BuildPlan{ } public float drawx(){ - return x*tilesize + block.offset; + return x*tilesize + (block == null ? 0 : block.offset); } public float drawy(){ - return y*tilesize + block.offset; + return y*tilesize + (block == null ? 0 : block.offset); } public @Nullable Tile tile(){ @@ -142,6 +142,16 @@ public class BuildPlan{ return world.build(x, y); } + @Override + public float getX(){ + return drawx(); + } + + @Override + public float getY(){ + return drawy(); + } + @Override public String toString(){ return "BuildRequest{" + diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index fcebb28a8f..fb738b49b6 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -77,7 +77,6 @@ public class Saves{ } public void update(){ - if(current != null && state.isGame() && !(state.isPaused() && Core.scene.hasDialog())){ if(lastTimestamp != 0){ @@ -93,8 +92,8 @@ public class Saves{ try{ current.save(); - }catch(Throwable e){ - e.printStackTrace(); + }catch(Throwable t){ + Log.err(t); } Time.runTask(3f, () -> saving = false); @@ -218,7 +217,7 @@ public class Saves{ previewFile().writePNG(renderer.minimap.getPixmap()); requestedPreview = false; }catch(Throwable t){ - t.printStackTrace(); + Log.err(t); } }); } diff --git a/core/src/mindustry/game/Teams.java b/core/src/mindustry/game/Teams.java index f8968b95e7..da5edfd0db 100644 --- a/core/src/mindustry/game/Teams.java +++ b/core/src/mindustry/game/Teams.java @@ -133,10 +133,10 @@ public class Teams{ private void count(Unit unit){ unit.team.data().updateCount(unit.type, 1); - if(unit instanceof Payloadc){ - ((Payloadc)unit).payloads().each(p -> { - if(p instanceof UnitPayload){ - count(((UnitPayload)p).unit); + if(unit instanceof Payloadc payloadc){ + payloadc.payloads().each(p -> { + if(p instanceof UnitPayload payload){ + count(payload.unit); } }); } diff --git a/core/src/mindustry/graphics/LoadRenderer.java b/core/src/mindustry/graphics/LoadRenderer.java index 906460dabe..ca66e601bf 100644 --- a/core/src/mindustry/graphics/LoadRenderer.java +++ b/core/src/mindustry/graphics/LoadRenderer.java @@ -463,7 +463,7 @@ public class LoadRenderer implements Disposable{ Font font = assets.get("tech"); font.setColor(Pal.accent); Draw.color(Color.black); - font.draw(red + "[[[[ " + key + " ]]\n"+orange+"<" + Version.modifier + " " + (Version.build == 0 ? " [init]" : Version.build == -1 ? " custom" : " " + Version.build) + ">", w/2f, h/2f + 110*s, Align.center); + font.draw(red + "[[[[ " + key + " ]]\n" + orange + "<" + Version.modifier + " " + (Version.build == 0 ? "[init]" : Version.buildString()) + ">", w/2f, h/2f + 110*s, Align.center); } Draw.flush(); diff --git a/core/src/mindustry/graphics/g3d/PlanetGrid.java b/core/src/mindustry/graphics/g3d/PlanetGrid.java index 380f937658..9b72970087 100644 --- a/core/src/mindustry/graphics/g3d/PlanetGrid.java +++ b/core/src/mindustry/graphics/g3d/PlanetGrid.java @@ -188,23 +188,23 @@ public class PlanetGrid{ } static int pos(Ptile t, Ptile n){ - for(int i = 0; i < t.edgeCount; i++) - if(t.tiles[i] == n) - return i; + for(int i = 0; i < t.edgeCount; i++){ + if(t.tiles[i] == n) return i; + } return -1; } static int pos(Ptile t, Corner c){ - for(int i = 0; i < t.edgeCount; i++) - if(t.corners[i] == c) - return i; + for(int i = 0; i < t.edgeCount; i++){ + if(t.corners[i] == c) return i; + } return -1; } static int pos(Corner c, Corner n){ - for(int i = 0; i < 3; i++) - if(c.corners[i] == n) - return i; + for(int i = 0; i < 3; i++){ + if(c.corners[i] == n) return i; + } return -1; } diff --git a/core/src/mindustry/graphics/g3d/PlanetRenderer.java b/core/src/mindustry/graphics/g3d/PlanetRenderer.java index 405d668333..156146f0b2 100644 --- a/core/src/mindustry/graphics/g3d/PlanetRenderer.java +++ b/core/src/mindustry/graphics/g3d/PlanetRenderer.java @@ -18,10 +18,10 @@ import mindustry.type.*; public class PlanetRenderer implements Disposable{ public static final float outlineRad = 1.17f, camLength = 4f; public static final Color - outlineColor = Pal.accent.cpy().a(1f), - hoverColor = Pal.accent.cpy().a(0.5f), - borderColor = Pal.accent.cpy().a(0.3f), - shadowColor = new Color(0, 0, 0, 0.7f); + outlineColor = Pal.accent.cpy().a(1f), + hoverColor = Pal.accent.cpy().a(0.5f), + borderColor = Pal.accent.cpy().a(0.3f), + shadowColor = new Color(0, 0, 0, 0.7f); private static final Seq points = new Seq<>(); @@ -119,7 +119,7 @@ public class PlanetRenderer implements Disposable{ public void renderPlanet(Planet planet){ if(!planet.visible()) return; - + //render planet at offsetted position in the world planet.draw(cam.combined, planet.getTransform(mat)); diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index 45dbfb6bea..d90efcee44 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -47,7 +47,6 @@ public class DesktopInput extends InputHandler{ @Override public void buildUI(Group group){ - group.fill(t -> { t.visible(() -> Core.settings.getBool("hints") && ui.hudfrag.shown && !player.dead() && !player.unit().spawnedByCore() && !(Core.settings.getBool("hints") && lastSchematic != null && !selectRequests.isEmpty())); t.bottom(); @@ -482,8 +481,8 @@ public class DesktopInput extends InputHandler{ deleting = true; }else if(selected != null){ //only begin shooting if there's no cursor event - if(!tileTapped(selected.build) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && (player.builder().plans().size == 0 || !player.builder().updateBuilding()) && !droppingItem && - !tryBeginMine(selected) && player.miner().mineTile() == null && !Core.scene.hasKeyboard()){ + if(!tileTapped(selected.build) && !tryTapPlayer(Core.input.mouseWorld().x, Core.input.mouseWorld().y) && !player.builder().activelyBuilding() && !droppingItem && + !tryBeginMine(selected) && player.miner().mineTile() == null && !Core.scene.hasKeyboard()){ player.shooting = shouldShoot; } }else if(!Core.scene.hasKeyboard()){ //if it's out of bounds, shooting is just fine @@ -621,9 +620,7 @@ public class DesktopInput extends InputHandler{ if(aimCursor){ unit.lookAt(mouseAngle); }else{ - if(!movement.isZero()){ - unit.lookAt(unit.vel.isZero() ? movement.angle() : unit.vel.angle()); - } + unit.lookAt(unit.prefRotation()); } if(omni){ @@ -644,7 +641,6 @@ public class DesktopInput extends InputHandler{ //update payload input if(unit instanceof Payloadc){ - if(Core.input.keyTap(Binding.pickupCargo)){ tryPickupPayload(); } diff --git a/core/src/mindustry/input/InputHandler.java b/core/src/mindustry/input/InputHandler.java index f52f6bed59..cec0f53348 100644 --- a/core/src/mindustry/input/InputHandler.java +++ b/core/src/mindustry/input/InputHandler.java @@ -128,7 +128,9 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ !netServer.admins.allowAction(player, ActionType.withdrawItem, tile.tile(), action -> { action.item = item; action.itemAmount = amount; - }))) throw new ValidateException(player, "Player cannot request items."); + }))){ + throw new ValidateException(player, "Player cannot request items."); + } //remove item for every controlling unit player.unit().eachGroup(unit -> { @@ -931,11 +933,11 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ boolean canMine(Tile tile){ return !Core.scene.hasMouse() - && tile.drop() != null - && player.miner().validMine(tile) - && !(tile.floor().playerUnmineable && tile.overlay().itemDrop == null) - && player.unit().acceptsItem(tile.drop()) - && tile.block() == Blocks.air; + && tile.drop() != null + && player.miner().validMine(tile) + && !(tile.floor().playerUnmineable && tile.overlay().itemDrop == null) + && player.unit().acceptsItem(tile.drop()) + && tile.block() == Blocks.air; } /** Returns the tile at the specified MOUSE coordinates. */ @@ -984,7 +986,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } public @Nullable Unit selectedUnit(){ - Unit unit = Units.closest(player.team(), Core.input.mouseWorld().x, Core.input.mouseWorld().y, 40f, u -> u.isAI()); + Unit unit = Units.closest(player.team(), Core.input.mouseWorld().x, Core.input.mouseWorld().y, 40f, Unitc::isAI); if(unit != null){ unit.hitbox(Tmp.r1); Tmp.r1.grow(6f); @@ -1042,7 +1044,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ } public boolean canShoot(){ - return block == null && !onConfigurable() && !isDroppingItem() && !(player.builder().updateBuilding() && player.builder().isBuilding()) && + return block == null && !onConfigurable() && !isDroppingItem() && !player.builder().activelyBuilding() && !(player.unit() instanceof Mechc && player.unit().isFlying()); } @@ -1160,7 +1162,7 @@ public abstract class InputHandler implements InputProcessor, GestureListener{ if(block instanceof PowerNode){ Seq skip = new Seq<>(); - + for(int i = 1; i < points.size; i++){ int overlaps = 0; Point2 point = points.get(i); diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 3e1aadd2f7..11e7aa12f4 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -327,7 +327,6 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public void drawTop(){ - //draw schematic selection if(mode == schematicSelect){ drawSelection(lineStartX, lineStartY, lastLineX, lastLineY, Vars.maxSchematicSize); @@ -866,9 +865,7 @@ public class MobileInput extends InputHandler implements GestureListener{ if(aimCursor){ unit.lookAt(mouseAngle); }else{ - if(unit.moving()){ - unit.lookAt(unit.vel.angle()); - } + unit.lookAt(unit.prefRotation()); } if(payloadTarget != null && unit instanceof Payloadc pay){ diff --git a/core/src/mindustry/input/Placement.java b/core/src/mindustry/input/Placement.java index d2c3eb7d41..1d713f7f75 100644 --- a/core/src/mindustry/input/Placement.java +++ b/core/src/mindustry/input/Placement.java @@ -188,7 +188,6 @@ public class Placement{ * @param maxLength maximum length of area */ public static NormalizeResult normalizeArea(int tilex, int tiley, int endx, int endy, int rotation, boolean snap, int maxLength){ - if(snap){ if(Math.abs(tilex - endx) > Math.abs(tiley - endy)){ endy = tiley; diff --git a/core/src/mindustry/io/legacy/LegacyIO.java b/core/src/mindustry/io/legacy/LegacyIO.java index 15cb756081..9ca0533855 100644 --- a/core/src/mindustry/io/legacy/LegacyIO.java +++ b/core/src/mindustry/io/legacy/LegacyIO.java @@ -2,6 +2,7 @@ package mindustry.io.legacy; import arc.*; import arc.struct.*; +import arc.util.*; import mindustry.*; import mindustry.ctype.*; import mindustry.ui.dialogs.JoinDialog.*; @@ -77,8 +78,7 @@ public class LegacyIO{ } } }catch(Exception e){ - e.printStackTrace(); + Log.err(e); } } - } diff --git a/core/src/mindustry/io/legacy/LegacySaveVersion.java b/core/src/mindustry/io/legacy/LegacySaveVersion.java index f533ebd27d..bb7d7eff11 100644 --- a/core/src/mindustry/io/legacy/LegacySaveVersion.java +++ b/core/src/mindustry/io/legacy/LegacySaveVersion.java @@ -26,7 +26,6 @@ public abstract class LegacySaveVersion extends SaveVersion{ if(!generating) context.begin(); try{ - context.resize(width, height); //read floor and create tiles first diff --git a/core/src/mindustry/logic/LCanvas.java b/core/src/mindustry/logic/LCanvas.java index 056c6f2ca5..6821ac0993 100644 --- a/core/src/mindustry/logic/LCanvas.java +++ b/core/src/mindustry/logic/LCanvas.java @@ -283,7 +283,7 @@ public class LCanvas extends Table{ t.add().growX(); t.button(Icon.copy, Styles.logici, () -> { - }).padRight(6).get().tapped(() -> copy()); + }).padRight(6).get().tapped(this::copy); t.button(Icon.cancel, Styles.logici, () -> { remove(); diff --git a/core/src/mindustry/logic/LCategory.java b/core/src/mindustry/logic/LCategory.java index dcdd0483fe..01d127cb6e 100644 --- a/core/src/mindustry/logic/LCategory.java +++ b/core/src/mindustry/logic/LCategory.java @@ -1,14 +1,13 @@ package mindustry.logic; import arc.graphics.*; -import mindustry.graphics.*; public enum LCategory{ - blocks(Pal.accentBack), - control(Color.cyan.cpy().shiftSaturation(-0.6f).mul(0.7f)), - operations(Pal.place.cpy().shiftSaturation(-0.5f).mul(0.7f)), - io(Pal.remove.cpy().shiftSaturation(-0.5f).mul(0.7f)), - units(Pal.bulletYellowBack.cpy().shiftSaturation(-0.3f).mul(0.8f)); + blocks(Color.valueOf("d4816b")), + control(Color.valueOf("6bb2b2")), + operations(Color.valueOf("877bad")), + io(Color.valueOf("a08a8a")), + units(Color.valueOf("c7b59d")); public final Color color; diff --git a/core/src/mindustry/logic/LExecutor.java b/core/src/mindustry/logic/LExecutor.java index 327eb9b609..c883cbd5ba 100644 --- a/core/src/mindustry/logic/LExecutor.java +++ b/core/src/mindustry/logic/LExecutor.java @@ -32,15 +32,15 @@ public class LExecutor{ //special variables public static final int - varCounter = 0, - varTime = 1, - varUnit = 2, - varThis = 3; + varCounter = 0, + varTime = 1, + varUnit = 2, + varThis = 3; public static final int - maxGraphicsBuffer = 256, - maxDisplayBuffer = 1024, - maxTextBuffer = 256; + maxGraphicsBuffer = 256, + maxDisplayBuffer = 1024, + maxTextBuffer = 256; public LInstruction[] instructions = {}; public Var[] vars = {}; @@ -61,8 +61,9 @@ public class LExecutor{ vars[varTime].numval = Time.millis(); //reset to start - if(vars[varCounter].numval >= instructions.length - || vars[varCounter].numval < 0) vars[varCounter].numval = 0; + if(vars[varCounter].numval >= instructions.length || vars[varCounter].numval < 0){ + vars[varCounter].numval = 0; + } if(vars[varCounter].numval < instructions.length){ instructions[(int)(vars[varCounter].numval++)].run(this); @@ -84,9 +85,9 @@ public class LExecutor{ dest.constant = var.constant; - if(var.value instanceof Number){ + if(var.value instanceof Number number){ dest.isobj = false; - dest.numval = ((Number)var.value).doubleValue(); + dest.numval = number.doubleValue(); }else{ dest.isobj = true; dest.objval = var.value; @@ -98,7 +99,7 @@ public class LExecutor{ public @Nullable Building building(int index){ Object o = vars[index].objval; - return vars[index].isobj && o instanceof Building ? (Building)o : null; + return vars[index].isobj && o instanceof Building building ? building : null; } public @Nullable Object obj(int index){ diff --git a/core/src/mindustry/mod/ModLoadingSound.java b/core/src/mindustry/mod/ModLoadingSound.java index 543b75c154..a876c25f68 100644 --- a/core/src/mindustry/mod/ModLoadingSound.java +++ b/core/src/mindustry/mod/ModLoadingSound.java @@ -123,8 +123,8 @@ public class ModLoadingSound implements Sound{ } @Override - public void setPan(int soundId, float pan, float volume){ - sound.setPan(soundId, pan, volume); + public void set(int soundId, float pan, float volume){ + sound.set(soundId, pan, volume); } @Override diff --git a/core/src/mindustry/mod/Mods.java b/core/src/mindustry/mod/Mods.java index a596f3e7ae..9720fed59e 100644 --- a/core/src/mindustry/mod/Mods.java +++ b/core/src/mindustry/mod/Mods.java @@ -134,7 +134,7 @@ public class Mods implements Loadable{ }catch(IOException e){ Core.app.post(() -> { Log.err("Error packing images for mod: @", mod.meta.name); - e.printStackTrace(); + Log.err(e); if(!headless) ui.showException(e); }); break; diff --git a/core/src/mindustry/net/Administration.java b/core/src/mindustry/net/Administration.java index dce9953e98..177807090d 100644 --- a/core/src/mindustry/net/Administration.java +++ b/core/src/mindustry/net/Administration.java @@ -254,8 +254,7 @@ public class Administration{ public boolean unbanPlayerID(String id){ PlayerInfo info = getCreateInfo(id); - if(!info.banned) - return false; + if(!info.banned) return false; info.banned = false; bannedIPs.removeAll(info.ips, false); diff --git a/core/src/mindustry/net/Net.java b/core/src/mindustry/net/Net.java index 4d7a2f4ca3..dc7431d0d4 100644 --- a/core/src/mindustry/net/Net.java +++ b/core/src/mindustry/net/Net.java @@ -254,8 +254,9 @@ public class Net{ }else if(clientListeners.get(object.getClass()) != null){ if(clientLoaded || ((object instanceof Packet) && ((Packet)object).isImportant())){ - if(clientListeners.get(object.getClass()) != null) + if(clientListeners.get(object.getClass()) != null){ clientListeners.get(object.getClass()).get(object); + } Pools.free(object); }else if(!((object instanceof Packet) && ((Packet)object).isUnimportant())){ packetQueue.add(object); @@ -273,8 +274,9 @@ public class Net{ public void handleServerReceived(NetConnection connection, Object object){ if(serverListeners.get(object.getClass()) != null){ - if(serverListeners.get(object.getClass()) != null) + if(serverListeners.get(object.getClass()) != null){ serverListeners.get(object.getClass()).get(connection, object); + } Pools.free(object); }else{ Log.err("Unhandled packet type: '@'!", object.getClass()); diff --git a/core/src/mindustry/net/ServerGroup.java b/core/src/mindustry/net/ServerGroup.java new file mode 100644 index 0000000000..15bd8fa4d3 --- /dev/null +++ b/core/src/mindustry/net/ServerGroup.java @@ -0,0 +1,28 @@ +package mindustry.net; + +import arc.*; + +public class ServerGroup{ + public String name; + public String[] addresses; + + public ServerGroup(String name, String[] addresses){ + this.name = name; + this.addresses = addresses; + } + + public ServerGroup(){ + } + + public boolean hidden(){ + return Core.settings.getBool(key() + "-hidden", false); + } + + public void setHidden(boolean hidden){ + Core.settings.put(key() + "-hidden", hidden); + } + + String key(){ + return "server-" + (name.isEmpty() ? addresses.length == 0 ? "" : addresses[0] : name); + } +} diff --git a/core/src/mindustry/type/ItemSeq.java b/core/src/mindustry/type/ItemSeq.java index 512033af23..64603d8a8d 100644 --- a/core/src/mindustry/type/ItemSeq.java +++ b/core/src/mindustry/type/ItemSeq.java @@ -55,6 +55,12 @@ public class ItemSeq implements Iterable, Serializable{ return out; } + public void min(int number){ + for(Item item : Vars.content.items()){ + set(item, Math.min(get(item), number)); + } + } + public boolean has(Item item){ return values[item.id] > 0; } diff --git a/core/src/mindustry/type/UnitType.java b/core/src/mindustry/type/UnitType.java index 95c6e8912d..5725d4b890 100644 --- a/core/src/mindustry/type/UnitType.java +++ b/core/src/mindustry/type/UnitType.java @@ -81,6 +81,8 @@ public class UnitType extends UnlockableContent{ public AmmoType ammoType = AmmoTypes.copper; public int mineTier = -1; public float buildSpeed = 1f, mineSpeed = 1f; + public Sound mineSound = Sounds.minebeam; + public float mineSoundVolume = 0.6f; /** This is a VERY ROUGH estimate of unit DPS. */ public float dpsEstimate = -1; diff --git a/core/src/mindustry/ui/Styles.java b/core/src/mindustry/ui/Styles.java index 802a18004b..385d2aa81a 100644 --- a/core/src/mindustry/ui/Styles.java +++ b/core/src/mindustry/ui/Styles.java @@ -27,7 +27,7 @@ public class Styles{ public static Drawable black, black9, black8, black6, black3, black5, none, flatDown, flatOver; public static ButtonStyle defaultb, waveb; public static TextButtonStyle defaultt, squaret, nodet, cleart, discordt, infot, clearPartialt, clearTogglet, clearToggleMenut, togglet, transt, fullTogglet, logict; - public static ImageButtonStyle defaulti, nodei, righti, emptyi, emptytogglei, selecti, logici, geni, colori, cleari, clearFulli, clearPartiali, clearPartial2i, clearTogglei, clearTransi, clearToggleTransi, clearTogglePartiali; + public static ImageButtonStyle defaulti, nodei, righti, emptyi, emptytogglei, selecti, logici, geni, colori, accenti, cleari, clearFulli, clearPartiali, clearPartial2i, clearTogglei, clearTransi, clearToggleTransi, clearTogglePartiali; public static ScrollPaneStyle defaultPane, horizontalPane, smallPane; public static KeybindDialogStyle defaultKeybindDialog; public static SliderStyle defaultSlider, vSlider; @@ -213,6 +213,11 @@ public class Styles{ //imageDownColor = Pal.accent; imageUpColor = Color.white; }}; + accenti = new ImageButtonStyle(){{ + //imageDownColor = Pal.accent; + imageUpColor = Color.lightGray; + imageDownColor = Color.white; + }}; cleari = new ImageButtonStyle(){{ down = flatOver; up = black; diff --git a/core/src/mindustry/ui/dialogs/JoinDialog.java b/core/src/mindustry/ui/dialogs/JoinDialog.java index 0b046ff3c0..a09e7941cb 100644 --- a/core/src/mindustry/ui/dialogs/JoinDialog.java +++ b/core/src/mindustry/ui/dialogs/JoinDialog.java @@ -31,6 +31,7 @@ public class JoinDialog extends BaseDialog{ Table hosts = new Table(); int totalHosts; int refreshes; + boolean showHidden; public JoinDialog(){ super("@joingame"); @@ -252,9 +253,9 @@ public class JoinDialog extends BaseDialog{ hosts.clear(); - section("@servers.local", local); - section("@servers.remote", remote); - section("@servers.global", global); + section("@servers.local", local, false); + section("@servers.remote", remote, false); + section("@servers.global", global, true); ScrollPane pane = new ScrollPane(hosts); pane.setFadeScrollBars(false); @@ -302,12 +303,21 @@ public class JoinDialog extends BaseDialog{ }); } - void section(String label, Table servers){ + void section(String label, Table servers, boolean eye){ Collapser coll = new Collapser(servers, Core.settings.getBool("collapsed-" + label, false)); coll.setDuration(0.1f); hosts.table(name -> { name.add(label).pad(10).growX().left().color(Pal.accent); + + if(eye){ + name.button(Icon.eyeSmall, Styles.emptyi, () -> { + showHidden = !showHidden; + refreshGlobal(); + }).update(i -> i.getStyle().imageUp = (showHidden ? Icon.eyeSmall : Icon.eyeOffSmall)) + .size(40f).right().padRight(3).tooltip("@servers.showhidden"); + } + name.button(Icon.downOpen, Styles.emptyi, () -> { coll.toggle(false); Core.settings.put("collapsed-" + label, coll.isCollapsed()); @@ -334,17 +344,62 @@ public class JoinDialog extends BaseDialog{ global.clear(); global.background(null); - for(String host : defaultServers){ - String resaddress = host.contains(":") ? host.split(":")[0] : host; - int resport = host.contains(":") ? Strings.parseInt(host.split(":")[1]) : port; - net.pingHost(resaddress, resport, res -> { - if(refreshes != cur) return; - res.port = resport; - addGlobalHost(res); - }, e -> {}); + for(ServerGroup group : defaultServers){ + boolean hidden = group.hidden(); + if(hidden && !showHidden){ + continue; + } + + //table containing all groups + global.table(g -> { + for(String address : group.addresses){ + String resaddress = address.contains(":") ? address.split(":")[0] : address; + int resport = address.contains(":") ? Strings.parseInt(address.split(":")[1]) : port; + net.pingHost(resaddress, resport, res -> { + if(refreshes != cur) return; + res.port = resport; + + //add header + if(g.getChildren().isEmpty()){ + g.table(head -> { + if(!group.name.isEmpty()){ + head.add(group.name).color(Color.lightGray).padRight(4); + } + head.image().height(3f).growX().color(Color.lightGray); + + //button for showing/hiding servers + ImageButton[] image = {null}; + image[0] = head.button(hidden ? Icon.eyeOffSmall : Icon.eyeSmall, Styles.accenti, () -> { + group.setHidden(!group.hidden()); + image[0].getStyle().imageUp = group.hidden() ? Icon.eyeOffSmall : Icon.eyeSmall; + if(group.hidden() && !showHidden){ + g.remove(); + } + }).size(40f).get(); + image[0].addListener(new Tooltip(t -> t.background(Styles.black6).margin(4).label(() -> !group.hidden() ? "@server.shown" : "@server.hidden"))); + }).width(targetWidth()).padBottom(-2).row(); + } + + addGlobalHost(res, g); + + g.margin(5f); + g.pack(); + }, e -> {}); + } + }).row(); } } + void addGlobalHost(Host host, Table container){ + global.background(null); + float w = targetWidth(); + + container.button(b -> buildServer(host, b), Styles.cleart, () -> { + Events.fire(new ClientPreConnectEvent(host)); + safeConnect(host.address, host.port, host.version); + }).width(w).row(); + } + void finishLocalHosts(){ if(totalHosts == 0){ local.clear(); @@ -367,26 +422,10 @@ public class JoinDialog extends BaseDialog{ local.row(); - TextButton button = local.button("", Styles.cleart, () -> { + local.button(b -> buildServer(host, b), Styles.cleart, () -> { Events.fire(new ClientPreConnectEvent(host)); safeConnect(host.address, host.port, host.version); - }).width(w).pad(5f).get(); - button.clearChildren(); - buildServer(host, button); - } - - void addGlobalHost(Host host){ - global.background(null); - float w = targetWidth(); - - global.row(); - - TextButton button = global.button("", Styles.cleart, () -> { - Events.fire(new ClientPreConnectEvent(host)); - safeConnect(host.address, host.port, host.version); - }).width(w).pad(5f).get(); - button.clearChildren(); - buildServer(host, button); + }).width(w); } public void connect(String ip, int port){ @@ -439,18 +478,28 @@ public class JoinDialog extends BaseDialog{ //get servers Core.net.httpGet(becontrol.active() ? serverJsonBeURL : serverJsonV6URL, result -> { try{ + Jval val = Jval.read(result.getResultAsString()); Core.app.post(() -> { try{ defaultServers.clear(); - val.asArray().each(child -> defaultServers.add(child.getString("address", ""))); + val.asArray().each(child -> { + String name = child.getString("name", ""); + String[] addresses; + if(child.has("addresses") || (child.has("address") && child.get("address").isArray())){ + addresses = (child.has("addresses") ? child.get("addresses") : child.get("address")).asArray().map(Jval::asString).toArray(String.class); + }else{ + addresses = new String[]{child.getString("address", "")}; + } + defaultServers.add(new ServerGroup(name, addresses)); + }); Log.info("Fetched @ global servers.", defaultServers.size); }catch(Throwable ignored){ Log.err("Failed to parse community servers."); } }); }catch(Throwable e){ - Log.err("Failed to fetch community servers."); + Log.err("Failed to fetch communitycommunity servers."); } }, t -> {}); } diff --git a/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java b/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java index 9f03ba3532..3ddd74e588 100644 --- a/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java +++ b/core/src/mindustry/ui/dialogs/LaunchLoadoutDialog.java @@ -42,6 +42,13 @@ public class LaunchLoadoutDialog extends BaseDialog{ //updates sum requirements Runnable update = () -> { + int cap = selected.findCore().itemCapacity; + + //cap resources based on core type + ItemSeq resources = universe.getLaunchResources(); + resources.min(cap); + universe.updateLaunchResources(resources); + total.clear(); selected.requirements().each(total::add); universe.getLaunchResources().each(total::add); @@ -79,7 +86,7 @@ public class LaunchLoadoutDialog extends BaseDialog{ ItemSeq stacks = universe.getLaunchResources(); Seq out = stacks.toSeq(); - loadout.show(core.itemCapacity, out, UnlockableContent::unlocked, out::clear, () -> {}, () -> { + loadout.show(selected.findCore().itemCapacity, out, UnlockableContent::unlocked, out::clear, () -> {}, () -> { universe.updateLaunchResources(new ItemSeq(out)); update.run(); rebuildItems.run(); diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index 33bd49b0d7..78a9a18853 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -429,7 +429,7 @@ public class SettingsMenuDialog extends SettingsDialog{ } }); - graphics.checkPref("linear", true, b -> { + graphics.checkPref("linear", !mobile, b -> { for(Texture tex : Core.atlas.getTextures()){ TextureFilter filter = b ? TextureFilter.linear : TextureFilter.nearest; tex.setFilter(filter, filter); diff --git a/core/src/mindustry/ui/fragments/MenuFragment.java b/core/src/mindustry/ui/fragments/MenuFragment.java index 86369a214b..c719fce7b5 100644 --- a/core/src/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/mindustry/ui/fragments/MenuFragment.java @@ -108,7 +108,6 @@ public class MenuFragment extends Fragment{ editor = new MobileButton(Icon.terrain, "@editor", () -> checkPlay(ui.maps::show)), tools = new MobileButton(Icon.settings, "@settings", ui.settings::show), mods = new MobileButton(Icon.book, "@mods", ui.mods::show), - donate = new MobileButton(Icon.link, "@website", () -> Core.app.openURI("https://anuke.itch.io/mindustry")), exit = new MobileButton(Icon.exit, "@quit", () -> Core.app.exit()); if(!Core.graphics.isPortrait()){ @@ -195,6 +194,7 @@ public class MenuFragment extends Fragment{ } private void checkPlay(Runnable run){ + if(!mods.hasContentErrors()){ run.run(); }else{ diff --git a/core/src/mindustry/world/blocks/distribution/Conveyor.java b/core/src/mindustry/world/blocks/distribution/Conveyor.java index fa7d52b918..4a0f88cd84 100644 --- a/core/src/mindustry/world/blocks/distribution/Conveyor.java +++ b/core/src/mindustry/world/blocks/distribution/Conveyor.java @@ -42,7 +42,7 @@ public class Conveyor extends Block implements Autotiler{ conveyorPlacement = true; ambientSound = Sounds.conveyor; - ambientSoundVolume = 0.002f; + ambientSoundVolume = 0.0015f; unloadable = false; noUpdateDisabled = false; } diff --git a/gradle.properties b/gradle.properties index 74f8398b48..add8844ab6 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,3 +1,3 @@ org.gradle.daemon=true org.gradle.jvmargs=-Xms256m -Xmx1024m -archash=3919455d82ac008743cf6794593b3379f9758a38 +archash=c7c50c8d46cffff0526c0f86c7f160fd07a04309 diff --git a/ios/build.gradle b/ios/build.gradle index 13578d00b1..afd306a656 100644 --- a/ios/build.gradle +++ b/ios/build.gradle @@ -14,22 +14,6 @@ task copyAssets(){ from "../core/assets" into "assets/" } - - exec{ - ignoreExitValue true - commandLine "sh", "./convert_audio.sh", "assets/sounds" - } - - exec{ - ignoreExitValue true - commandLine "sh", "./convert_audio.sh", "assets/music" - } - - delete{ - delete fileTree('assets'){ - include '**/*.ogg' - } - } } } diff --git a/ios/src/mindustry/ios/IOSLauncher.java b/ios/src/mindustry/ios/IOSLauncher.java index 9f610e709a..e876eaa59d 100644 --- a/ios/src/mindustry/ios/IOSLauncher.java +++ b/ios/src/mindustry/ios/IOSLauncher.java @@ -16,6 +16,7 @@ import mindustry.net.*; import mindustry.ui.*; import org.robovm.apple.coregraphics.*; import org.robovm.apple.foundation.*; +import org.robovm.apple.glkit.*; import org.robovm.apple.uikit.*; import org.robovm.objc.block.*; @@ -173,7 +174,7 @@ public class IOSLauncher extends IOSApplication.Delegate{ UINavigationController.attemptRotationToDeviceOrientation(); } }, new IOSApplicationConfiguration(){{ - + stencilFormat = GLKViewDrawableStencilFormat._8; }}); } diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 6732fed4c3..57200d7178 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -946,7 +946,7 @@ public class ServerControl implements ApplicationListener{ } } - if(closest != null){ + if(closest != null && !closest.text.equals("yes")){ err("Command not found. Did you mean \"" + closest.text + "\"?"); suggested = line.replace(response.runCommand, closest.text); }else{ diff --git a/servers_v6.json b/servers_v6.json index bae5313b7c..44a7fc71dc 100644 --- a/servers_v6.json +++ b/servers_v6.json @@ -25,5 +25,8 @@ }, { "address": "Chaotic-Neutral.ddns.net:5555" + }, + { + "address": "cheginde.ddns.net" } ]