From 54c991e6115c89913e4186706bba82da4e6a1d78 Mon Sep 17 00:00:00 2001 From: Anuken Date: Wed, 30 Sep 2020 22:25:28 -0400 Subject: [PATCH] Removed outOfTime pause --- core/src/mindustry/core/Control.java | 2 +- core/src/mindustry/core/GameState.java | 5 ----- core/src/mindustry/core/Logic.java | 12 ------------ core/src/mindustry/ui/fragments/HudFragment.java | 4 ++-- 4 files changed, 3 insertions(+), 20 deletions(-) diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 64bbd4bc5d..82cb6e3ad0 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -519,7 +519,7 @@ public class Control implements ApplicationListener, Loadable{ platform.updateRPC(); } - if(Core.input.keyTap(Binding.pause) && !state.isOutOfTime() && !scene.hasDialog() && !scene.hasKeyboard() && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){ + if(Core.input.keyTap(Binding.pause) && !scene.hasDialog() && !scene.hasKeyboard() && !ui.restart.isShown() && (state.is(State.paused) || state.is(State.playing))){ state.set(state.is(State.playing) ? State.paused : State.playing); } diff --git a/core/src/mindustry/core/GameState.java b/core/src/mindustry/core/GameState.java index 84b408b135..95ebd1dc36 100644 --- a/core/src/mindustry/core/GameState.java +++ b/core/src/mindustry/core/GameState.java @@ -50,11 +50,6 @@ public class GameState{ return rules.sector != null; } - /** @return whether the player is in a campaign and they are out of sector time */ - public boolean isOutOfTime(){ - return isCampaign() && isGame() && getSector().getTimeSpent() >= turnDuration && !net.active(); - } - public boolean hasSector(){ return rules.sector != null; } diff --git a/core/src/mindustry/core/Logic.java b/core/src/mindustry/core/Logic.java index 2d9bf18c49..e03771843a 100644 --- a/core/src/mindustry/core/Logic.java +++ b/core/src/mindustry/core/Logic.java @@ -282,18 +282,6 @@ public class Logic implements ApplicationListener{ state.enemies = Groups.unit.count(u -> u.team() == state.rules.waveTeam && u.type().isCounted); } - //force pausing when the player is out of sector time - if(state.isOutOfTime()){ - if(!state.wasTimeout){ - universe.displayTimeEnd(); - state.wasTimeout = true; - } - //if no turn was run. - if(state.isOutOfTime()){ - state.set(State.paused); - } - } - if(!state.isPaused()){ if(state.isCampaign()){ state.secinfo.update(); diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index 0b1e40b4ea..545eb103af 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -70,7 +70,7 @@ public class HudFragment extends Fragment{ //paused table parent.fill(t -> { - t.top().visible(() -> state.isPaused() && !state.isOutOfTime()).touchable = Touchable.disabled; + t.top().visible(() -> state.isPaused()).touchable = Touchable.disabled; t.table(Styles.black5, top -> top.add("@paused").style(Styles.outlineLabel).pad(8f)).growX(); }); @@ -275,7 +275,7 @@ public class HudFragment extends Fragment{ //paused table for when the player is out of time parent.fill(t -> { - t.top().visible(() -> state.isOutOfTime()); + t.top().visible(() -> false); t.table(Styles.black5, top -> { //TODO localize top.add(sectorText).style(Styles.outlineLabel).color(Pal.accent).update(l -> {