diff --git a/core/src/mindustry/content/Liquids.java b/core/src/mindustry/content/Liquids.java index 5baaa2d537..0f95a02685 100644 --- a/core/src/mindustry/content/Liquids.java +++ b/core/src/mindustry/content/Liquids.java @@ -73,7 +73,6 @@ public class Liquids{ hidden = true; }}; - //TODO reactivity, etc ozone = new Liquid("ozone", Color.valueOf("fc81dd")){{ gas = true; barColor = Color.valueOf("d699f0"); @@ -81,7 +80,6 @@ public class Liquids{ flammability = 1f; }}; - //TODO combustion hydrogen = new Liquid("hydrogen", Color.valueOf("9eabf7")){{ gas = true; flammability = 1f; diff --git a/core/src/mindustry/game/EventType.java b/core/src/mindustry/game/EventType.java index 69eed5aaf6..52464b8839 100644 --- a/core/src/mindustry/game/EventType.java +++ b/core/src/mindustry/game/EventType.java @@ -16,6 +16,7 @@ public class EventType{ //events that occur very often public enum Trigger{ shock, + openConsole, blastFreeze, impactPower, blastGenerator, diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index 12c60ca09e..ee7989711f 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -205,9 +205,7 @@ public class Saves{ } public void save(){ - long time = totalPlaytime; long prev = totalPlaytime; - totalPlaytime = time; SaveIO.save(file); meta = SaveIO.getMeta(file); diff --git a/core/src/mindustry/service/GameService.java b/core/src/mindustry/service/GameService.java index 0ac9097a5d..e6ea7d9db3 100644 --- a/core/src/mindustry/service/GameService.java +++ b/core/src/mindustry/service/GameService.java @@ -117,6 +117,8 @@ public class GameService{ captureAllSectors.complete(); } + Events.run(Trigger.openConsole, () -> openConsole.complete()); + Events.run(Trigger.unitCommandAttack, () -> { if(campaign()){ issueAttackCommand.complete(); @@ -534,10 +536,6 @@ public class GameService{ } } } - - if(ui.consolefrag.shown()){ - openConsole.complete(); - } } private void save(){ diff --git a/core/src/mindustry/ui/fragments/ConsoleFragment.java b/core/src/mindustry/ui/fragments/ConsoleFragment.java index ad5a33f068..46d9be409c 100644 --- a/core/src/mindustry/ui/fragments/ConsoleFragment.java +++ b/core/src/mindustry/ui/fragments/ConsoleFragment.java @@ -12,6 +12,7 @@ import arc.scene.ui.TextField.*; import arc.scene.ui.layout.*; import arc.struct.*; import arc.util.*; +import mindustry.game.EventType.*; import mindustry.input.*; import mindustry.ui.*; @@ -175,6 +176,7 @@ public class ConsoleFragment extends Table{ public void toggle(){ if(!open){ + Events.fire(Trigger.openConsole); scene.setKeyboardFocus(chatfield); open = !open; if(mobile){