glob2-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [glob2-devel] quiting (esc vs. cmd+q and alt+f4)


From: Stéphane Magnenat
Subject: Re: [glob2-devel] quiting (esc vs. cmd+q and alt+f4)
Date: Sat, 9 Feb 2008 09:49:34 +0100
User-agent: KMail/1.9.6 (enterprise 0.20070907.709405)

On Saturday 09 February 2008 04:09:12 Kyle Lutze wrote:
> currently esc will quit out of the game at any point. I'm of the
> preference that instead it should bring up the game menu (as most
> games have it) and alt+f4 and cmd+q (under OS X) should quit.
>
> Discuss!
>
>
> Also, anyone know where in the code esc causes the game to quit?
>
> in my local copy of glob2 I put
>
> Uint8 *keystate = SDL_GetKeyState(NULL);
> SDLMod modState = SDL_GetModState();
> if ((modState & KMOD_META) && keystate[SDLK_q])
> {
>      exitGlobCompletely=true;
>      orderQueue.push_back(shared_ptr<Order>(new
> PlayerQuitsGameOrder(localPlayer)));
> }
>
> at around line 1025 in GameGUI.cpp, but it only works while playing
> a game which obviously isn't the desired effect and Bradley doesn't
> know where to put it either.

Indeed, in single player game, the "normal" quit key sequence should display 
the save game dialog, and then return to the main menu. In network, it should 
only display a confirmation. The only direct quit should be sigterm. Even 
there, during a game sigterm should bring up the save game or confirmation 
dialog, and only then quit. A second sigterm in the dialog should quit while 
discarding the current game. If I remember correctly, SIGTERM generates a 
SDL_QUIT event.

Have a nice day.

Steph

-- 
http://stephane.magnenat.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]