From e413d93b2f1b82efe2ce1440c89dfe28f58daa17 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Tue, 5 Nov 2024 19:47:26 +0100 Subject: [PATCH] added support for space key to show next generic info screen page --- src/events.c | 2 +- src/screens.c | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/events.c b/src/events.c index 99b55fc8..d4a612ed 100644 --- a/src/events.c +++ b/src/events.c @@ -2467,7 +2467,7 @@ void HandleKey(Key key, int key_status) else if (game_status == GAME_MODE_SETUP) HandleSetupScreen(0, 0, 0, 0, MB_MENU_CHOICE); else if (game_status == GAME_MODE_INFO) - HandleInfoScreen(0, 0, 0, 0, MB_MENU_CHOICE); + HandleInfoScreen(0, 0, 0, 0, (key == KSYM_space ? MB_MENU_CONTINUE : MB_MENU_CHOICE)); else if (game_status == GAME_MODE_SCORES) HandleHallOfFame(0, 0, 0, 0, MB_MENU_CHOICE); else if (game_status == GAME_MODE_SCOREINFO) diff --git a/src/screens.c b/src/screens.c index 9fcd0d3a..1a6ae83a 100644 --- a/src/screens.c +++ b/src/screens.c @@ -4367,6 +4367,16 @@ void HandleInfoScreen_Generic(int mx, int my, int dx, int dy, int button) info_mode = INFO_MODE_MAIN; DrawInfoScreen(); } + else if (button == MB_MENU_CONTINUE) + { + // if space key was pressed, show next page of info screen, if available + if (wrapped_text->line_visible_last < wrapped_text->num_lines - 1) + HandleInfoScreen(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK); + else + HandleInfoScreen(0, 0, 0, 0, MB_MENU_CHOICE); + + return; + } else if ((mx >= 0 && my >= 0 && button == MB_MENU_CHOICE) || dx) { PlaySound(SND_MENU_ITEM_SELECTING); @@ -4517,6 +4527,13 @@ boolean ShowInfoScreen_FromInitGame(void) void HandleInfoScreen(int mx, int my, int dx, int dy, int button) { + // fix "continue" button mode for screens that do not support it + if (button == MB_MENU_CONTINUE && (info_mode != INFO_MODE_CREDITS && + info_mode != INFO_MODE_PROGRAM && + info_mode != INFO_MODE_LEVELSET && + info_mode != INFO_MODE_LEVEL)) + button = MB_MENU_CHOICE; + if (info_mode == INFO_MODE_TITLE) HandleInfoScreen_TitleScreen(dx, dy, button); else if (info_mode == INFO_MODE_ELEMENTS) -- 2.34.1