From: Holger Schemel Date: Wed, 6 Nov 2024 19:28:26 +0000 (+0100) Subject: added setup option to show level info before game start (yes/no/once) X-Git-Tag: 4.4.0.0-test-4~80 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=55747285308e15f6b3d64434b690afe256168d15;p=rocksndiamonds.git added setup option to show level info before game start (yes/no/once) --- diff --git a/src/files.c b/src/files.c index e73fe238..3844e664 100644 --- a/src/files.c +++ b/src/files.c @@ -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; diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 94701acb..c4be3482 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -5354,6 +5354,8 @@ void LoadLevelSetup_SeriesInfo(void) { LevelStats_setPlayed(i, 0); LevelStats_setSolved(i, 0); + + levelset.level_story_shown[i] = FALSE; } checkSeriesInfo(); diff --git a/src/libgame/system.h b/src/libgame/system.h index 62547122..b2fc4d62 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -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; }; diff --git a/src/screens.c b/src/screens.c index 6fb73d90..43b3f5a8 100644 --- a/src/screens.c +++ b/src/screens.c @@ -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 },