Experimental multiplayer pausing variable
This commit is contained in:
@@ -24,7 +24,7 @@ public class BaseDialog extends Dialog{
|
||||
.growX().height(3f).pad(4f);
|
||||
|
||||
hidden(() -> {
|
||||
if(shouldPause && state.isGame()){
|
||||
if(shouldPause && state.isGame() && !net.active()){
|
||||
if(!wasPaused || net.active()){
|
||||
state.set(State.playing);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ public class BaseDialog extends Dialog{
|
||||
});
|
||||
|
||||
shown(() -> {
|
||||
if(shouldPause && state.isGame()){
|
||||
if(shouldPause && state.isGame() && !net.active()){
|
||||
wasPaused = state.is(State.paused);
|
||||
state.set(State.paused);
|
||||
}
|
||||
|
||||
@@ -147,14 +147,14 @@ public class HudFragment{
|
||||
if(net.active()){
|
||||
ui.listfrag.toggle();
|
||||
}else{
|
||||
state.set(state.is(State.paused) ? State.playing : State.paused);
|
||||
state.set(state.isPaused() ? State.playing : State.paused);
|
||||
}
|
||||
}).name("pause").update(i -> {
|
||||
if(net.active()){
|
||||
i.getStyle().imageUp = Icon.players;
|
||||
}else{
|
||||
i.setDisabled(false);
|
||||
i.getStyle().imageUp = state.is(State.paused) ? Icon.play : Icon.pause;
|
||||
i.getStyle().imageUp = state.isPaused() ? Icon.play : Icon.pause;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user