From 5a11ad167350794a77fc79add81e3d614fa6cd4f Mon Sep 17 00:00:00 2001 From: EmeraldLockdown <86802223+EmeraldLoc@users.noreply.github.com> Date: Sat, 14 Mar 2026 11:37:13 -0500 Subject: [PATCH] Add hud font --- lang/English.ini | 1 + src/pc/djui/djui_panel_menu.c | 4 +++- src/pc/djui/djui_panel_themes.c | 21 +++++++++++++-------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/lang/English.ini b/lang/English.ini index ba3b0cc94..424688073 100644 --- a/lang/English.ini +++ b/lang/English.ini @@ -185,6 +185,7 @@ GRADIENTS = "DJUI Gradients" SMOOTH_SCROLLING = "DJUI Smooth Scrolling" FONT_NORMAL = "Normal" FONT_MENU = "Menu" +FONT_CUSTOM_HUD = "Hud" FONT_ALIASED = "Aliased" FONT_SPECIAL = "Special" FONT_CLASSIC = "Classic" diff --git a/src/pc/djui/djui_panel_menu.c b/src/pc/djui/djui_panel_menu.c index 1ff2c0f73..fe7488435 100644 --- a/src/pc/djui/djui_panel_menu.c +++ b/src/pc/djui/djui_panel_menu.c @@ -2,6 +2,7 @@ #include "djui_panel.h" #include "djui_unicode.h" #include "djui_panel_menu.h" +#include "djui_hud_utils.h" #include "pc/utils/misc.h" #include "pc/configfile.h" @@ -90,7 +91,8 @@ struct DjuiThreePanel* djui_panel_menu_create(char* headerText, bool forcedLeftS djui_base_set_location(&header->base, 0, DJUI_PANEL_HEADER_OFFSET); djui_text_set_alignment(header, DJUI_HALIGN_CENTER, DJUI_VALIGN_BOTTOM); djui_text_set_font(header, gDjuiFonts[headerFont]); - djui_text_set_font_scale(header, 64); + // if only we had unified font sizes and I didn't have to do this hack + djui_text_set_font_scale(header, headerFont == FONT_CUSTOM_HUD ? 96 : 64); struct DjuiFlowLayout* body = djui_flow_layout_create(&panel->base); djui_base_set_alignment(&body->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER); diff --git a/src/pc/djui/djui_panel_themes.c b/src/pc/djui/djui_panel_themes.c index 143ffa686..c1675493b 100644 --- a/src/pc/djui/djui_panel_themes.c +++ b/src/pc/djui/djui_panel_themes.c @@ -168,9 +168,10 @@ static void djui_panel_theme_font_setting_change(UNUSED struct DjuiBase* caller) } static void djui_panel_theme_header_font_setting_change(UNUSED struct DjuiBase* caller) { - u8 djuiHeaderFontChoices[5] = { + u8 djuiHeaderFontChoices[6] = { FONT_NORMAL, FONT_MENU, + FONT_CUSTOM_HUD, FONT_ALIASED, FONT_SPECIAL, FONT_CLASSIC @@ -404,6 +405,8 @@ static bool djui_panel_theme_renderer(struct DjuiBase* base) { struct DjuiBase* headerBase = djui_three_panel_get_header(threePanel); struct DjuiText* headerText = (struct DjuiText*)headerBase; djui_text_set_font(headerText, gDjuiFonts[configDjuiTheme.headerFont]); + // if only we had unified font sizes and I didn't have to do this hack + djui_text_set_font_scale(headerText, configDjuiTheme.headerFont == FONT_CUSTOM_HUD ? 96 : 64); if (!configDjuiTheme.useRainbowColor) { djui_text_set_text(headerText, DLANG(DJUI_THEMES, THEMES_TITLE)); djui_base_set_color_with_color(headerBase, configDjuiTheme.elements[DJUI_THEME_ELEMENT_PANEL_HEADER_COLOR]); @@ -557,21 +560,23 @@ void djui_panel_themes_create(struct DjuiBase* caller) { djui_base_set_border_color(&sColorRect->base, 173, 173, 173, 255); u8 djuiHeaderFontSelectIndexes[FONT_COUNT] = { - [FONT_NORMAL] = 0, - [FONT_MENU] = 1, - [FONT_ALIASED] = 2, - [FONT_SPECIAL] = 3, - [FONT_CLASSIC] = 4, + [FONT_NORMAL] = 0, + [FONT_MENU] = 1, + [FONT_CUSTOM_HUD] = 2, + [FONT_ALIASED] = 3, + [FONT_SPECIAL] = 4, + [FONT_CLASSIC] = 5, }; sDjuiHeaderFontSelected = djuiHeaderFontSelectIndexes[configDjuiTheme.headerFont]; - char* djuiHeaderFontChoices[5] = { + char* djuiHeaderFontChoices[6] = { DLANG(DJUI_THEMES, FONT_NORMAL), DLANG(DJUI_THEMES, FONT_MENU), + DLANG(DJUI_THEMES, FONT_CUSTOM_HUD), DLANG(DJUI_THEMES, FONT_ALIASED), DLANG(DJUI_THEMES, FONT_SPECIAL), DLANG(DJUI_THEMES, FONT_CLASSIC) }; - sSelectionboxes[sSelectionboxesCount++] = djui_selectionbox_create(body, DLANG(DJUI_THEMES, HEADER_FONT), djuiHeaderFontChoices, 5, &sDjuiHeaderFontSelected, djui_panel_theme_header_font_setting_change); + sSelectionboxes[sSelectionboxesCount++] = djui_selectionbox_create(body, DLANG(DJUI_THEMES, HEADER_FONT), djuiHeaderFontChoices, 6, &sDjuiHeaderFontSelected, djui_panel_theme_header_font_setting_change); sCheckboxes[sCheckboxesCount++] = djui_checkbox_create(body, DLANG(DJUI_THEMES, USE_RAINBOW), &configDjuiTheme.useRainbowColor, djui_panel_themes_reload); sCheckboxes[sCheckboxesCount++] = djui_checkbox_create(body, DLANG(DJUI_THEMES, GRADIENTS), &configDjuiTheme.gradients, djui_panel_themes_reload);