added setup option to show level info before game start (yes/no/once)
authorHolger Schemel <holger.schemel@virtion.de>
Wed, 6 Nov 2024 19:28:26 +0000 (20:28 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Wed, 6 Nov 2024 13:19:10 +0000 (14:19 +0100)
src/files.c
src/libgame/setup.c
src/libgame/system.h
src/screens.c

index e73fe2385bd5ccb2fd063e3c9a8f57d0d70c32c0..3844e66477298f89edbf074a92cc4572f11bd221 100644 (file)
@@ -10818,6 +10818,10 @@ static struct TokenInfo global_setup_tokens[] =
     TYPE_SWITCH,
     &setup.show_titlescreen,                   "show_titlescreen"
   },
+  {
+    TYPE_SWITCH_3_STATES,
+    &setup.show_level_story,                   "show_level_story"
+  },
   {
     TYPE_SWITCH,
     &setup.quick_doors,                                "quick_doors"
@@ -11804,6 +11808,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   si->autorecord_after_replay = TRUE;
   si->auto_pause_on_start = FALSE;
   si->show_titlescreen = TRUE;
+  si->show_level_story = STATE_ONCE;
   si->quick_doors = FALSE;
   si->team_mode = FALSE;
   si->handicap = TRUE;
index 94701acb2dade879e564e6358e49be5ab5f18c90..c4be3482e867b23c378ff159e5dbccc879f672bd 100644 (file)
@@ -5354,6 +5354,8 @@ void LoadLevelSetup_SeriesInfo(void)
   {
     LevelStats_setPlayed(i, 0);
     LevelStats_setSolved(i, 0);
+
+    levelset.level_story_shown[i] = FALSE;
   }
 
   checkSeriesInfo();
index 62547122f8715c4813e53aff07105f109d6a4890..b2fc4d62fa0a3af20e9813d7d9b90df7f605284e 100644 (file)
@@ -1500,6 +1500,7 @@ struct SetupInfo
   boolean autorecord_after_replay;
   boolean auto_pause_on_start;
   boolean show_titlescreen;
+  boolean show_level_story;
   boolean quick_doors;
   boolean team_mode;
   boolean handicap;
@@ -1892,6 +1893,8 @@ struct LevelSetInfo
 {
   int music[MAX_LEVELS];
 
+  boolean level_story_shown[MAX_LEVELS];
+
   char *identifier;
   int level_nr;
 };
index 6fb73d900853e543c6143fbfa36c3cc95964efcf..43b3f5a8548be34b0cb8e20d98e98c0cb8c5d7e4 100644 (file)
@@ -4522,6 +4522,12 @@ boolean ShowInfoScreen_FromInitGame(void)
   if (!hasLevelInfo())
     return FALSE;
 
+  if (setup.show_level_story == STATE_FALSE ||
+      (setup.show_level_story == STATE_ONCE && levelset.level_story_shown[level_nr]))
+    return FALSE;
+
+  levelset.level_story_shown[level_nr] = TRUE;
+
   DrawInfoScreen_FromInitGame(INFO_MODE_LEVEL);
 
   return TRUE;
@@ -8309,6 +8315,7 @@ static struct TokenInfo setup_info_graphics[] =
   { TYPE_SWITCH,       &setup.quick_switch,            "Quick Player Focus Switch:"    },
   { TYPE_SWITCH,       &setup.quick_doors,             "Quick Menu Doors:"             },
   { TYPE_SWITCH,       &setup.show_titlescreen,        "Show Title Screens:"           },
+  { TYPE_YES_NO_ONCE,  &setup.show_level_story,        "Show Level Stories:"           },
   { TYPE_SWITCH,       &setup.toons,                   "Show Toons:"                   },
   { TYPE_SWITCH,       &setup.small_game_graphics,     "Small Game Graphics:"          },
   { TYPE_YES_NO_AUTO,  &setup.debug.xsn_mode,          debug_xsn_mode                  },