diff --git a/README.md b/README.md index 4b00672d58..a2966bc5e9 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,8 @@ A pixelated sandbox tower defense game made using [LibGDX](https://libgdx.badlogicgames.com/). Winner of the [GDL Metal Monstrosity Jam](https://itch.io/jam/gdl---metal-monstrosity-jam). _[TODO list](TODO.md)_ -_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_ +_[Wiki](http://mindustry.wikia.com/wiki/Mindustry_Wiki)_ +_[Discord](https://discord.gg/r8BkXNd)_ ### Building diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 4fcb71c267..7c3344b4a1 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,8 +1,8 @@ + android:versionCode="34" + android:versionName="3.1b1" > diff --git a/android/src/io/anuke/mindustry/AndroidLauncher.java b/android/src/io/anuke/mindustry/AndroidLauncher.java index 42f9a71717..0269a41319 100644 --- a/android/src/io/anuke/mindustry/AndroidLauncher.java +++ b/android/src/io/anuke/mindustry/AndroidLauncher.java @@ -9,9 +9,11 @@ import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import android.annotation.SuppressLint; import android.content.Intent; +import android.net.Uri; import android.os.Bundle; import android.util.DisplayMetrics; -import io.anuke.mindustry.io.Formatter; +import io.anuke.mindustry.io.PlatformFunction; +import io.anuke.ucore.function.Callable; import io.anuke.ucore.scene.ui.layout.Unit; public class AndroidLauncher extends AndroidApplication{ @@ -23,8 +25,9 @@ public class AndroidLauncher extends AndroidApplication{ super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); config.useImmersiveMode = true; - - Mindustry.formatter = new Formatter(){ + + Mindustry.hasDiscord = isPackageInstalled("com.discord"); + Mindustry.platforms = new PlatformFunction(){ SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm"); @Override @@ -36,9 +39,16 @@ public class AndroidLauncher extends AndroidApplication{ public String format(int number){ return NumberFormat.getIntegerInstance().format(number); } + + @Override + public void openLink(String link){ + Uri marketUri = Uri.parse(link); + Intent intent = new Intent( Intent.ACTION_VIEW, marketUri ); + startActivity(intent); + } }; - Mindustry.donationsCallable = this::showDonations; + Mindustry.donationsCallable = new Callable(){ @Override public void run(){ showDonations(); } }; if(doubleScaleTablets){ DisplayMetrics metrics = new DisplayMetrics(); @@ -63,6 +73,15 @@ public class AndroidLauncher extends AndroidApplication{ initialize(new Mindustry(), config); } + private boolean isPackageInstalled(String packagename) { + try { + getPackageManager().getPackageInfo(packagename, 0); + return true; + } catch (Exception e) { + return false; + } + } + void showDonations(){ Intent intent = new Intent(this, DonationsActivity.class); startActivity(intent); diff --git a/build.gradle b/build.gradle index 37551d179a..104fdee05d 100644 --- a/build.gradle +++ b/build.gradle @@ -79,7 +79,7 @@ project(":core") { apply plugin: "java" dependencies { - compile 'com.github.Anuken:ucore:5984abc' + compile 'com.github.anuken:ucore:d56206b7c0' compile "com.badlogicgames.gdx:gdx:$gdxVersion" compile "com.badlogicgames.gdx:gdx-ai:1.8.1" } diff --git a/core/assets-raw/sprites/ui/icon-discord.png b/core/assets-raw/sprites/ui/icon-discord.png new file mode 100644 index 0000000000..9451cfa1a2 Binary files /dev/null and b/core/assets-raw/sprites/ui/icon-discord.png differ diff --git a/core/assets/sprites/sprites.atlas b/core/assets/sprites/sprites.atlas index f8391e87c3..1a9999603e 100644 --- a/core/assets/sprites/sprites.atlas +++ b/core/assets/sprites/sprites.atlas @@ -111,7 +111,7 @@ blocks/chainturret index: -1 blocks/chainturret-icon rotate: false - xy: 569, 215 + xy: 529, 177 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -321,7 +321,7 @@ blocks/door-open index: -1 blocks/doubleturret rotate: false - xy: 529, 177 + xy: 514, 124 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -349,252 +349,252 @@ blocks/duriumwall-large-icon index: -1 blocks/flameturret rotate: false - xy: 514, 124 + xy: 188, 89 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/fluxpump rotate: false - xy: 163, 30 + xy: 406, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass1 rotate: false - xy: 163, 20 + xy: 416, 99 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass2 rotate: false - xy: 167, 10 + xy: 428, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grass3 rotate: false - xy: 406, 99 + xy: 438, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock1 rotate: false - xy: 416, 99 + xy: 448, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassblock2 rotate: false - xy: 428, 103 + xy: 458, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/grassedge rotate: false - xy: 781, 426 + xy: 795, 426 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/ice1 rotate: false - xy: 438, 103 + xy: 468, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice2 rotate: false - xy: 448, 103 + xy: 225, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ice3 rotate: false - xy: 458, 103 + xy: 235, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iceedge rotate: false - xy: 795, 426 + xy: 524, 217 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/icerock1 rotate: false - xy: 468, 103 + xy: 245, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerock2 rotate: false - xy: 225, 73 + xy: 255, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow1 rotate: false - xy: 235, 73 + xy: 265, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow1 rotate: false - xy: 235, 73 + xy: 265, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/icerockshadow2 rotate: false - xy: 245, 73 + xy: 275, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rockshadow2 rotate: false - xy: 245, 73 + xy: 275, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron1 rotate: false - xy: 325, 73 + xy: 355, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron2 rotate: false - xy: 335, 73 + xy: 365, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/iron3 rotate: false - xy: 345, 73 + xy: 375, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/irondrill rotate: false - xy: 355, 73 + xy: 385, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/ironwall rotate: false - xy: 365, 73 + xy: 395, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/junction rotate: false - xy: 375, 73 + xy: 809, 420 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/laserturret rotate: false - xy: 155, 8 + xy: 709, 279 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/lava rotate: false - xy: 385, 73 + xy: 478, 103 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/lavaedge rotate: false - xy: 524, 217 + xy: 538, 217 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/lavasmelter rotate: false - xy: 395, 73 + xy: 488, 105 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquiditemjunction rotate: false - xy: 809, 420 + xy: 592, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidjunction rotate: false - xy: 478, 103 + xy: 602, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/liquidrouter rotate: false - xy: 488, 105 + xy: 612, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/machineturret rotate: false - xy: 709, 279 + xy: 721, 281 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/megarepairturret rotate: false - xy: 721, 281 + xy: 541, 177 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mortarturret rotate: false - xy: 541, 177 + xy: 163, 26 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 blocks/mossblock rotate: false - xy: 602, 238 + xy: 632, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/mossstone rotate: false - xy: 602, 238 + xy: 632, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -615,7 +615,7 @@ blocks/nuclearreactor-center index: -1 blocks/nuclearreactor-icon rotate: false - xy: 622, 238 + xy: 591, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -636,28 +636,28 @@ blocks/nuclearreactor-small index: -1 blocks/oil rotate: false - xy: 632, 238 + xy: 601, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/oiledge rotate: false - xy: 519, 203 + xy: 519, 189 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/oilrefinery rotate: false - xy: 642, 238 + xy: 611, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/omnidrill rotate: false - xy: 591, 228 + xy: 621, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -671,70 +671,70 @@ blocks/plasmaturret index: -1 blocks/powerbooster rotate: false - xy: 601, 228 + xy: 631, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyor rotate: false - xy: 611, 228 + xy: 641, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/poweredconveyormove rotate: false - xy: 621, 228 + xy: 595, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaser rotate: false - xy: 631, 228 + xy: 605, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlasercorner rotate: false - xy: 641, 228 + xy: 615, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/powerlaserrouter rotate: false - xy: 593, 218 + xy: 625, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduit rotate: false - xy: 603, 218 + xy: 635, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduitbottom rotate: false - xy: 613, 218 + xy: 645, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pulseconduittop rotate: false - xy: 623, 218 + xy: 651, 228 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/pump rotate: false - xy: 633, 218 + xy: 655, 218 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -748,84 +748,84 @@ blocks/repairturret index: -1 blocks/rock1 rotate: false - xy: 405, 89 + xy: 671, 234 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rock2 rotate: false - xy: 405, 79 + xy: 665, 224 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/router rotate: false - xy: 415, 89 + xy: 665, 214 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator rotate: false - xy: 415, 79 + xy: 675, 224 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/rtgenerator-top rotate: false - xy: 405, 69 + xy: 675, 214 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand1 rotate: false - xy: 415, 69 + xy: 405, 89 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand2 rotate: false - xy: 175, 69 + xy: 405, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sand3 rotate: false - xy: 185, 69 + xy: 415, 89 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock1 rotate: false - xy: 195, 69 + xy: 415, 79 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock2 rotate: false - xy: 205, 69 + xy: 405, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandblock3 rotate: false - xy: 215, 69 + xy: 415, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/sandedge rotate: false - xy: 519, 189 + xy: 533, 203 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -839,7 +839,7 @@ blocks/shadow index: -1 blocks/shieldgenerator rotate: false - xy: 171, 49 + xy: 185, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -853,21 +853,21 @@ blocks/shotgunturret index: -1 blocks/shrub rotate: false - xy: 191, 59 + xy: 215, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/shrubshadow rotate: false - xy: 191, 49 + xy: 173, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/smelter rotate: false - xy: 201, 59 + xy: 183, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -881,77 +881,77 @@ blocks/sniperturret index: -1 blocks/snow1 rotate: false - xy: 201, 49 + xy: 193, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow2 rotate: false - xy: 211, 59 + xy: 203, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snow3 rotate: false - xy: 211, 49 + xy: 213, 59 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock1 rotate: false - xy: 225, 63 + xy: 173, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock2 rotate: false - xy: 235, 63 + xy: 183, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowblock3 rotate: false - xy: 245, 63 + xy: 193, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/snowedge rotate: false - xy: 533, 203 + xy: 533, 189 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/sorter rotate: false - xy: 255, 63 + xy: 203, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyor rotate: false - xy: 265, 63 + xy: 213, 49 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelconveyormove rotate: false - xy: 275, 63 + xy: 171, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/steelwall rotate: false - xy: 285, 63 + xy: 181, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -965,98 +965,98 @@ blocks/steelwall-large index: -1 blocks/steelwall-large-icon rotate: false - xy: 295, 63 + xy: 191, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone1 rotate: false - xy: 305, 63 + xy: 201, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone2 rotate: false - xy: 315, 63 + xy: 211, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stone3 rotate: false - xy: 325, 63 + xy: 175, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock1 rotate: false - xy: 335, 63 + xy: 185, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock2 rotate: false - xy: 345, 63 + xy: 195, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneblock3 rotate: false - xy: 355, 63 + xy: 205, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonedrill rotate: false - xy: 365, 63 + xy: 215, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stoneedge rotate: false - xy: 533, 189 + xy: 555, 213 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 blocks/stoneformer rotate: false - xy: 375, 63 + xy: 221, 39 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/stonewall rotate: false - xy: 385, 63 + xy: 225, 29 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter rotate: false - xy: 395, 63 + xy: 225, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/teleporter-top rotate: false - xy: 221, 53 + xy: 235, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/thermalgenerator rotate: false - xy: 231, 53 + xy: 245, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1077,49 +1077,49 @@ blocks/titancannon-icon index: -1 blocks/titanium1 rotate: false - xy: 241, 53 + xy: 255, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium2 rotate: false - xy: 251, 53 + xy: 265, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titanium3 rotate: false - xy: 261, 53 + xy: 275, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumdrill rotate: false - xy: 271, 53 + xy: 285, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumpurifier rotate: false - xy: 281, 53 + xy: 295, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumshieldwall rotate: false - xy: 291, 53 + xy: 305, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/titaniumwall rotate: false - xy: 301, 53 + xy: 315, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1133,7 +1133,7 @@ blocks/titaniumwall-large index: -1 blocks/titaniumwall-large-icon rotate: false - xy: 311, 53 + xy: 325, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1147,42 +1147,42 @@ blocks/turret index: -1 blocks/uranium1 rotate: false - xy: 341, 53 + xy: 355, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium2 rotate: false - xy: 351, 53 + xy: 365, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uranium3 rotate: false - xy: 361, 53 + xy: 375, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/uraniumdrill rotate: false - xy: 371, 53 + xy: 385, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/water rotate: false - xy: 381, 53 + xy: 395, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 blocks/wateredge rotate: false - xy: 555, 213 + xy: 569, 213 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1280,14 +1280,14 @@ enemies/targetenemy-t1 index: -1 enemies/enemy-t2 rotate: false - xy: 157, 54 + xy: 157, 38 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 enemies/enemy-t3 rotate: false - xy: 157, 40 + xy: 781, 426 size: 12, 12 orig: 12, 12 offset: 0, 0 @@ -1378,63 +1378,63 @@ enemies/healerenemy-t3 index: -1 enemies/mortarenemy-t1 rotate: false - xy: 693, 275 + xy: 656, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t2 rotate: false - xy: 656, 260 + xy: 672, 260 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/mortarenemy-t3 rotate: false - xy: 672, 260 + xy: 656, 244 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t1 rotate: false - xy: 656, 244 + xy: 672, 244 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t2 rotate: false - xy: 672, 244 + xy: 688, 259 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/rapidenemy-t3 rotate: false - xy: 688, 259 + xy: 688, 243 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t1 rotate: false - xy: 688, 243 + xy: 781, 440 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t2 rotate: false - xy: 781, 440 + xy: 797, 440 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 enemies/tankenemy-t3 rotate: false - xy: 797, 440 + xy: 157, 52 size: 14, 14 orig: 14, 14 offset: 0, 0 @@ -1469,49 +1469,49 @@ enemyarrow index: -1 icon-coal rotate: false - xy: 255, 73 + xy: 285, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-dirium rotate: false - xy: 265, 73 + xy: 295, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-iron rotate: false - xy: 275, 73 + xy: 305, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-steel rotate: false - xy: 285, 73 + xy: 315, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-stone rotate: false - xy: 295, 73 + xy: 325, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-titanium rotate: false - xy: 305, 73 + xy: 335, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 icon-uranium rotate: false - xy: 315, 73 + xy: 345, 73 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1539,35 +1539,35 @@ laserfull index: -1 mechs/mech-standard rotate: false - xy: 538, 217 + xy: 519, 203 size: 12, 12 orig: 12, 12 offset: 0, 0 index: -1 shell rotate: false - xy: 171, 59 + xy: 175, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot rotate: false - xy: 181, 59 + xy: 195, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 shot-long rotate: false - xy: 181, 49 + xy: 205, 69 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 titanshell rotate: false - xy: 321, 53 + xy: 335, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 @@ -1659,7 +1659,7 @@ ui/check-over index: -1 ui/clear rotate: false - xy: 581, 215 + xy: 583, 215 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1673,7 +1673,7 @@ ui/cursor index: -1 ui/icon-areaDelete rotate: false - xy: 188, 89 + xy: 200, 89 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1687,14 +1687,14 @@ ui/icon-arrow index: -1 ui/icon-arrow-left rotate: false - xy: 200, 89 + xy: 212, 89 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-arrow-right rotate: false - xy: 212, 89 + xy: 224, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 @@ -1736,200 +1736,207 @@ ui/icon-close-over index: -1 ui/icon-crafting rotate: false - xy: 224, 93 + xy: 236, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-cursor rotate: false - xy: 236, 93 + xy: 248, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 ui/icon-defense - rotate: false - xy: 248, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-distribution rotate: false xy: 260, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-donate +ui/icon-discord rotate: false xy: 645, 280 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-hold +ui/icon-distribution rotate: false xy: 272, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-holdDelete - rotate: false - xy: 284, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-info - rotate: false - xy: 296, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-load +ui/icon-donate rotate: false xy: 661, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-menu +ui/icon-hold + rotate: false + xy: 284, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-holdDelete + rotate: false + xy: 296, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-info rotate: false xy: 308, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-none - rotate: false - xy: 320, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-pause - rotate: false - xy: 332, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-play - rotate: false - xy: 344, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-play-2 +ui/icon-load rotate: false xy: 677, 276 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-power +ui/icon-menu + rotate: false + xy: 320, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-none + rotate: false + xy: 332, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-pause + rotate: false + xy: 344, 93 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-play rotate: false xy: 356, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-production - rotate: false - xy: 368, 93 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-quit +ui/icon-play-2 rotate: false xy: 592, 264 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-rotate +ui/icon-power rotate: false - xy: 592, 248 - size: 14, 14 - orig: 14, 14 + xy: 368, 93 + size: 10, 10 + orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-rotate-arrow - rotate: false - xy: 608, 264 - size: 14, 14 - orig: 14, 14 - offset: 0, 0 - index: -1 -ui/icon-rotate-left - rotate: false - xy: 608, 248 - size: 14, 14 - orig: 14, 14 - offset: 0, 0 - index: -1 -ui/icon-rotate-right - rotate: false - xy: 624, 264 - size: 14, 14 - orig: 14, 14 - offset: 0, 0 - index: -1 -ui/icon-save - rotate: false - xy: 624, 248 - size: 14, 14 - orig: 14, 14 - offset: 0, 0 - index: -1 -ui/icon-settings +ui/icon-production rotate: false xy: 380, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-tools +ui/icon-quit + rotate: false + xy: 592, 248 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-rotate + rotate: false + xy: 608, 264 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-rotate-arrow + rotate: false + xy: 608, 248 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-rotate-left + rotate: false + xy: 624, 264 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-rotate-right + rotate: false + xy: 624, 248 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-save rotate: false xy: 640, 264 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-touch +ui/icon-settings rotate: false xy: 392, 93 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 -ui/icon-touchDelete - rotate: false - xy: 131, 8 - size: 10, 10 - orig: 10, 10 - offset: 0, 0 - index: -1 -ui/icon-tutorial +ui/icon-tools rotate: false xy: 640, 248 size: 14, 14 orig: 14, 14 offset: 0, 0 index: -1 -ui/icon-weapon +ui/icon-touch + rotate: false + xy: 131, 8 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 +ui/icon-touchDelete rotate: false xy: 143, 8 size: 10, 10 orig: 10, 10 offset: 0, 0 index: -1 +ui/icon-tutorial + rotate: false + xy: 693, 275 + size: 14, 14 + orig: 14, 14 + offset: 0, 0 + index: -1 +ui/icon-weapon + rotate: false + xy: 155, 8 + size: 10, 10 + orig: 10, 10 + offset: 0, 0 + index: -1 ui/logotext rotate: false xy: 1, 85 @@ -2010,7 +2017,7 @@ ui/separator index: -1 ui/slider rotate: false - xy: 547, 207 + xy: 652, 238 size: 1, 8 orig: 1, 8 offset: 0, 0 @@ -2154,28 +2161,28 @@ weapons/flamer index: -1 weapons/mortar rotate: false - xy: 592, 238 + xy: 622, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/multigun rotate: false - xy: 612, 238 + xy: 642, 238 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/railgun rotate: false - xy: 643, 218 + xy: 661, 234 size: 8, 8 orig: 8, 8 offset: 0, 0 index: -1 weapons/triblaster rotate: false - xy: 331, 53 + xy: 345, 63 size: 8, 8 orig: 8, 8 offset: 0, 0 diff --git a/core/assets/sprites/sprites.png b/core/assets/sprites/sprites.png index 6e6187d5d2..4e303b5ec6 100644 Binary files a/core/assets/sprites/sprites.png and b/core/assets/sprites/sprites.png differ diff --git a/core/src/io/anuke/mindustry/Mindustry.java b/core/src/io/anuke/mindustry/Mindustry.java index 90512df26f..7645a2970b 100644 --- a/core/src/io/anuke/mindustry/Mindustry.java +++ b/core/src/io/anuke/mindustry/Mindustry.java @@ -6,7 +6,7 @@ import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.core.*; import io.anuke.mindustry.core.GameState.State; -import io.anuke.mindustry.io.Formatter; +import io.anuke.mindustry.io.PlatformFunction; import io.anuke.mindustry.world.Block; import io.anuke.mindustry.world.blocks.*; import io.anuke.ucore.core.Inputs; @@ -16,10 +16,12 @@ import io.anuke.ucore.modules.ModuleCore; public class Mindustry extends ModuleCore { public static Callable donationsCallable; + public static boolean hasDiscord = true; public static Array args = new Array<>(); - public static Formatter formatter = new Formatter(){ + public static PlatformFunction platforms = new PlatformFunction(){ @Override public String format(Date date){ return "invalid date"; } @Override public String format(int number){ return number + ""; } + @Override public void openLink(String link){ } }; //always initialize blocks in this order, otherwise there are ID errors diff --git a/core/src/io/anuke/mindustry/Vars.java b/core/src/io/anuke/mindustry/Vars.java index feb127324a..956d798436 100644 --- a/core/src/io/anuke/mindustry/Vars.java +++ b/core/src/io/anuke/mindustry/Vars.java @@ -9,7 +9,7 @@ import io.anuke.mindustry.entities.Player; import io.anuke.ucore.scene.ui.layout.Unit; public class Vars{ - public static final boolean testAndroid = true; + public static final boolean testAndroid = false; //shorthand for whether or not this is running on android public static final boolean android = (Gdx.app.getType() == ApplicationType.Android) || testAndroid; //shorthand for whether or not this is running on GWT @@ -26,6 +26,8 @@ public class Vars{ public static final float aheadPathfinding = 60*20; //how far away from spawn points the player can't place blocks public static final float enemyspawnspace = 65; + //discord group URL + public static final String discordURL = "https://discord.gg/r8BkXNd"; //scale of the font public static float fontscale = Unit.dp.inPixels(1f)/2f; //camera zoom displayed on startup diff --git a/core/src/io/anuke/mindustry/core/Tutorial.java b/core/src/io/anuke/mindustry/core/Tutorial.java index 01d77bfba8..cf3572bdd6 100644 --- a/core/src/io/anuke/mindustry/core/Tutorial.java +++ b/core/src/io/anuke/mindustry/core/Tutorial.java @@ -43,7 +43,7 @@ public class Tutorial{ new table("pane"){{ atop(); - get().pad(Unit.dp.inPixels(12)); + margin(12); info = new label(()->stage.text).pad(10f).padBottom(5f).width(340f).units(Unit.dp).colspan(2).get(); info.setWrap(true); diff --git a/core/src/io/anuke/mindustry/core/UI.java b/core/src/io/anuke/mindustry/core/UI.java index 30408bf64d..c434d44d7b 100644 --- a/core/src/io/anuke/mindustry/core/UI.java +++ b/core/src/io/anuke/mindustry/core/UI.java @@ -12,6 +12,7 @@ import com.badlogic.gdx.math.Vector2; import com.badlogic.gdx.utils.Align; import com.badlogic.gdx.utils.Array; +import io.anuke.mindustry.Mindustry; import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.ui.*; @@ -37,7 +38,7 @@ public class UI extends SceneModule{ Table loadingtable, desctable, configtable; MindustrySettingsDialog prefs; MindustryKeybindDialog keys; - Dialog about, restart, levels, upgrades, load, settingserror, gameerror; + Dialog about, restart, levels, upgrades, load, settingserror, gameerror, discord; MenuDialog menu; Tooltip tooltip; Tile configTile; @@ -170,9 +171,16 @@ public class UI extends SceneModule{ + "\n[ORANGE]anukendev@gmail.com[]"){{ setWrap(true); }}).width(600f).units(Unit.dp).pad(10f); - gameerror.buttons().addButton("OK", ()-> gameerror.hide()).size(200f, 50).units(Unit.dp); + gameerror.buttons().addButton("OK", gameerror::hide).size(200f, 50).units(Unit.dp); //gameerror.setFillParent(true); + discord = new Dialog("Discord", "dialog"); + discord.content().pad(Unit.dp.inPixels(12f)); + discord.content().add("Join the mindustry discord!\n[orange]" + Vars.discordURL); + discord.buttons().defaults().size(200f, 50).units(Unit.dp); + discord.buttons().addButton("Open link", () -> Mindustry.platforms.openLink(Vars.discordURL)); + discord.buttons().addButton("Back", discord::hide); + load = new LoadDialog(); upgrades = new UpgradeDialog(); @@ -426,6 +434,10 @@ public class UI extends SceneModule{ public void showUpgrades(){ upgrades.show(); } + + public void showDiscord(){ + discord.show(); + } public void updateItems(){ ((HudFragment)hudfrag).updateItems(); diff --git a/core/src/io/anuke/mindustry/editor/EditorUI.java b/core/src/io/anuke/mindustry/editor/EditorUI.java index 2c43937aff..497d866fb4 100644 --- a/core/src/io/anuke/mindustry/editor/EditorUI.java +++ b/core/src/io/anuke/mindustry/editor/EditorUI.java @@ -42,7 +42,7 @@ public class EditorUI extends SceneModule{ }).left(); row(); } - get().pad(16); + margin(16); }}.end(); }}.end(); build.end(); diff --git a/core/src/io/anuke/mindustry/entities/effect/Fx.java b/core/src/io/anuke/mindustry/entities/effect/Fx.java index eb24975efd..6ef2a659ca 100644 --- a/core/src/io/anuke/mindustry/entities/effect/Fx.java +++ b/core/src/io/anuke/mindustry/entities/effect/Fx.java @@ -313,10 +313,7 @@ public class Fx{ breakBlock = new Effect(12, e -> { Draw.thickness(2f); Draw.color(Color.WHITE, Colors.get("break"), e.ifract()); - Draw.spikes(e.x, e.y, e.ifract() * 5f, 2, 5, 90); - - Draw.thickness(2f - e.ifract() * 2f); - Draw.polygon(4, e.x, e.y, Vars.tilesize / 1.6f + e.ifract() * 5f, 45); + Draw.spikes(e.x, e.y, e.ifract() * 6f, 2, 5, 90); Draw.reset(); }), diff --git a/core/src/io/anuke/mindustry/io/Formatter.java b/core/src/io/anuke/mindustry/io/PlatformFunction.java similarity index 64% rename from core/src/io/anuke/mindustry/io/Formatter.java rename to core/src/io/anuke/mindustry/io/PlatformFunction.java index d6dc1278dd..28a142b34c 100644 --- a/core/src/io/anuke/mindustry/io/Formatter.java +++ b/core/src/io/anuke/mindustry/io/PlatformFunction.java @@ -2,7 +2,8 @@ package io.anuke.mindustry.io; import java.util.Date; -public interface Formatter{ +public interface PlatformFunction{ public String format(Date date); public String format(int number); + public void openLink(String link); } diff --git a/core/src/io/anuke/mindustry/io/SaveIO.java b/core/src/io/anuke/mindustry/io/SaveIO.java index 9b4db3513d..f31b7e1a4d 100644 --- a/core/src/io/anuke/mindustry/io/SaveIO.java +++ b/core/src/io/anuke/mindustry/io/SaveIO.java @@ -127,7 +127,7 @@ public class SaveIO{ try(DataInputStream stream = new DataInputStream(fileFor(slot).read())){ stream.readInt(); Date date = new Date(stream.readLong()); - return Mindustry.formatter.format(date); + return Mindustry.platforms.format(date); }catch (IOException e){ throw new RuntimeException(e); } diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index 9a4fbf018f..8c3bec07fb 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -123,7 +123,7 @@ public class BlocksFragment implements Fragment{ row(); add(stack).colspan(Section.values().length); - get().pad(10f); + margin(10f); get().padLeft(0f); get().padRight(0f); diff --git a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java index 897b33de25..95fa9d2b8f 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/HudFragment.java @@ -169,7 +169,7 @@ public class HudFragment implements Fragment{ (control.getTutorial().active() || Vars.control.getMode() == GameMode.sandbox) ? "waiting..." : "Wave in " + (int) (control.getWaveCountdown() / 60f)) .minWidth(140).units(Unit.dp).left(); - get().pad(Unit.dp.inPixels(12)); + margin(12f); get().padLeft(6); }}.left().end(); @@ -206,7 +206,7 @@ public class HudFragment implements Fragment{ for(int i = 0; i < control.getItems().length; i ++){ int amount = control.getItems()[i]; if(amount == 0) continue; - String formatted = Mindustry.formatter.format(amount); + String formatted = Mindustry.platforms.format(amount); if(amount > 99999999){ formatted = "inf"; } diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 31921ed864..b6f6f778dc 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -1,7 +1,5 @@ package io.anuke.mindustry.ui.fragments; -import static io.anuke.mindustry.Vars.*; - import com.badlogic.gdx.Gdx; import io.anuke.mindustry.Mindustry; @@ -14,6 +12,11 @@ import io.anuke.ucore.scene.builders.imagebutton; import io.anuke.ucore.scene.builders.table; import io.anuke.ucore.scene.ui.layout.Unit; +import static io.anuke.mindustry.Vars.android; +import static io.anuke.mindustry.Vars.control; +import static io.anuke.mindustry.Vars.gwt; +import static io.anuke.mindustry.Vars.ui; + public class MenuFragment implements Fragment{ public void build(){ @@ -77,9 +80,14 @@ public class MenuFragment implements Fragment{ //settings icon new table(){{ atop().aright(); + if(Mindustry.hasDiscord){ + new imagebutton("icon-discord", Unit.dp.inPixels(30f), ()->{ + ui.showDiscord(); + }).margin(14); + } new imagebutton("icon-info", Unit.dp.inPixels(30f), ()->{ ui.showAbout(); - }).get().pad(Unit.dp.inPixels(14)); + }).margin(14); }}.end().visible(()->GameState.is(State.menu)); } } diff --git a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java index 356ecac18f..9fb0494c4d 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/PlacementFragment.java @@ -46,7 +46,7 @@ public class PlacementFragment implements Fragment{ row(); new table("pane"){{ - get().pad(5); + margin(5f); aleft(); ButtonGroup group = new ButtonGroup<>(); @@ -94,7 +94,7 @@ public class PlacementFragment implements Fragment{ row(); new table("pane"){{ - get().pad(5); + margin(5f); touchable(Touchable.enabled); aleft(); ButtonGroup group = new ButtonGroup<>(); diff --git a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java index 34f7139430..bdb4ad1f24 100644 --- a/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/io/anuke/mindustry/desktop/DesktopLauncher.java @@ -1,5 +1,8 @@ package io.anuke.mindustry.desktop; +import java.awt.Desktop; +import java.io.IOException; +import java.net.URI; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.Date; @@ -9,7 +12,8 @@ import com.badlogic.gdx.backends.lwjgl3.Lwjgl3ApplicationConfiguration; import com.badlogic.gdx.utils.Array; import io.anuke.mindustry.Mindustry; -import io.anuke.mindustry.io.Formatter; +import io.anuke.mindustry.Vars; +import io.anuke.mindustry.io.PlatformFunction; public class DesktopLauncher { @@ -21,7 +25,7 @@ public class DesktopLauncher { config.setWindowIcon("sprites/icon.png"); //config.useVsync(false); - Mindustry.formatter = new Formatter(){ + Mindustry.platforms = new PlatformFunction(){ SimpleDateFormat format = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm"); @Override @@ -33,6 +37,16 @@ public class DesktopLauncher { public String format(int number){ return NumberFormat.getIntegerInstance().format(number); } + + @Override + public void openLink(String link){ + try{ + Desktop.getDesktop().browse(URI.create(link)); + }catch(IOException e){ + e.printStackTrace(); + Vars.ui.showError("Error opening link."); + } + } }; Mindustry.args = Array.with(arg); diff --git a/html/src/io/anuke/mindustry/client/HtmlLauncher.java b/html/src/io/anuke/mindustry/client/HtmlLauncher.java index 930e97b0da..613cc30abe 100644 --- a/html/src/io/anuke/mindustry/client/HtmlLauncher.java +++ b/html/src/io/anuke/mindustry/client/HtmlLauncher.java @@ -12,10 +12,11 @@ import com.google.gwt.dom.client.*; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.i18n.client.NumberFormat; import com.google.gwt.i18n.shared.DateTimeFormat; +import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.*; import io.anuke.mindustry.Mindustry; -import io.anuke.mindustry.io.Formatter; +import io.anuke.mindustry.io.PlatformFunction; public class HtmlLauncher extends GwtApplication { static final int WIDTH = 800; @@ -88,7 +89,7 @@ public class HtmlLauncher extends GwtApplication { } }); - Mindustry.formatter = new Formatter(){ + Mindustry.platforms = new PlatformFunction(){ DateTimeFormat format = DateTimeFormat.getFormat("EEE, dd MMM yyyy HH:mm:ss"); @Override @@ -100,6 +101,11 @@ public class HtmlLauncher extends GwtApplication { public String format(int number){ return NumberFormat.getDecimalFormat().format(number); } + + @Override + public void openLink(String link){ + Window.open(link, "_blank", ""); + } }; return new Mindustry();