Removed outOfTime pause
This commit is contained in:
@@ -519,7 +519,7 @@ public class Control implements ApplicationListener, Loadable{
|
|||||||
platform.updateRPC();
|
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);
|
state.set(state.is(State.playing) ? State.paused : State.playing);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,6 @@ public class GameState{
|
|||||||
return rules.sector != null;
|
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(){
|
public boolean hasSector(){
|
||||||
return rules.sector != null;
|
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);
|
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.isPaused()){
|
||||||
if(state.isCampaign()){
|
if(state.isCampaign()){
|
||||||
state.secinfo.update();
|
state.secinfo.update();
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class HudFragment extends Fragment{
|
|||||||
|
|
||||||
//paused table
|
//paused table
|
||||||
parent.fill(t -> {
|
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();
|
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
|
//paused table for when the player is out of time
|
||||||
parent.fill(t -> {
|
parent.fill(t -> {
|
||||||
t.top().visible(() -> state.isOutOfTime());
|
t.top().visible(() -> false);
|
||||||
t.table(Styles.black5, top -> {
|
t.table(Styles.black5, top -> {
|
||||||
//TODO localize
|
//TODO localize
|
||||||
top.add(sectorText).style(Styles.outlineLabel).color(Pal.accent).update(l -> {
|
top.add(sectorText).style(Styles.outlineLabel).color(Pal.accent).update(l -> {
|
||||||
|
|||||||
Reference in New Issue
Block a user