From: Holger Schemel Date: Wed, 11 May 2022 12:04:59 +0000 (+0200) Subject: added special mode to continue from hall of fame when pressing "space" key X-Git-Tag: 4.3.2.2~26 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=d522e996ec9a28cd01c056764799996a4ac5474e;p=rocksndiamonds.git added special mode to continue from hall of fame when pressing "space" key --- diff --git a/src/events.c b/src/events.c index d5f9963b..7a6ff377 100644 --- a/src/events.c +++ b/src/events.c @@ -2335,6 +2335,14 @@ void HandleKey(Key key, int key_status) if (HandleGadgetsKeyInput(key)) return; // do not handle already processed keys again + // special case: on "space" key, either continue playing or go to main menu + if (game_status == GAME_MODE_SCORES && key == KSYM_space) + { + HandleHallOfFame(0, 0, 0, 0, MB_MENU_CONTINUE); + + return; + } + switch (game_status) { case GAME_MODE_PSEUDO_TYPENAME: diff --git a/src/libgame/system.h b/src/libgame/system.h index 30ef7d79..60a2d7cc 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -240,6 +240,7 @@ #define MB_MENU_MARK TRUE #define MB_MENU_INITIALIZE (-1) #define MB_MENU_LEAVE (-2) +#define MB_MENU_CONTINUE (-3) #define MB_LEFTBUTTON 1 #define MB_MIDDLEBUTTON 2 #define MB_RIGHTBUTTON 3 diff --git a/src/screens.c b/src/screens.c index 58a9afae..326fa677 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4912,14 +4912,14 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, return; } } - else if (dx == -1 && ti->node_parent) + else if ((dx == -1 || button == MB_MENU_CONTINUE) && ti->node_parent) { - FadeSetLeaveMenu(); + if (game_status != GAME_MODE_SCORES) + FadeSetLeaveMenu(); PlaySound(SND_MENU_ITEM_SELECTING); *ti_ptr = ti->node_parent; - DrawChooseTree(ti_ptr); return;