From: Tobias Gläßer Date: Thu, 25 Dec 2003 13:13:16 +0000 (+0000) Subject: first item in menu is highlighted by default now. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=097f2a52856c4505466487b0e96f71a2ee87827a;p=supertux.git first item in menu is highlighted by default now. SVN-Revision: 43 --- diff --git a/src/gameloop.c b/src/gameloop.c index ff8c6caab..56aad9ca4 100644 --- a/src/gameloop.c +++ b/src/gameloop.c @@ -176,6 +176,10 @@ void game_event(void) key = event.key.keysym.sym; + /* Check for menu-events, if the menu is shown */ + if(show_menu) + menu_event(key); + if (key == SDLK_ESCAPE) { /* Escape: Open/Close the menu: */ @@ -214,10 +218,6 @@ void game_event(void) key = event.key.keysym.sym; - /* Check for menu-events, if the menu is shown */ - if(show_menu) - menu_event(key); - if (key == SDLK_RIGHT) { right = UP; diff --git a/src/menu.c b/src/menu.c index 0ca85d040..d86e79e80 100644 --- a/src/menu.c +++ b/src/menu.c @@ -29,7 +29,7 @@ void initmenu(void) { menu_change = NO; show_menu = NO; - menuitem = -1; + menuitem = 0; menumenu = 0; menuaction = -1; } diff --git a/src/title.c b/src/title.c index 28aa3efc0..3525127f6 100644 --- a/src/title.c +++ b/src/title.c @@ -97,6 +97,9 @@ int title(void) key = event.key.keysym.sym; + /* Check for menu events */ + menu_event(key); + if (key == SDLK_ESCAPE) { /* Escape: Quit: */ @@ -104,12 +107,6 @@ int title(void) quit = 1; } } - else if (event.type == SDL_KEYUP) - { - key = event.key.keysym.sym; - /* Check for menu events */ - menu_event(key); - } #ifdef JOY_YES else if (event.type == SDL_JOYAXISMOTION) {