GUI: Add exitLoop() method to GuiManager

The idea is to allow backends to start a game even after the
LauncherDialog has been created, and for that they need a way
to close the existing GUI dialogs.
This commit is contained in:
Thierry Crozat 2020-09-06 06:01:06 +01:00
parent 5e888a601e
commit 32bbf489e9
2 changed files with 10 additions and 0 deletions

View File

@ -449,6 +449,11 @@ void GuiManager::runLoop() {
#endif
}
void GuiManager::exitLoop() {
while (!_dialogStack.empty())
getTopDialog()->close();
}
#pragma mark -
void GuiManager::saveState() {

View File

@ -75,6 +75,11 @@ public:
// until no dialogs are active anymore.
void runLoop();
// If the GUI loop is running close all the dialogs causing the loop to finish.
// Typically you may want to use it after setting the ConfMan active domain to
// a game domain to cause the game to start.
void exitLoop();
void processEvent(const Common::Event &event, Dialog *const activeDialog);
Common::Keymap *getKeymap() const;
void scheduleTopDialogRedraw();