mirror of https://github.com/mgba-emu/mgba.git
Pause game while savestate window is open
This commit is contained in:
parent
0579ececb3
commit
cd8b1e56db
|
@ -107,3 +107,8 @@ void LoadSaveState::triggerState(int slot) {
|
|||
GBAThreadContinue(thread);
|
||||
close();
|
||||
}
|
||||
|
||||
void LoadSaveState::closeEvent(QCloseEvent* event) {
|
||||
emit closed();
|
||||
QWidget::closeEvent(event);
|
||||
}
|
||||
|
|
|
@ -25,8 +25,12 @@ public:
|
|||
|
||||
void setMode(LoadSave mode);
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
protected:
|
||||
virtual bool eventFilter(QObject*, QEvent*) override;
|
||||
virtual void closeEvent(QCloseEvent*) override;
|
||||
|
||||
private:
|
||||
void loadState(int slot);
|
||||
|
|
|
@ -148,9 +148,11 @@ void Window::gameStopped() {
|
|||
}
|
||||
|
||||
void Window::openStateWindow(LoadSave ls) {
|
||||
m_controller->setPaused(true);
|
||||
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); });
|
||||
window->setMode(ls);
|
||||
window->show();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue