From: Holger Schemel Date: Sat, 3 Dec 2022 12:37:27 +0000 (+0100) Subject: added shortcuts to invoke info screens from main menu (disabled by default) X-Git-Tag: 4.3.3.0~5 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2172e3db6e6906608167876feea01eb449ed255a;p=rocksndiamonds.git added shortcuts to invoke info screens from main menu (disabled by default) --- diff --git a/src/events.c b/src/events.c index 39a1e4e9..02378a71 100644 --- a/src/events.c +++ b/src/events.c @@ -2281,6 +2281,15 @@ void HandleKey(Key key, int key_status) return; } + if (game_status == GAME_MODE_MAIN && + setup.internal.info_screens_from_main && + (key >= KSYM_KP_1 && key <= KSYM_KP_9)) + { + DrawInfoScreen_FromMainMenu(key - KSYM_KP_1 + 1); + + return; + } + if (game_status == GAME_MODE_MAIN || game_status == GAME_MODE_PLAYING) { if (key == setup.shortcut.save_game) diff --git a/src/files.c b/src/files.c index cd275d56..3f1b200e 100644 --- a/src/files.c +++ b/src/files.c @@ -10115,6 +10115,10 @@ static struct TokenInfo internal_setup_tokens[] = TYPE_BOOLEAN, &setup.internal.create_user_levelset, "create_user_levelset" }, + { + TYPE_BOOLEAN, + &setup.internal.info_screens_from_main, "info_screens_from_main" + }, { TYPE_BOOLEAN, &setup.internal.menu_game, "menu_game" @@ -10557,6 +10561,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->internal.choose_from_top_leveldir = FALSE; si->internal.show_scaling_in_title = TRUE; si->internal.create_user_levelset = TRUE; + si->internal.info_screens_from_main = FALSE; si->internal.default_window_width = WIN_XSIZE_DEFAULT; si->internal.default_window_height = WIN_YSIZE_DEFAULT; diff --git a/src/libgame/system.h b/src/libgame/system.h index 3378be4f..1c5104be 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1451,6 +1451,7 @@ struct SetupInternalInfo boolean choose_from_top_leveldir; boolean show_scaling_in_title; boolean create_user_levelset; + boolean info_screens_from_main; boolean menu_game; boolean menu_engines; diff --git a/src/screens.c b/src/screens.c index dbbdf0c9..394f5292 100644 --- a/src/screens.c +++ b/src/screens.c @@ -3846,6 +3846,22 @@ static void DrawInfoScreen(void) PlayMenuSoundsAndMusic(); } +void DrawInfoScreen_FromMainMenu(int nr) +{ + if (nr < INFO_MODE_MAIN || nr >= MAX_INFO_MODES) + return; + + CloseDoor(DOOR_CLOSE_2); + + SetGameStatus(GAME_MODE_INFO); + + info_mode = nr;; + + FadeSetEnterScreen(); + + DrawInfoScreen(); +} + void HandleInfoScreen(int mx, int my, int dx, int dy, int button) { if (info_mode == INFO_MODE_TITLE) diff --git a/src/screens.h b/src/screens.h index 8aa481f9..deba425c 100644 --- a/src/screens.h +++ b/src/screens.h @@ -24,6 +24,7 @@ void DrawAndFadeInMainMenu(int); void DrawMainMenu(void); void DrawHallOfFame(int); void DrawScreenAfterAddingSet(char *, int); +void DrawInfoScreen_FromMainMenu(int); void RedrawSetupScreenAfterFullscreenToggle(void); void RedrawSetupScreenAfterScreenRotation(int);