From 03521cddc350006392fe8cea697040d6552363a7 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 9 Nov 2024 16:24:28 +0100 Subject: [PATCH] added separate title font for showing story before starting the game --- src/conf_gfx.c | 8 +++++++- src/main.c | 1 + src/main.h | 2 ++ src/screens.c | 12 ++++++++++-- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/conf_gfx.c b/src/conf_gfx.c index da47a80d..a580c3cb 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -7776,7 +7776,8 @@ struct ConfigInfo image_config[] = { "font.title_2.height", "14" }, { "font.title_2.SETUP", UNDEFINED_FILENAME }, { "font.title_2.SETUP.clone_from", "font.text_2" }, - + { "font.title_story", UNDEFINED_FILENAME }, + { "font.title_story.clone_from", "font.text_1.LEVELS" }, { "font.footer", UNDEFINED_FILENAME }, { "font.footer.clone_from", "font.text_4" }, { "font.footer.INFO", UNDEFINED_FILENAME }, @@ -9432,6 +9433,11 @@ struct ConfigInfo image_config[] = { "menu.text.title_2.align", "center" }, { "menu.text.title_2.valign", "top" }, { "menu.text.title_2.font", "font.title_2" }, + { "menu.text.title_story.x", "-1" }, + { "menu.text.title_story.y", "32" }, + { "menu.text.title_story.align", "center" }, + { "menu.text.title_story.valign", "top" }, + { "menu.text.title_story.font", "font.title_story" }, { "menu.text.footer.x", "-1" }, { "menu.text.footer.y", "-8" }, { "menu.text.footer.align", "center" }, diff --git a/src/main.c b/src/main.c index 725a98d4..4c7e2e4b 100644 --- a/src/main.c +++ b/src/main.c @@ -9341,6 +9341,7 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.initial_4" }, { "font.title_1" }, { "font.title_2" }, + { "font.title_story" }, { "font.footer" }, { "font.menu_1.active" }, { "font.menu_2.active" }, diff --git a/src/main.h b/src/main.h index 82d91550..3b22f255 100644 --- a/src/main.h +++ b/src/main.h @@ -2996,6 +2996,7 @@ enum FONT_INITIAL_4 = MAIN_FONT_INITIAL_4, FONT_TITLE_1, FONT_TITLE_2, + FONT_TITLE_STORY, FONT_FOOTER, FONT_MENU_1_ACTIVE, FONT_MENU_2_ACTIVE, @@ -3249,6 +3250,7 @@ struct MenuTextInfo struct TextPosInfo title; struct TextPosInfo title_1; struct TextPosInfo title_2; + struct TextPosInfo title_story; struct TextPosInfo footer; }; diff --git a/src/screens.c b/src/screens.c index 3f55035d..779e7b31 100644 --- a/src/screens.c +++ b/src/screens.c @@ -186,6 +186,7 @@ #define MENU_TITLE_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.title) #define MENU_TITLE1_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.title_1) #define MENU_TITLE2_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.title_2) +#define MENU_TITLE_STORY_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.title_story) #define MENU_FOOTER_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.footer) #define MENU_INFO_FONT_TITLE FONT_TEXT_1 #define MENU_INFO_FONT_HEAD FONT_TEXT_2 @@ -1772,8 +1773,15 @@ static void DrawInfoScreen_Headline(int screen_nr, int num_screens, snprintf(info_text_title_2, max_text_len, text_format, name_cut); } - DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, info_text_title_1); - DrawTextSCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, info_text_title_2); + if (info_mode == INFO_MODE_STORY) + { + DrawTextSCentered(MENU_TITLE_STORY_YPOS, FONT_TITLE_STORY, info_text_title_2); + } + else + { + DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, info_text_title_1); + DrawTextSCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, info_text_title_2); + } } static void DrawTitleScreenImage(int nr, boolean initial) -- 2.34.1