From 712dd032cb29eeb0742ac39aa56fe491f1a98a06 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sun, 11 Dec 2022 14:49:25 +0100 Subject: [PATCH] added level info config option to invoke info screens from main menu This is a special config option to allow level sets (like the Mirror Magic level set "classic_mindbender") to directly invoke info screens from the main menu (which is used for "classic_mindbender" to display the included title story on the "level set info" screens by clicking on a global animation that looks like a book that can be opened). --- src/events.c | 3 ++- src/libgame/setup.c | 9 +++++++-- src/libgame/system.h | 1 + 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/events.c b/src/events.c index 02378a71..21d9b5a3 100644 --- a/src/events.c +++ b/src/events.c @@ -2282,7 +2282,8 @@ void HandleKey(Key key, int key_status) } if (game_status == GAME_MODE_MAIN && - setup.internal.info_screens_from_main && + (setup.internal.info_screens_from_main || + leveldir_current->info_screens_from_main) && (key >= KSYM_KP_1 && key <= KSYM_KP_9)) { DrawInfoScreen_FromMainMenu(key - KSYM_KP_1 + 1); diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 0cad9d8c..e2405996 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -2741,8 +2741,9 @@ SetupFileHash *loadSetupFileHash(char *filename) #define LEVELINFO_TOKEN_TIME_LIMIT 30 #define LEVELINFO_TOKEN_SKIP_LEVELS 31 #define LEVELINFO_TOKEN_USE_EMC_TILES 32 +#define LEVELINFO_TOKEN_INFO_SCREENS_FROM_MAIN 33 -#define NUM_LEVELINFO_TOKENS 33 +#define NUM_LEVELINFO_TOKENS 34 static LevelDirTree ldi; @@ -2781,7 +2782,8 @@ static struct TokenInfo levelinfo_tokens[] = { TYPE_BOOLEAN, &ldi.handicap, "handicap" }, { TYPE_BOOLEAN, &ldi.time_limit, "time_limit" }, { TYPE_BOOLEAN, &ldi.skip_levels, "skip_levels" }, - { TYPE_BOOLEAN, &ldi.use_emc_tiles, "use_emc_tiles" } + { TYPE_BOOLEAN, &ldi.use_emc_tiles, "use_emc_tiles" }, + { TYPE_BOOLEAN, &ldi.info_screens_from_main, "info_screens_from_main" } }; static struct TokenInfo artworkinfo_tokens[] = @@ -2890,6 +2892,7 @@ static void setTreeInfoToDefaults(TreeInfo *ti, int type) ti->skip_levels = FALSE; ti->use_emc_tiles = FALSE; + ti->info_screens_from_main = FALSE; } } @@ -2976,6 +2979,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent) ti->skip_levels = parent->skip_levels; ti->use_emc_tiles = parent->use_emc_tiles; + ti->info_screens_from_main = parent->info_screens_from_main; } } @@ -3049,6 +3053,7 @@ static TreeInfo *getTreeInfoCopy(TreeInfo *ti) ti_copy->skip_levels = ti->skip_levels; ti_copy->use_emc_tiles = ti->use_emc_tiles; + ti_copy->info_screens_from_main = ti->info_screens_from_main; ti_copy->color = ti->color; ti_copy->class_desc = getStringCopy(ti->class_desc); diff --git a/src/libgame/system.h b/src/libgame/system.h index 1c5104be..524dbc58 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -1660,6 +1660,7 @@ struct TreeInfo boolean skip_levels; // levels can be skipped when set to "true" boolean use_emc_tiles;// use (swapped) V5/V6 EMC tiles when set to "true" + boolean info_screens_from_main; // can invoke info screens from main menu int color; // color to use on selection screen for this level char *class_desc; // description of level series class -- 2.34.1