[Scummvm-devel] back to the launcher!
Johannes Schickel
lordhoto at gmail.com
Mon Feb 23 22:20:02 CET 2009
Johannes Schickel schrieb:
> sunmax at libero.it schrieb:
>> Is there an official way to return to GUI Launcher when
>> we quit a game, instead of quitting ScummVM tout court ?
>
> We have a GMM (gobal main menu) now, which can be used to return to
> the launcher from within games. It can be opened via CTRL + F5, at
> least with default event manager code.
>
> For the code opening it check out
> "backends/events/default/default-events.cpp" ll 439-569.
>
I just took a slight deeper look in the code, you might also want to
check out the documentation for "EventManager" in "common/events.h".
Another thing is it seems you can open the GMM via a EVENT_MAINMENU
event too, at least with our DefaultEventManager.
There is a function EventManger::shouldRTL, which is used to indicate
whether a game should return to the launcher or not. I just made a
simple hack and always let DefaultEventManager::shouldRTL return true if
"_shouldQuit" is set and it always returned to the launcher for me when
I wanted to quit ScummVM via ingame functionallity, with KYRA that is at
least.
I guess overall you might want to think of implementing your own
EventManager or simply subclass DefaultEventManager and change
"shouldRTL" behavior so the games return to the launcher if possible. I
am not quite sure if it is that easy though, I know that engines usually
have set "Engine::kSupportsRTL" when they support RTL, but on the other
hand I don't know where the RTL is really processed/checked, thus if
that flag is honored with a faked EventManger::shouldRTL to always try
returning to the launcher. Someone might want to comment on that.
// Johannes
More information about the Scummvm-devel
mailing list