Changed implementation to check if menu is open instead of pressing escape key
@@ -72,14 +72,13 @@ public void onTogglePause(PauseButton event, EntityRef entity) {
nuiManager.toggleScreen("engine:pauseMenu");
event.consume();
}
- if ((event.getState() == ButtonState.DOWN) || (event.getState() == ButtonState.UP))
+ if(getPlayerCount()==1)
{
- if(getPlayerCount()==1) {
- if (!time.isPaused()) {
+ if(nuiManager.isOpen("engine:pauseMenu")) {
time.setPaused(true);
- } else {
- time.setPaused(false);
}
+ else{
+ time.setPaused(false);
}
}
}
