In non network games the game is paused automatically if a menu/message is raised. I am not sure if I should do this for scenario messages too?
This commit is contained in:
parent
3d386936dc
commit
874b1a5049
|
@ -1849,7 +1849,7 @@ void Game::mouseDownLeft(int x, int y) {
|
|||
}
|
||||
|
||||
if(allowAdminMenuItems) {
|
||||
if(paused == false) {
|
||||
if(getPaused() == false) {
|
||||
commander.tryPauseGame();
|
||||
}
|
||||
else {
|
||||
|
@ -2460,7 +2460,7 @@ void Game::keyDown(SDL_KeyboardEvent key) {
|
|||
}
|
||||
|
||||
if(allowAdminMenuItems) {
|
||||
if(paused == false) {
|
||||
if(getPaused() == false) {
|
||||
commander.tryPauseGame();
|
||||
}
|
||||
else {
|
||||
|
@ -3438,12 +3438,29 @@ void Game::setPaused(bool value,bool forceAllowPauseStateChange) {
|
|||
}
|
||||
}
|
||||
|
||||
bool Game::getPaused()
|
||||
{
|
||||
bool speedChangesAllowed= !NetworkManager::getInstance().isNetworkGame();
|
||||
if(speedChangesAllowed){
|
||||
if(popupMenu.getVisible() == true || popupMenuSwitchTeams.getVisible() == true){
|
||||
return true;
|
||||
}
|
||||
if(mainMessageBox.getEnabled() == true || errorMessageBox.getEnabled() == true){
|
||||
return true;
|
||||
}
|
||||
if(currentUIState != NULL) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return paused;
|
||||
}
|
||||
|
||||
int Game::getUpdateLoops() {
|
||||
if(commander.hasReplayCommandListForFrame() == true) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(paused) {
|
||||
if(getPaused()) {
|
||||
return 0;
|
||||
}
|
||||
else if(speed == sFast) {
|
||||
|
|
|
@ -177,7 +177,7 @@ public:
|
|||
|
||||
Program *getProgram() {return program;}
|
||||
|
||||
bool getPaused() const { return paused;}
|
||||
bool getPaused();
|
||||
void setPaused(bool value, bool forceAllowPauseStateChange=false);
|
||||
const int getTotalRenderFps() const {return totalRenderFps;}
|
||||
|
||||
|
|
Loading…
Reference in New Issue