From c7b786cfed072fffbf69bd7ffb7849e8a3b86d04 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Mon, 18 Nov 2024 00:08:47 +0100 Subject: [PATCH] moved code to separate function --- src/screens.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/screens.c b/src/screens.c index 944c7880..c3629605 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1892,11 +1892,9 @@ static void drawChooseTreeEdit(int ypos_raw, boolean active) DrawText(sx, sy, STR_CHOOSE_TREE_EDIT, font_nr); } -static void DrawInfoScreen_Headline(int screen_nr, int num_screens, - int use_global_screens) +static char *getInfoScreenSubtitle(int screen_nr, int num_screens, int use_global_screens) { - char *info_text_title_1 = getInfoScreenTitle_Generic(); - char info_text_title_2[MAX_LINE_LEN + 1]; + static char info_text_title_2[MAX_LINE_LEN + 1]; boolean draw_story_headline = (info_mode == INFO_MODE_STORY && hasLevelStory()); if (num_screens > 1) @@ -1925,6 +1923,15 @@ static void DrawInfoScreen_Headline(int screen_nr, int num_screens, snprintf(info_text_title_2, max_text_len, text_format, name_cut); } + return info_text_title_2; +} + +static void DrawInfoScreen_Headline(int screen_nr, int num_screens, int use_global_screens) +{ + char *info_text_title_1 = getInfoScreenTitle_Generic(); + char *info_text_title_2 = getInfoScreenSubtitle(screen_nr, num_screens, use_global_screens); + boolean draw_story_headline = (info_mode == INFO_MODE_STORY && hasLevelStory()); + if (draw_story_headline) { DrawTextSCentered(MENU_TITLE_STORY_YPOS, FONT_TITLE_STORY, info_text_title_2); -- 2.34.1