added shortcuts to invoke info screens from main menu (disabled by default)
authorHolger Schemel <info@artsoft.org>
Sat, 3 Dec 2022 12:37:27 +0000 (13:37 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 3 Dec 2022 12:37:27 +0000 (13:37 +0100)
src/events.c
src/files.c
src/libgame/system.h
src/screens.c
src/screens.h

index 39a1e4e928b4ebe1b930742b6ed9b54496ac17f7..02378a71bd180f1423d82b33d0bdd3ad573bdc80 100644 (file)
@@ -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)
index cd275d560769fbbfbb5552fbbef7d14bec1765a6..3f1b200e693e8f3e83d3a43466dc1b2dd0786f8c 100644 (file)
@@ -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;
index 3378be4fff2b389d20d213c9e5d6ee2e3e15eb67..1c5104be52deafcf5a3e506b400645e1afce2fdd 100644 (file)
@@ -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;
index dbbdf0c9d6344e4795ab7032af987ccda8605871..394f52927f2b40a1c66251e8890a6ff367f87b89 100644 (file)
@@ -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)
index 8aa481f991d0e255a0feed6bbc85be53455852ad..deba425c28ef73df7ab8fa1ed94e0fc19841d7e5 100644 (file)
@@ -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);