mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-12 03:37:27 +07:00
Removed outOfTime pause
This commit is contained in:
parent
f3c642d0d7
commit
54c991e611
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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();
|
||||
|
@ -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 -> {
|
||||
|
Loading…
Reference in New Issue
Block a user