Only unpause after savestate window if the game was not previously paused

This commit is contained in:
Jeffrey Pfau 2014-10-15 23:09:50 -07:00
parent 71458f2140
commit ad37ae3d61
1 changed files with 6 additions and 3 deletions

View File

@ -148,11 +148,14 @@ void Window::gameStopped() {
}
void Window::openStateWindow(LoadSave ls) {
m_controller->setPaused(true);
bool wasPaused = m_controller->isPaused();
LoadSaveState* window = new LoadSaveState(m_controller);
window->setAttribute(Qt::WA_DeleteOnClose);
connect(this, SIGNAL(shutdown()), window, SLOT(hide()));
connect(window, &LoadSaveState::closed, [this]() { m_controller->setPaused(false); });
if (!wasPaused) {
m_controller->setPaused(true);
connect(window, &LoadSaveState::closed, [this]() { m_controller->setPaused(false); });
}
window->setAttribute(Qt::WA_DeleteOnClose);
window->setMode(ls);
window->show();
}