From: Holger Schemel Date: Sun, 3 Nov 2024 19:58:49 +0000 (+0100) Subject: added configuration options for (single) menu title text position X-Git-Tag: 4.4.0.0-test-4~90 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=565013bbec865d5fc1aadb81be7da76411f780ed;p=rocksndiamonds.git added configuration options for (single) menu title text position --- diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 221f7618..a7ab2836 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -9402,6 +9402,11 @@ struct ConfigInfo image_config[] = { "menu.extra_spacing.INFO[LEVEL]", "2" }, { "menu.extra_spacing.SETUP[INPUT]", "2" }, + { "menu.text.title.x", "-1" }, + { "menu.text.title.y", "16" }, + { "menu.text.title.align", "center" }, + { "menu.text.title.valign", "top" }, + { "menu.text.title.font", "font.title_1" }, { "menu.text.title_1.x", "-1" }, { "menu.text.title_1.y", "8" }, { "menu.text.title_1.align", "center" }, diff --git a/src/main.h b/src/main.h index 66714e62..b4b5eeaf 100644 --- a/src/main.h +++ b/src/main.h @@ -3244,6 +3244,7 @@ struct RequestButtonInfo struct MenuTextInfo { + struct TextPosInfo title; struct TextPosInfo title_1; struct TextPosInfo title_2; struct TextPosInfo footer; diff --git a/src/screens.c b/src/screens.c index 78f091ea..28694800 100644 --- a/src/screens.c +++ b/src/screens.c @@ -180,6 +180,7 @@ #define MENU_SCREEN_VALUE_XPOS (SCR_FIELDX - 3) #define MENU_SCREEN_TEXT2_XPOS (SCR_FIELDX - 2) #define MENU_SCREEN_MAX_XPOS (SCR_FIELDX - 1) +#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_FOOTER_YPOS MENU_TEXT_ALIGNED_YPOS(menu.text.footer) @@ -2921,7 +2922,7 @@ static void DrawInfoScreen_Main(void) OpenDoor(GetDoorState() | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, STR_INFO_MAIN); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, STR_INFO_MAIN); info_info = info_info_main; @@ -5000,7 +5001,7 @@ static void drawChooseTreeText(TreeInfo *ti, int y, boolean active) static void drawChooseTreeHeadExt(int type, char *title_string) { int yoffset_sets = MENU_TITLE1_YPOS; - int yoffset_setup = 16; + int yoffset_setup = MENU_TITLE_YPOS; int yoffset = (type == TREE_TYPE_SCORE_ENTRY || type == TREE_TYPE_LEVEL_DIR || type == TREE_TYPE_LEVEL_NR ? yoffset_sets : yoffset_setup); @@ -7837,7 +7838,7 @@ static void ToggleNetworkModeIfNeeded(void) { int font_title = FONT_TITLE_1; int font_foot = FC_BLUE; - int ystart = mSY - SY + 16; + int ystart = mSY - SY + MENU_TITLE_YPOS; int yfooter = mSY - SY + MENU_FOOTER_YPOS; char *text = (setup.network_mode ? "Start Network" : "Stop Network"); @@ -8925,7 +8926,7 @@ static void DrawSetupScreen_Generic(void) // use modified setup info without setup entries marked as hidden setup_info = getSetupInfoFinal(setup_info); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, title_string); // determine maximal number of setup entries that can be displayed on screen num_setup_info = 0; @@ -8967,7 +8968,7 @@ static void DrawSetupScreen_Input(void) setup_info = getSetupInfoFinal(setup_info_input); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, STR_SETUP_INPUT); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, STR_SETUP_INPUT); for (i = 0; setup_info[i].type != 0; i++) { @@ -9298,7 +9299,7 @@ static boolean CustomizeKeyboardMain(int player_nr) ClearField(); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Keyboard Input"); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, "Keyboard Input"); step_nr = 0; DrawText(mSX, mSY + (2 + 2 * step_nr) * 32, @@ -9937,7 +9938,7 @@ static boolean ConfigureVirtualButtonsMain(void) ClearField(); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Virtual Buttons"); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, "Virtual Buttons"); DrawTextSCentered(ypos1, font_nr, "Select tiles to"); DrawTextSCentered(ypos2, font_nr, customize_step_text[step_nr]); @@ -10133,7 +10134,7 @@ static boolean ConfigureVirtualButtonsMain(void) ClearField(); - DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Virtual Buttons"); + DrawTextSCentered(mSY - SY + MENU_TITLE_YPOS, FONT_TITLE_1, "Virtual Buttons"); DrawTextSCentered(ypos1, font_nr, "Select tiles to"); DrawTextSCentered(ypos2, font_nr, customize_step_text[step_nr]); }