From 0ff3c1ee78b646dee2e8387e20eb76f3ef7f1c44 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 8 Mar 2020 21:53:19 -0400 Subject: [PATCH] Cleanup --- build.gradle | 1 + core/src/mindustry/core/Control.java | 4 ++-- core/src/mindustry/core/GameState.java | 9 +++++++++ core/src/mindustry/core/Logic.java | 2 +- core/src/mindustry/core/NetClient.java | 2 +- core/src/mindustry/core/NetServer.java | 4 ++-- core/src/mindustry/core/Renderer.java | 7 ++----- core/src/mindustry/core/UI.java | 11 +++++------ core/src/mindustry/game/MusicControl.java | 2 +- core/src/mindustry/game/Saves.java | 6 +++--- core/src/mindustry/input/DesktopInput.java | 6 +++--- core/src/mindustry/input/MobileInput.java | 8 ++++---- core/src/mindustry/ui/ItemsDisplay.java | 4 ++-- .../src/mindustry/ui/dialogs/DatabaseDialog.java | 2 +- .../src/mindustry/ui/dialogs/FloatingDialog.java | 4 ++-- core/src/mindustry/ui/dialogs/PausedDialog.java | 2 +- core/src/mindustry/ui/dialogs/SaveDialog.java | 2 +- .../mindustry/ui/dialogs/SchematicsDialog.java | 2 +- .../mindustry/ui/dialogs/SettingsMenuDialog.java | 4 ++-- .../ui/fragments/BlockConfigFragment.java | 2 +- .../ui/fragments/BlockInventoryFragment.java | 2 +- core/src/mindustry/ui/fragments/HudFragment.java | 16 ++++++++-------- .../ui/fragments/PlayerListFragment.java | 3 +-- .../src/mindustry/desktop/DesktopLauncher.java | 3 +-- server/src/mindustry/server/ServerControl.java | 4 ++-- settings.gradle | 1 + 26 files changed, 59 insertions(+), 54 deletions(-) diff --git a/build.gradle b/build.gradle index d40b6fc767..ac9cd0ffaf 100644 --- a/build.gradle +++ b/build.gradle @@ -253,6 +253,7 @@ project(":core"){ compile arcModule("arc-core") compile arcModule("extensions:freetype") compile arcModule("extensions:g3d") + compile arcModule("extensions:fx") compile arcModule("extensions:arcnet") compile "org.mozilla:rhino-runtime:1.7.12" if(localArc() && debugged()) compile arcModule("extensions:recorder") diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 02676f4469..6544339099 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -213,7 +213,7 @@ public class Control implements ApplicationListener, Loadable{ input = new DesktopInput(); } - if(!state.is(State.menu)){ + if(state.isGame()){ player.add(); } @@ -445,7 +445,7 @@ public class Control implements ApplicationListener, Loadable{ settings.save(); } - if(!state.is(State.menu)){ + if(state.isGame()){ input.update(); if(state.isCampaign()){ diff --git a/core/src/mindustry/core/GameState.java b/core/src/mindustry/core/GameState.java index ce9154c39e..3ea19618e4 100644 --- a/core/src/mindustry/core/GameState.java +++ b/core/src/mindustry/core/GameState.java @@ -58,6 +58,15 @@ public class GameState{ return (is(State.paused) && !net.active()) || (gameOver && !net.active()); } + /** @return whether the current state is *not* the menu. */ + public boolean isGame(){ + return state != State.menu; + } + + public boolean isMenu(){ + return state == State.menu; + } + public boolean is(State astate){ return state == astate; } diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index bb76368817..6e288a6fce 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -206,7 +206,7 @@ public class Logic implements ApplicationListener{ Events.fire(Trigger.update); universe.updateGlobal(); - if(!state.is(State.menu)){ + if(state.isGame()){ if(!net.client()){ state.enemies = Groups.unit.count(b -> b.team() == state.rules.waveTeam && b.type().isCounted); } diff --git a/core/src/mindustry/core/NetClient.java b/core/src/mindustry/core/NetClient.java index e932699bca..492ef35430 100644 --- a/core/src/mindustry/core/NetClient.java +++ b/core/src/mindustry/core/NetClient.java @@ -451,7 +451,7 @@ public class NetClient implements ApplicationListener{ public void update(){ if(!net.client()) return; - if(!state.is(State.menu)){ + if(state.isGame()){ if(!connecting) sync(); }else if(!connecting){ net.disconnect(); diff --git a/core/src/mindustry/core/NetServer.java b/core/src/mindustry/core/NetServer.java index 659cb373a6..12d12532d8 100644 --- a/core/src/mindustry/core/NetServer.java +++ b/core/src/mindustry/core/NetServer.java @@ -673,7 +673,7 @@ public class NetServer implements ApplicationListener{ @Override public void update(){ - if(!headless && !closing && net.server() && state.is(State.menu)){ + if(!headless && !closing && net.server() && state.isMenu()){ closing = true; ui.loadfrag.show("$server.closing"); Time.runTask(5f, () -> { @@ -683,7 +683,7 @@ public class NetServer implements ApplicationListener{ }); } - if(!state.is(State.menu) && net.server()){ + if(state.isGame() && net.server()){ sync(); } } diff --git a/core/src/mindustry/core/Renderer.java b/core/src/mindustry/core/Renderer.java index 56389e077c..ae4baea52a 100644 --- a/core/src/mindustry/core/Renderer.java +++ b/core/src/mindustry/core/Renderer.java @@ -9,7 +9,6 @@ import arc.math.*; import arc.scene.ui.layout.*; import arc.util.*; import mindustry.content.*; -import mindustry.core.GameState.*; import mindustry.game.EventType.*; import mindustry.gen.*; import mindustry.graphics.*; @@ -27,7 +26,7 @@ public class Renderer implements ApplicationListener{ public FrameBuffer effectBuffer = new FrameBuffer(2, 2); private Bloom bloom; - private Color clearColor; + private Color clearColor = new Color(0f, 0f, 0f, 1f); private float targetscale = Scl.scl(4); private float camerascale = targetscale; private float landscale = 0f, landTime; @@ -37,8 +36,6 @@ public class Renderer implements ApplicationListener{ public Renderer(){ camera = new Camera(); Shaders.init(); - - clearColor = new Color(0f, 0f, 0f, 1f); } public void shake(float intensity, float duration){ @@ -68,7 +65,7 @@ public class Renderer implements ApplicationListener{ camera.width = graphics.getWidth() / camerascale; camera.height = graphics.getHeight() / camerascale; - if(state.is(State.menu)){ + if(state.isMenu()){ landTime = 0f; graphics.clear(Color.black); }else{ diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index d3c416ee31..fb917c3ac3 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -20,7 +20,6 @@ import arc.scene.ui.Tooltip.*; import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; -import mindustry.core.GameState.*; import mindustry.editor.*; import mindustry.game.EventType.*; import mindustry.gen.*; @@ -185,10 +184,10 @@ public class UI implements ApplicationListener, Loadable{ menuGroup.setFillParent(true); menuGroup.touchable(Touchable.childrenOnly); - menuGroup.visible(() -> state.is(State.menu)); + menuGroup.visible(() -> state.isMenu()); hudGroup.setFillParent(true); hudGroup.touchable(Touchable.childrenOnly); - hudGroup.visible(() -> !state.is(State.menu)); + hudGroup.visible(() -> state.isGame()); Core.scene.add(menuGroup); Core.scene.add(hudGroup); @@ -296,7 +295,7 @@ public class UI implements ApplicationListener, Loadable{ table.setFillParent(true); table.touchable(Touchable.disabled); table.update(() -> { - if(state.is(State.menu)) table.remove(); + if(state.isMenu()) table.remove(); }); table.actions(Actions.delay(duration * 0.9f), Actions.fadeOut(duration * 0.1f, Interpolation.fade), Actions.remove()); table.top().table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).padTop(10); @@ -309,7 +308,7 @@ public class UI implements ApplicationListener, Loadable{ table.setFillParent(true); table.touchable(Touchable.disabled); table.update(() -> { - if(state.is(State.menu)) table.remove(); + if(state.isMenu()) table.remove(); }); table.actions(Actions.delay(duration), Actions.remove()); table.align(align).table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).pad(top, left, bottom, right); @@ -322,7 +321,7 @@ public class UI implements ApplicationListener, Loadable{ table.setFillParent(true); table.touchable(Touchable.disabled); table.update(() -> { - if(state.is(State.menu)) table.remove(); + if(state.isMenu()) table.remove(); }); table.actions(Actions.delay(duration), Actions.remove()); table.align(Align.center).table(Styles.black3, t -> t.margin(4).add(info).style(Styles.outlineLabel)).update(t -> { diff --git a/core/src/mindustry/game/MusicControl.java b/core/src/mindustry/game/MusicControl.java index 38bfbd745b..176f29eede 100644 --- a/core/src/mindustry/game/MusicControl.java +++ b/core/src/mindustry/game/MusicControl.java @@ -46,7 +46,7 @@ public class MusicControl{ /** Update and play the right music track.*/ public void update(){ - if(state.is(State.menu)){ + if(state.isMenu()){ silenced = false; if(ui.planet.isShown()){ play(Musics.launch); diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index 7234acfe08..d5f40563f9 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -77,7 +77,7 @@ public class Saves{ public void update(){ SaveSlot current = this.current; - if(current != null && !state.is(State.menu) + if(current != null && state.isGame() && !(state.isPaused() && Core.scene.hasDialog())){ if(lastTimestamp != 0){ totalPlaytime += Time.timeSinceMillis(lastTimestamp); @@ -85,7 +85,7 @@ public class Saves{ lastTimestamp = Time.millis(); } - if(!state.is(State.menu) && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){ + if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){ time += Time.delta(); if(time > Core.settings.getInt("saveinterval") * 60){ saving = true; @@ -192,7 +192,7 @@ public class Saves{ SaveIO.save(file); meta = SaveIO.getMeta(file); - if(!state.is(State.menu)){ + if(state.isGame()){ current = this; } diff --git a/core/src/mindustry/input/DesktopInput.java b/core/src/mindustry/input/DesktopInput.java index a454b95fe6..175186e835 100644 --- a/core/src/mindustry/input/DesktopInput.java +++ b/core/src/mindustry/input/DesktopInput.java @@ -177,11 +177,11 @@ public class DesktopInput extends InputHandler{ isShooting = false; } - if(!state.is(State.menu) && Core.input.keyTap(Binding.minimap) && !scene.hasDialog() && !(scene.getKeyboardFocus() instanceof TextField)){ + if(state.isGame() && Core.input.keyTap(Binding.minimap) && !scene.hasDialog() && !(scene.getKeyboardFocus() instanceof TextField)){ ui.minimapfrag.toggle(); } - if(state.is(State.menu) || Core.scene.hasDialog()) return; + if(state.isMenu() || Core.scene.hasDialog()) return; //zoom camera if((!Core.scene.hasScroll() || Core.input.keyDown(Binding.diagonal_placement)) && !ui.chatfrag.shown() && Math.abs(Core.input.axisTap(Binding.zoom)) > 0 @@ -491,7 +491,7 @@ public class DesktopInput extends InputHandler{ @Override public void updateState(){ - if(state.is(State.menu)){ + if(state.isMenu()){ droppingItem = false; mode = none; block = null; diff --git a/core/src/mindustry/input/MobileInput.java b/core/src/mindustry/input/MobileInput.java index 5f6d61aff8..50b3c5a89b 100644 --- a/core/src/mindustry/input/MobileInput.java +++ b/core/src/mindustry/input/MobileInput.java @@ -432,7 +432,7 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean touchDown(int screenX, int screenY, int pointer, KeyCode button){ - if(state.is(State.menu)) return false; + if(state.isMenu()) return false; down = true; @@ -513,7 +513,7 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean longPress(float x, float y){ - if(state.is(State.menu) || mode == none || player.dead()) return false; + if(state.isMenu() || mode == none || player.dead()) return false; //get tile on cursor Tile cursor = tileAt(x, y); @@ -541,7 +541,7 @@ public class MobileInput extends InputHandler implements GestureListener{ @Override public boolean tap(float x, float y, int count, KeyCode button){ - if(state.is(State.menu) || lineMode) return false; + if(state.isMenu() || lineMode) return false; float worldx = Core.input.mouseWorld(x, y).x, worldy = Core.input.mouseWorld(x, y).y; @@ -574,7 +574,7 @@ public class MobileInput extends InputHandler implements GestureListener{ public void update(){ super.update(); - if(state.is(State.menu) ){ + if(state.isMenu() ){ selectRequests.clear(); removals.clear(); mode = none; diff --git a/core/src/mindustry/ui/ItemsDisplay.java b/core/src/mindustry/ui/ItemsDisplay.java index 81b9439d7b..b22646f390 100644 --- a/core/src/mindustry/ui/ItemsDisplay.java +++ b/core/src/mindustry/ui/ItemsDisplay.java @@ -41,7 +41,7 @@ public class ItemsDisplay extends Table{ }).get().setScrollingDisabled(true, false), false).setDuration(0.3f); c.addImageTextButton("$launcheditems", Icon.downOpen, Styles.clearTogglet, col::toggle).update(t -> { - t.setText(state.is(State.menu) ? "$launcheditems" : "$launchinfo"); + t.setText(state.isMenu() ? "$launcheditems" : "$launchinfo"); t.setChecked(col.isCollapsed()); ((Image)t.getChildren().get(1)).setDrawable(col.isCollapsed() ? Icon.upOpen : Icon.downOpen); }).padBottom(4).left().fillX().margin(12f).minWidth(200f); @@ -53,7 +53,7 @@ public class ItemsDisplay extends Table{ private String format(Item item){ builder.setLength(0); builder.append(ui.formatAmount(data.items().get(item, 0))); - if(!state.is(State.menu) && player.team().data().hasCore() && player.team().core().items().get(item) > 0){ + if(state.isGame() && player.team().data().hasCore() && player.team().core().items().get(item) > 0){ builder.append(" [unlaunched]+ "); builder.append(ui.formatAmount(state.teams.get(player.team()).core().items().get(item))); } diff --git a/core/src/mindustry/ui/dialogs/DatabaseDialog.java b/core/src/mindustry/ui/dialogs/DatabaseDialog.java index b1551349e5..e3a44d63e9 100644 --- a/core/src/mindustry/ui/dialogs/DatabaseDialog.java +++ b/core/src/mindustry/ui/dialogs/DatabaseDialog.java @@ -91,6 +91,6 @@ public class DatabaseDialog extends FloatingDialog{ } boolean unlocked(UnlockableContent content){ - return (!Vars.state.isCampaign() && !Vars.state.is(State.menu)) || content.unlocked(); + return (!Vars.state.isCampaign() && !Vars.state.isMenu()) || content.unlocked(); } } diff --git a/core/src/mindustry/ui/dialogs/FloatingDialog.java b/core/src/mindustry/ui/dialogs/FloatingDialog.java index 13ea53e480..37a4c0e312 100644 --- a/core/src/mindustry/ui/dialogs/FloatingDialog.java +++ b/core/src/mindustry/ui/dialogs/FloatingDialog.java @@ -24,7 +24,7 @@ public class FloatingDialog extends Dialog{ .growX().height(3f).pad(4f); hidden(() -> { - if(shouldPause && !state.is(State.menu)){ + if(shouldPause && state.isGame()){ if(!wasPaused || net.active()){ state.set(State.playing); } @@ -33,7 +33,7 @@ public class FloatingDialog extends Dialog{ }); shown(() -> { - if(shouldPause && !state.is(State.menu)){ + if(shouldPause && state.isGame()){ wasPaused = state.is(State.paused); state.set(State.paused); } diff --git a/core/src/mindustry/ui/dialogs/PausedDialog.java b/core/src/mindustry/ui/dialogs/PausedDialog.java index 17f26ac688..62ce1e2a0d 100644 --- a/core/src/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/mindustry/ui/dialogs/PausedDialog.java @@ -29,7 +29,7 @@ public class PausedDialog extends FloatingDialog{ cont.clear(); update(() -> { - if(state.is(State.menu) && isShown()){ + if(state.isMenu() && isShown()){ hide(); } }); diff --git a/core/src/mindustry/ui/dialogs/SaveDialog.java b/core/src/mindustry/ui/dialogs/SaveDialog.java index 0832e80bdf..a760256785 100644 --- a/core/src/mindustry/ui/dialogs/SaveDialog.java +++ b/core/src/mindustry/ui/dialogs/SaveDialog.java @@ -15,7 +15,7 @@ public class SaveDialog extends LoadDialog{ super("$savegame"); update(() -> { - if(state.is(State.menu) && isShown()){ + if(state.isMenu() && isShown()){ hide(); } }); diff --git a/core/src/mindustry/ui/dialogs/SchematicsDialog.java b/core/src/mindustry/ui/dialogs/SchematicsDialog.java index 67cb1aa0e9..d8c147cb9b 100644 --- a/core/src/mindustry/ui/dialogs/SchematicsDialog.java +++ b/core/src/mindustry/ui/dialogs/SchematicsDialog.java @@ -122,7 +122,7 @@ public class SchematicsDialog extends FloatingDialog{ })).size(200f); }, () -> { if(sel[0].childrenPressed()) return; - if(state.is(State.menu)){ + if(state.isMenu()){ showInfo(s); }else{ control.input.useSchematic(s); diff --git a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java index af4f6db807..0515062d0c 100644 --- a/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java +++ b/core/src/mindustry/ui/dialogs/SettingsMenuDialog.java @@ -37,7 +37,7 @@ public class SettingsMenuDialog extends SettingsDialog{ public SettingsMenuDialog(){ hidden(() -> { Sounds.back.play(); - if(!state.is(State.menu)){ + if(state.isGame()){ if(!wasPaused || net.active()) state.set(State.playing); } @@ -45,7 +45,7 @@ public class SettingsMenuDialog extends SettingsDialog{ shown(() -> { back(); - if(!state.is(State.menu)){ + if(state.isGame()){ wasPaused = state.is(State.paused); state.set(State.paused); } diff --git a/core/src/mindustry/ui/fragments/BlockConfigFragment.java b/core/src/mindustry/ui/fragments/BlockConfigFragment.java index 2b703d3791..2a1fcf3f30 100644 --- a/core/src/mindustry/ui/fragments/BlockConfigFragment.java +++ b/core/src/mindustry/ui/fragments/BlockConfigFragment.java @@ -27,7 +27,7 @@ public class BlockConfigFragment extends Fragment{ @Override public void act(float delta){ super.act(delta); - if(state.is(State.menu)){ + if(state.isMenu()){ table.visible(false); configTile = null; } diff --git a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java index b41cca6b66..0f838876bb 100644 --- a/core/src/mindustry/ui/fragments/BlockInventoryFragment.java +++ b/core/src/mindustry/ui/fragments/BlockInventoryFragment.java @@ -99,7 +99,7 @@ public class BlockInventoryFragment extends Fragment{ table.touchable(Touchable.enabled); table.update(() -> { - if(state.is(State.menu) || tile == null || !tile.isValid() || !tile.block().isAccessible() || tile.items().total() == 0){ + if(state.isMenu() || tile == null || !tile.isValid() || !tile.block().isAccessible() || tile.items().total() == 0){ hide(); }else{ if(holding && lastItem != null){ diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 5963fe50bd..89d0e6f6d8 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -229,7 +229,7 @@ public class HudFragment extends Fragment{ }); t.top().visible(() -> { - if(state.is(State.menu) || !state.teams.get(player.team()).hasCore()){ + if(state.isMenu() || !state.teams.get(player.team()).hasCore()){ coreAttackTime[0] = 0f; return false; } @@ -288,7 +288,7 @@ public class HudFragment extends Fragment{ .style(Styles.outlineLabel)).padTop(10).visible(p.color.a >= 0.001f); p.update(() -> { p.color.a = Mathf.lerpDelta(p.color.a, Mathf.num(showHudText), 0.2f); - if(state.is(State.menu)){ + if(state.isMenu()){ p.color.a = 0f; showHudText = false; } @@ -328,14 +328,14 @@ public class HudFragment extends Fragment{ } public void showToast(String text){ - if(state.is(State.menu)) return; + if(state.isMenu()) return; scheduleToast(() -> { Sounds.message.play(); Table table = new Table(Tex.button); table.update(() -> { - if(state.is(State.menu)){ + if(state.isMenu()){ table.remove(); } }); @@ -362,7 +362,7 @@ public class HudFragment extends Fragment{ public void showUnlock(UnlockableContent content){ //some content may not have icons... yet //also don't play in the tutorial to prevent confusion - if(state.is(State.menu) || state.rules.tutorial) return; + if(state.isMenu() || state.rules.tutorial) return; Sounds.message.play(); @@ -371,7 +371,7 @@ public class HudFragment extends Fragment{ scheduleToast(() -> { Table table = new Table(Tex.button); table.update(() -> { - if(state.is(State.menu)){ + if(state.isMenu()){ table.remove(); lastUnlockLayout = null; lastUnlockTable = null; @@ -454,7 +454,7 @@ public class HudFragment extends Fragment{ image.setFillParent(true); image.actions(Actions.fadeIn(40f / 60f)); image.update(() -> { - if(state.is(State.menu)){ + if(state.isMenu()){ image.remove(); } }); @@ -469,7 +469,7 @@ public class HudFragment extends Fragment{ image.actions(Actions.fadeOut(0.8f), Actions.remove()); image.update(() -> { image.toFront(); - if(state.is(State.menu)){ + if(state.isMenu()){ image.remove(); } }); diff --git a/core/src/mindustry/ui/fragments/PlayerListFragment.java b/core/src/mindustry/ui/fragments/PlayerListFragment.java index e96fae02fe..ffdcabf652 100644 --- a/core/src/mindustry/ui/fragments/PlayerListFragment.java +++ b/core/src/mindustry/ui/fragments/PlayerListFragment.java @@ -7,7 +7,6 @@ import arc.scene.event.*; import arc.scene.ui.*; import arc.scene.ui.layout.*; import arc.util.*; -import mindustry.core.GameState.*; import mindustry.gen.*; import mindustry.graphics.*; import mindustry.net.*; @@ -26,7 +25,7 @@ public class PlayerListFragment extends Fragment{ parent.fill(cont -> { cont.visible(() -> visible); cont.update(() -> { - if(!(net.active() && !state.is(State.menu))){ + if(!(net.active() && state.isGame())){ visible = false; return; } diff --git a/desktop/src/mindustry/desktop/DesktopLauncher.java b/desktop/src/mindustry/desktop/DesktopLauncher.java index 0f0d550573..20de8f1ac5 100644 --- a/desktop/src/mindustry/desktop/DesktopLauncher.java +++ b/desktop/src/mindustry/desktop/DesktopLauncher.java @@ -13,7 +13,6 @@ import arc.util.serialization.*; import club.minnced.discord.rpc.*; import com.codedisaster.steamworks.*; import mindustry.*; -import mindustry.core.GameState.*; import mindustry.core.*; import mindustry.desktop.steam.*; import mindustry.game.EventType.*; @@ -248,7 +247,7 @@ public class DesktopLauncher extends ClientLauncher{ if(!useDiscord && !steam) return; //common elements they each share - boolean inGame = !state.is(State.menu); + boolean inGame = state.isGame(); String gameMapWithWave = "Unknown Map"; String gameMode = ""; String gamePlayersSuffix = ""; diff --git a/server/src/mindustry/server/ServerControl.java b/server/src/mindustry/server/ServerControl.java index 884593b287..fd9efed173 100644 --- a/server/src/mindustry/server/ServerControl.java +++ b/server/src/mindustry/server/ServerControl.java @@ -276,7 +276,7 @@ public class ServerControl implements ApplicationListener{ }); handler.register("status", "Display server status.", arg -> { - if(state.is(State.menu)){ + if(state.isMenu()){ info("Status: &rserver closed"); }else{ info("Status:"); @@ -777,7 +777,7 @@ public class ServerControl implements ApplicationListener{ }); handler.register("gameover", "Force a game over.", arg -> { - if(state.is(State.menu)){ + if(state.isMenu()){ err("Not playing a map."); return; } diff --git a/settings.gradle b/settings.gradle index a7356fd3c9..141230da76 100644 --- a/settings.gradle +++ b/settings.gradle @@ -29,6 +29,7 @@ if(!hasProperty("release")){ use(':Arc:extensions:arcnet') use(':Arc:extensions:packer') use(':Arc:extensions:g3d') + use(':Arc:extensions:fx') use(':Arc:backends') use(':Arc:backends:backend-sdl') use(':Arc:backends:backend-android')