From 8110c83891c17b9db04ccc2b49eb94de48a2e68e Mon Sep 17 00:00:00 2001 From: Agent X <44549182+Agent-11@users.noreply.github.com> Date: Mon, 13 Nov 2023 12:16:49 -0500 Subject: [PATCH] File Select Theme --- lang/Czech.ini | 2 + lang/Dutch.ini | 2 + lang/English.ini | 2 + lang/French.ini | 2 + lang/German.ini | 2 + lang/Italian.ini | 2 + lang/Portuguese.ini | 2 + lang/Russian.ini | 2 + lang/SpanishES.ini | 2 + lang/SpanishUS.ini | 2 + src/pc/djui/djui_bind.c | 2 +- src/pc/djui/djui_button.c | 10 +- src/pc/djui/djui_checkbox.c | 4 +- src/pc/djui/djui_inputbox.c | 6 +- src/pc/djui/djui_lobby_entry.c | 6 +- src/pc/djui/djui_paginated.c | 3 +- src/pc/djui/djui_panel_confirm.c | 2 +- src/pc/djui/djui_panel_display.c | 3 +- src/pc/djui/djui_panel_host.c | 8 +- src/pc/djui/djui_panel_host_message.c | 2 +- src/pc/djui/djui_panel_host_mods.c | 1 + src/pc/djui/djui_panel_host_settings.c | 3 +- src/pc/djui/djui_panel_info.c | 2 +- src/pc/djui/djui_panel_join_direct.c | 2 +- src/pc/djui/djui_panel_join_message.c | 2 +- src/pc/djui/djui_panel_join_private.c | 2 +- src/pc/djui/djui_panel_menu.c | 17 ++- src/pc/djui/djui_panel_player.c | 5 +- src/pc/djui/djui_progress_bar.c | 2 +- src/pc/djui/djui_selectionbox.c | 6 +- src/pc/djui/djui_slider.c | 4 +- src/pc/djui/djui_theme.c | 176 ++++++++++++++----------- src/pc/djui/djui_theme.h | 6 +- 33 files changed, 177 insertions(+), 117 deletions(-) diff --git a/lang/Czech.ini b/lang/Czech.ini index 36bab01d..583017a9 100644 --- a/lang/Czech.ini +++ b/lang/Czech.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Řídicí panel" PREV = "Před Stránka" NEXT = "Další Strana" +DISCONNECT = "Odpojit" UP = "Nahoru" DOWN = "Dolů" @@ -158,6 +159,7 @@ LIGHT_THEME = "Světlo" DARK_THEME = "Tmavý" LIGHT_THEME_CENTERED = "Světlo (uprostřed)" DARK_THEME_CENTERED = "Tmavý (uprostřed)" +FILE_SELECT_THEME = "Výběr souboru" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/Dutch.ini b/lang/Dutch.ini index 130925f4..073911e2 100644 --- a/lang/Dutch.ini +++ b/lang/Dutch.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Logboek" PREV = "Vori Bladzijde" NEXT = "Volg Bladzijde" +DISCONNECT = "Verbreek de verbinding" UP = "Omhoog" DOWN = "Naar Beneden" @@ -158,6 +159,7 @@ LIGHT_THEME = "Licht" DARK_THEME = "Donker" LIGHT_THEME_CENTERED = "Licht (gecentreerd)" DARK_THEME_CENTERED = "Donker (gecentreerd)". +FILE_SELECT_THEME = "Bestand selecteren" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/English.ini b/lang/English.ini index 556ebd3b..7c7e3786 100644 --- a/lang/English.ini +++ b/lang/English.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Console" PREV = "Prev Page" NEXT = "Next Page" +DISCONNECT = "Disconnect" UP = "Up" DOWN = "Down" @@ -158,6 +159,7 @@ LIGHT_THEME = "Light" DARK_THEME = "Dark" LIGHT_THEME_CENTERED = "Light (Centered)" DARK_THEME_CENTERED = "Dark (Centered)" +FILE_SELECT_THEME = "File Select" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/French.ini b/lang/French.ini index 096a59b6..aa7f0873 100644 --- a/lang/French.ini +++ b/lang/French.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Console" PREV = "Page Préc" NEXT = "Page Suiv" +DISCONNECT = "Déconnecter" UP = "Haut" DOWN = "Bas" @@ -158,6 +159,7 @@ LIGHT_THEME = "Lumière" DARK_THEME = "Sombre" LIGHT_THEME_CENTERED = "Lumière (centré)" DARK_THEME_CENTERED = "Sombre (centré)" +FILE_SELECT_THEME = "Sélection de fichier" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/German.ini b/lang/German.ini index 39edd7d6..b53ac909 100644 --- a/lang/German.ini +++ b/lang/German.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Konsole" PREV = "Vorh Seite" NEXT = "Näch Seite" +DISCONNECT = "Trennen" UP = "Hoch" DOWN = "Runter" @@ -158,6 +159,7 @@ LIGHT_THEME = "Litch" DARK_THEME = "Dunkel" LIGHT_THEME_CENTERED = "Licht (zentriert)" DARK_THEME_CENTERED = "Dunkel (zentriert)" +FILE_SELECT_THEME = "Dateiauswahl" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/Italian.ini b/lang/Italian.ini index 6c1f904b..7afbc0f8 100644 --- a/lang/Italian.ini +++ b/lang/Italian.ini @@ -105,6 +105,7 @@ Y = "Y" CONSOLE = "Consolle" PREV = "Pagina Prec" NEXT = "Pagina Succ" +DISCONNECT = "Disconnettere" UP = "Su" DOWN = "Giù" @@ -156,6 +157,7 @@ LIGHT_THEME = "Luce" DARK_THEME = "Scuro" LIGHT_THEME_CENTERED = "Luce (Centrata)" DARK_THEME_CENTERED = "Scuro (Centrato)" +FILE_SELECT_THEME = "Selezione file" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/Portuguese.ini b/lang/Portuguese.ini index e258059d..c28db4c4 100644 --- a/lang/Portuguese.ini +++ b/lang/Portuguese.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Console" PREV = "Página Ante" NEXT = "Próx Página" +DISCONNECT = "Desconectar" UP = "UP" DOWN = "DOWN" @@ -158,6 +159,7 @@ LIGHT_THEME = "Claro" DARK_THEME = "Escuro" LIGHT_THEME_CENTERED = "Claro (centrado)" DARK_THEME_CENTERED = "Escuro (centrado)" +FILE_SELECT_THEME = "Seleção de arquivo" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/Russian.ini b/lang/Russian.ini index 2fbca0c8..c373724d 100644 --- a/lang/Russian.ini +++ b/lang/Russian.ini @@ -106,6 +106,7 @@ Y = "Y" CONSOLE = "пульт" PREV = "Пред Cтраница" NEXT = "След Cтраница" +DISCONNECT = "Отключить" UP = "Вверх" DOWN = "Вниз" @@ -157,6 +158,7 @@ LIGHT_THEME = "Свет" DARK_THEME = "Темный" LIGHT_THEME_CENTERED = "Свет (по центру)" DARK_THEME_CENTERED = "Темный (по центру)" +FILE_SELECT_THEME = "Выбор файла" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/SpanishES.ini b/lang/SpanishES.ini index 8dd28738..2642e054 100644 --- a/lang/SpanishES.ini +++ b/lang/SpanishES.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Consola" PREV = "Pagina Ante" NEXT = "Sigu Página" +DISCONNECT = "Desconectar" UP = "Arriba" DOWN = "Abajo" @@ -158,6 +159,7 @@ LIGHT_THEME = "Claro" DARK_THEME = "Oscuro" LIGHT_THEME_CENTERED = "Claro (Centrado)" DARK_THEME_CENTERED = "Oscuro (Centrado)" +FILE_SELECT_THEME = "Selección de archivo" [DYNOS] DYNOS = "DYNOS" diff --git a/lang/SpanishUS.ini b/lang/SpanishUS.ini index 8555db73..83771f0b 100644 --- a/lang/SpanishUS.ini +++ b/lang/SpanishUS.ini @@ -107,6 +107,7 @@ Y = "Y" CONSOLE = "Consola" PREV = "Pagina Ante" NEXT = "Sigu Página" +DISCONNECT = "Desconectar" UP = "Arriba" DOWN = "Abajo" @@ -158,6 +159,7 @@ LIGHT_THEME = "Claro" DARK_THEME = "Oscuro" LIGHT_THEME_CENTERED = "Claro (Centrado)" DARK_THEME_CENTERED = "Oscuro (Centrado)" +FILE_SELECT_THEME = "Selección de archivo" [DYNOS] DYNOS = "DYNOS" diff --git a/src/pc/djui/djui_bind.c b/src/pc/djui/djui_bind.c index 3b0f5994..90f5a626 100644 --- a/src/pc/djui/djui_bind.c +++ b/src/pc/djui/djui_bind.c @@ -65,7 +65,7 @@ struct DjuiBind* djui_bind_create(struct DjuiBase* parent, const char* message, djui_base_set_size(&text->base, 0.3f, 1.0f); djui_text_set_alignment(text, DJUI_HALIGN_LEFT, DJUI_VALIGN_BOTTOM); djui_text_set_drop_shadow(text, 64, 64, 64, 100); - djui_base_set_color(&text->base, 200, 200, 200, 255); + djui_base_set_color(&text->base, 220, 220, 220, 255); bind->text = text; struct DjuiRect* rect = djui_rect_create(&bind->base); diff --git a/src/pc/djui/djui_button.c b/src/pc/djui/djui_button.c index a43add43..377aeccf 100644 --- a/src/pc/djui/djui_button.c +++ b/src/pc/djui/djui_button.c @@ -3,11 +3,11 @@ static void djui_button_update_style(struct DjuiBase* base) { struct DjuiButton* button = (struct DjuiButton*)base; - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; if (!button->base.enabled) { - struct DjuiColor bc = button->style ? theme->interactables.darkBorderColor : theme->interactables.defaultBorderColor; - struct DjuiColor rc = button->style ? theme->interactables.darkRectColor : theme->interactables.defaultRectColor; + struct DjuiColor bc = button->style ? djui_theme_shade_color(theme->interactables.defaultBorderColor) : theme->interactables.defaultBorderColor; + struct DjuiColor rc = button->style ? djui_theme_shade_color(theme->interactables.defaultRectColor) : theme->interactables.defaultRectColor; djui_base_set_border_color(base, bc.r, bc.g, bc.b, bc.a); djui_base_set_color(&button->rect->base, rc.r, rc.g, rc.b, rc.a); @@ -27,8 +27,8 @@ static void djui_button_update_style(struct DjuiBase* base) { djui_base_set_color(&button->rect->base, rc.r, rc.g, rc.b, rc.a); djui_base_set_location(&button->text->base, -1.0f, -1.0f); } else { - struct DjuiColor bc = button->style ? theme->interactables.darkBorderColor : theme->interactables.defaultBorderColor; - struct DjuiColor rc = button->style ? theme->interactables.darkRectColor : theme->interactables.defaultRectColor; + struct DjuiColor bc = button->style ? djui_theme_shade_color(theme->interactables.defaultBorderColor) : theme->interactables.defaultBorderColor; + struct DjuiColor rc = button->style ? djui_theme_shade_color(theme->interactables.defaultRectColor) : theme->interactables.defaultRectColor; djui_base_set_border_color(base, bc.r, bc.g, bc.b, bc.a); djui_base_set_color(&button->rect->base, rc.r, rc.g, rc.b, rc.a); diff --git a/src/pc/djui/djui_checkbox.c b/src/pc/djui/djui_checkbox.c index 3f2c3ed1..ec1d844f 100644 --- a/src/pc/djui/djui_checkbox.c +++ b/src/pc/djui/djui_checkbox.c @@ -20,8 +20,8 @@ static void djui_checkbox_update_style(struct DjuiBase* base) { } else { djui_base_set_border_color(&checkbox->rect->base, 173, 173, 173, 255); djui_base_set_color(&checkbox->rect->base, 0, 0, 0, 0); - djui_base_set_color(&checkbox->text->base, 200, 200, 200, 255); - djui_base_set_color(&checkbox->rectValue->base, 200, 200, 200, 255); + djui_base_set_color(&checkbox->text->base, 220, 220, 220, 255); + djui_base_set_color(&checkbox->rectValue->base, 220, 220, 220, 255); } djui_base_set_visible(&checkbox->rectValue->base, *checkbox->value); } diff --git a/src/pc/djui/djui_inputbox.c b/src/pc/djui/djui_inputbox.c index f6c897d9..4e40f0b7 100644 --- a/src/pc/djui/djui_inputbox.c +++ b/src/pc/djui/djui_inputbox.c @@ -18,11 +18,11 @@ static u8 sCursorBlink = 0; static void djui_inputbox_update_style(struct DjuiBase* base) { struct DjuiInputbox* inputbox = (struct DjuiInputbox*)base; - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; if (!inputbox->base.enabled) { struct DjuiColor bc = theme->interactables.defaultBorderColor; - struct DjuiColor rc = theme->interactables.darkRectColor; + struct DjuiColor rc = djui_theme_shade_color(theme->interactables.defaultRectColor); djui_base_set_border_color(base, bc.r, bc.g, bc.b, bc.a); djui_base_set_color(&inputbox->base, rc.r, rc.g, rc.b, rc.a); @@ -578,7 +578,7 @@ static void djui_inputbox_destroy(struct DjuiBase* base) { struct DjuiInputbox* djui_inputbox_create(struct DjuiBase* parent, u16 bufferSize) { struct DjuiInputbox* inputbox = calloc(1, sizeof(struct DjuiInputbox)); struct DjuiBase* base = &inputbox->base; - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; inputbox->bufferSize = bufferSize; inputbox->buffer = calloc(bufferSize, sizeof(char)); diff --git a/src/pc/djui/djui_lobby_entry.c b/src/pc/djui/djui_lobby_entry.c index 2f8e4a9b..ab638189 100644 --- a/src/pc/djui/djui_lobby_entry.c +++ b/src/pc/djui/djui_lobby_entry.c @@ -7,11 +7,11 @@ static void djui_lobby_entry_update_style(struct DjuiBase* base) { struct DjuiLobbyEntry* entry = (struct DjuiLobbyEntry*)base; - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; if (!entry->base.enabled) { - struct DjuiColor bc = theme->interactables.darkBorderColor; - struct DjuiColor rc = theme->interactables.darkRectColor; + struct DjuiColor bc = djui_theme_shade_color(theme->interactables.defaultBorderColor); + struct DjuiColor rc = djui_theme_shade_color(theme->interactables.defaultRectColor); djui_base_set_border_color(base, bc.r, bc.g, bc.b, bc.a); djui_base_set_color(&entry->base, rc.r, rc.g, rc.b, rc.a); diff --git a/src/pc/djui/djui_paginated.c b/src/pc/djui/djui_paginated.c index ab4314cf..68e0c7f2 100644 --- a/src/pc/djui/djui_paginated.c +++ b/src/pc/djui/djui_paginated.c @@ -165,8 +165,9 @@ struct DjuiPaginated* djui_paginated_create(struct DjuiBase* parent, u32 showCou paginated->prevButton = sPrevButton; sPageNumText = djui_text_create(&paginated->base, ""); - djui_base_set_color(&sPageNumText->base, 200, 200, 200, 255); + djui_base_set_color(&sPageNumText->base, 220, 220, 220, 255); djui_base_set_alignment(&sPageNumText->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_BOTTOM); + djui_text_set_drop_shadow(sPageNumText, 64, 64, 64, 100); sPageNumText->base.y.value -= 30; sNextButton = djui_button_create(&paginated->base, ">", DJUI_BUTTON_STYLE_NORMAL, djui_paginated_next); diff --git a/src/pc/djui/djui_panel_confirm.c b/src/pc/djui/djui_panel_confirm.c index 4a8320be..d5ce9c54 100644 --- a/src/pc/djui/djui_panel_confirm.c +++ b/src/pc/djui/djui_panel_confirm.c @@ -16,7 +16,7 @@ void djui_panel_confirm_create(struct DjuiBase* caller, char* title, char* messa f32 textHeight = 32 * 0.8125f * lines + 8; djui_base_set_size(&text->base, 1.0f, textHeight); - djui_base_set_color(&text->base, 200, 200, 200, 255); + djui_base_set_color(&text->base, 220, 220, 220, 255); djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); struct DjuiRect* rect1 = djui_rect_container_create(body, 64); diff --git a/src/pc/djui/djui_panel_display.c b/src/pc/djui/djui_panel_display.c index 610cec88..b0caf994 100644 --- a/src/pc/djui/djui_panel_display.c +++ b/src/pc/djui/djui_panel_display.c @@ -73,9 +73,10 @@ void djui_panel_display_create(struct DjuiBase* caller) { if (configFrameLimit > 3000) { configFrameLimit = 3000; } struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(DISPLAY, FRAME_LIMIT)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 32); djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); diff --git a/src/pc/djui/djui_panel_host.c b/src/pc/djui/djui_panel_host.c index fc916e65..01ae3ae1 100644 --- a/src/pc/djui/djui_panel_host.c +++ b/src/pc/djui/djui_panel_host.c @@ -110,9 +110,10 @@ void djui_panel_host_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&sRectPort->base, DLANG(HOST, PORT)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); if (gNetworkType == NT_SERVER) { djui_base_set_enabled(&text1->base, false); } @@ -138,7 +139,7 @@ void djui_panel_host_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&sRectPassword->base, DLANG(HOST, PASSWORD)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); if (gNetworkType == NT_SERVER) { @@ -166,9 +167,10 @@ void djui_panel_host_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&rect2->base, DLANG(HOST, SAVE_SLOT)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); char starString[32] = { 0 }; snprintf(starString, 32, "%c x%d", '~' + 1, save_file_get_total_star_count(configHostSaveSlot - 1, 0, 24)); diff --git a/src/pc/djui/djui_panel_host_message.c b/src/pc/djui/djui_panel_host_message.c index bf515587..40a8f830 100644 --- a/src/pc/djui/djui_panel_host_message.c +++ b/src/pc/djui/djui_panel_host_message.c @@ -62,7 +62,7 @@ void djui_panel_host_message_create(struct DjuiBase* caller) { struct DjuiText* text1 = djui_text_create(body, warningMessage); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&text1->base, 1.0f, textHeight); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); struct DjuiRect* rect1 = djui_rect_container_create(body, 64); { diff --git a/src/pc/djui/djui_panel_host_mods.c b/src/pc/djui/djui_panel_host_mods.c index aca2c906..5cf91385 100644 --- a/src/pc/djui/djui_panel_host_mods.c +++ b/src/pc/djui/djui_panel_host_mods.c @@ -48,6 +48,7 @@ static void djui_panel_host_mods_description_create(void) { djui_base_set_size(&description->base, 1.0f, 1.0f); djui_base_set_color(&description->base, 222, 222, 222, 255); djui_text_set_alignment(description, DJUI_HALIGN_LEFT, DJUI_VALIGN_CENTER); + djui_text_set_drop_shadow(description, 64, 64, 64, 100); sTooltip = description; } sDescriptionPanel = panel; diff --git a/src/pc/djui/djui_panel_host_settings.c b/src/pc/djui/djui_panel_host_settings.c index 15da8ea2..271aefef 100644 --- a/src/pc/djui/djui_panel_host_settings.c +++ b/src/pc/djui/djui_panel_host_settings.c @@ -72,9 +72,10 @@ void djui_panel_host_settings_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(HOST_SETTINGS, AMOUNT_OF_PLAYERS)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); struct DjuiInputbox* inputbox1 = djui_inputbox_create(&rect1->base, 32); djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); diff --git a/src/pc/djui/djui_panel_info.c b/src/pc/djui/djui_panel_info.c index 6aa2c308..52c095dc 100644 --- a/src/pc/djui/djui_panel_info.c +++ b/src/pc/djui/djui_panel_info.c @@ -37,7 +37,7 @@ Build Type: %s", ); struct DjuiText* text = djui_text_create(body, sInfo); - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; djui_base_set_location(&text->base, 0, 0); djui_base_set_size(&text->base, (DJUI_DEFAULT_PANEL_WIDTH * theme->panels.widthMultiplier) - 64, 480); djui_base_set_color(&text->base, 220, 220, 220, 255); diff --git a/src/pc/djui/djui_panel_join_direct.c b/src/pc/djui/djui_panel_join_direct.c index b5ef555b..bb933653 100644 --- a/src/pc/djui/djui_panel_join_direct.c +++ b/src/pc/djui/djui_panel_join_direct.c @@ -163,7 +163,7 @@ void djui_panel_join_direct_create(struct DjuiBase* caller) { u16 directLines = djui_text_count_lines(text1, 12); f32 directTextHeight = 32 * 0.8125f * directLines + 8; djui_base_set_size(&text1->base, 1.0f, directTextHeight); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); struct DjuiInputbox* inputbox1 = djui_inputbox_create(body, 256); djui_base_set_size_type(&inputbox1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); diff --git a/src/pc/djui/djui_panel_join_message.c b/src/pc/djui/djui_panel_join_message.c index 2c05b24e..2eadfe30 100644 --- a/src/pc/djui/djui_panel_join_message.c +++ b/src/pc/djui/djui_panel_join_message.c @@ -61,7 +61,7 @@ void djui_panel_join_message_create(struct DjuiBase* caller) { struct DjuiText* text1 = djui_text_create(body, "\n..."); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&text1->base, 1.0f, 32 * 4); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_text_set_alignment(text1, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER); text1->base.tag = 0; text1->base.on_render_pre = djui_panel_join_message_render_pre; diff --git a/src/pc/djui/djui_panel_join_private.c b/src/pc/djui/djui_panel_join_private.c index d5d5bc59..da58b145 100644 --- a/src/pc/djui/djui_panel_join_private.c +++ b/src/pc/djui/djui_panel_join_private.c @@ -27,7 +27,7 @@ void djui_panel_join_private_create(struct DjuiBase* caller) { u16 directLines = djui_text_count_lines(text1, 12); f32 directTextHeight = 32 * 0.8125f * directLines + 8; djui_base_set_size(&text1->base, 1.0f, directTextHeight); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); struct DjuiInputbox* inputbox1 = djui_inputbox_create(body, 256); inputbox1->passwordChar[0] = '#'; diff --git a/src/pc/djui/djui_panel_menu.c b/src/pc/djui/djui_panel_menu.c index 9ac5dca9..a5823071 100644 --- a/src/pc/djui/djui_panel_menu.c +++ b/src/pc/djui/djui_panel_menu.c @@ -48,7 +48,7 @@ void djui_panel_menu_back(UNUSED struct DjuiBase* base) { struct DjuiThreePanel* djui_panel_menu_create(char* headerText) { struct DjuiThreePanel* panel = djui_three_panel_create(&gDjuiRoot->base, 64, 0, 0); - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; struct DjuiThreePanelTheme three = theme->threePanels; bool center = theme->panels.center && strcmp(headerText, DLANG(HOST_MODS, MODS)) && @@ -67,15 +67,20 @@ struct DjuiThreePanel* djui_panel_menu_create(char* headerText) { djui_base_set_border_width(&panel->base, 8); djui_base_set_padding(&panel->base, 16, 16, 16, 16); { - generate_rainbow_text(headerText); - struct DjuiText* header = djui_text_create(&panel->base, sRainbowText); + bool hudFontHeader = gDjuiThemes[configDjuiTheme]->panels.hudFontHeader; + if (!hudFontHeader) { generate_rainbow_text(headerText); } + struct DjuiText* header = djui_text_create(&panel->base, hudFontHeader ? headerText : sRainbowText); djui_base_set_size_type(&header->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size(&header->base, 1.0f, 1.0f); - djui_base_set_color(&header->base, 255, 8, 0, 255); + if (hudFontHeader) { + djui_base_set_color(&header->base, 255, 255, 255, 255); + } else { + djui_base_set_color(&header->base, 255, 8, 0, 255); + } 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[1]); - djui_text_set_font_scale(header, gDjuiFonts[1]->defaultFontScale); + djui_text_set_font(header, hudFontHeader ? gDjuiFonts[2] : gDjuiFonts[1]); + djui_text_set_font_scale(header, gDjuiFonts[1]->defaultFontScale * (hudFontHeader ? 0.7f : 1.0f)); 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_player.c b/src/pc/djui/djui_panel_player.c index 59a1f386..eceb6023 100644 --- a/src/pc/djui/djui_panel_player.c +++ b/src/pc/djui/djui_panel_player.c @@ -141,9 +141,10 @@ static void djui_panel_player_edit_palette_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(PLAYER, HEX_CODE)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); + djui_text_set_drop_shadow(text1, 64, 64, 64, 100); sHexColorTextBox = djui_inputbox_create(&rect1->base, 7); djui_base_set_size_type(&sHexColorTextBox->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); @@ -242,7 +243,7 @@ void djui_panel_player_create(struct DjuiBase* caller) { { struct DjuiText* text1 = djui_text_create(&rect1->base, DLANG(PLAYER, NAME)); djui_base_set_size_type(&text1->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); - djui_base_set_color(&text1->base, 200, 200, 200, 255); + djui_base_set_color(&text1->base, 220, 220, 220, 255); djui_base_set_size(&text1->base, 0.585f, 64); djui_base_set_alignment(&text1->base, DJUI_HALIGN_LEFT, DJUI_VALIGN_TOP); diff --git a/src/pc/djui/djui_progress_bar.c b/src/pc/djui/djui_progress_bar.c index fff39a11..08a4b08a 100644 --- a/src/pc/djui/djui_progress_bar.c +++ b/src/pc/djui/djui_progress_bar.c @@ -27,7 +27,7 @@ static void djui_progress_bar_set_default_style(struct DjuiBase* base) { struct DjuiProgressBar* progress = (struct DjuiProgressBar*)base; djui_base_set_border_color(&progress->rect->base, 173, 173, 173, 255); djui_base_set_color(&progress->rect->base, 0, 0, 0, 0); - djui_base_set_color(&progress->rectValue->base, 200, 200, 200, 255); + djui_base_set_color(&progress->rectValue->base, 220, 220, 220, 255); } static void djui_progress_bar_destroy(struct DjuiBase* base) { diff --git a/src/pc/djui/djui_selectionbox.c b/src/pc/djui/djui_selectionbox.c index a1adc609..cafc34cf 100644 --- a/src/pc/djui/djui_selectionbox.c +++ b/src/pc/djui/djui_selectionbox.c @@ -7,14 +7,14 @@ extern ALIGNED8 u8 texture_selectionbox_forward_icon[]; static void djui_selectionbox_update_style(struct DjuiBase* base) { struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base; - const struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; + struct DjuiTheme* theme = gDjuiThemes[configDjuiTheme]; f32 x = selectionbox->rect->base.elem.x; bool activeRegion = (gCursorX >= x); if (!selectionbox->base.enabled) { struct DjuiSelectionbox* selectionbox = (struct DjuiSelectionbox*)base; - struct DjuiColor bc = theme->interactables.darkBorderColor; - struct DjuiColor rc = theme->interactables.darkRectColor; + struct DjuiColor bc = djui_theme_shade_color(theme->interactables.defaultBorderColor); + struct DjuiColor rc = djui_theme_shade_color(theme->interactables.defaultRectColor); struct DjuiColor tc = theme->interactables.textColor; djui_base_set_border_color(&selectionbox->rect->base, bc.r, bc.g, bc.b, bc.a); diff --git a/src/pc/djui/djui_slider.c b/src/pc/djui/djui_slider.c index 92324a97..7e988f7e 100644 --- a/src/pc/djui/djui_slider.c +++ b/src/pc/djui/djui_slider.c @@ -23,8 +23,8 @@ static void djui_slider_update_style(struct DjuiBase* base) { } else { djui_base_set_border_color(&slider->rect->base, 173, 173, 173, 255); djui_base_set_color(&slider->rect->base, 0, 0, 0, 0); - djui_base_set_color(&slider->text->base, 200, 200, 200, 255); - djui_base_set_color(&slider->rectValue->base, 200, 200, 200, 255); + djui_base_set_color(&slider->text->base, 220, 220, 220, 255); + djui_base_set_color(&slider->rectValue->base, 220, 220, 220, 255); } } diff --git a/src/pc/djui/djui_theme.c b/src/pc/djui/djui_theme.c index 84f4e55e..396a9488 100644 --- a/src/pc/djui/djui_theme.c +++ b/src/pc/djui/djui_theme.c @@ -5,48 +5,42 @@ static struct DjuiTheme sDjuiThemeLight = { .name = "LIGHT_THEME", .interactables = { .textColor = { - .r = 11, .g = 11, .b = 11, .a = 255 + 11, 11, 11, 255 }, .defaultRectColor = { - .r = 222, .g = 222, .b = 222, .a = 255 + 222, 222, 222, 255 }, .cursorDownRectColor = { - .r = 204, .g = 228, .b = 247, .a = 255 + 204, 228, 247, 255 }, .hoveredRectColor = { - .r = 229, .g = 241, .b = 251, .a = 255 + 229, 241, 251, 255 }, .defaultBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 75, 75, 75, 255 }, .cursorDownBorderColor = { - .r = 0, .g = 84, .b = 153, .a = 255 + 0, 84, 153, 255 }, .hoveredBorderColor = { - .r = 0, .g = 120, .b = 215, .a = 255 - }, - - .darkRectColor = { - .r = 150, .g = 150, .b = 150, .a = 255 - }, - .darkBorderColor = { - .r = 100, .g = 100, .b = 100, .a = 255 + 0, 120, 215, 255 } }, .threePanels = { .rectColor = { - .r = 0, .g = 0, .b = 0, .a = 235 + 0, 0, 0, 235 }, .borderColor = { - .r = 0, .g = 0, .b = 0, .a = 200 - }, + 0, 0, 0, 200 + } }, .panels = { .widthMultiplier = 1.0f, .heightMultiplier = 1.0f, - .center = false + .center = false, + .hudFontHeader = false } }; @@ -55,48 +49,42 @@ static struct DjuiTheme sDjuiThemeDark = { .name = "DARK_THEME", .interactables = { .textColor = { - .r = 220, .g = 220, .b = 220, .a = 255 + 220, 220, 220, 255 }, .defaultRectColor = { - .r = 22, .g = 22, .b = 22, .a = 255 + 22, 22, 22, 255 }, .cursorDownRectColor = { - .r = 100, .g = 100, .b = 100, .a = 255 + 100, 100, 100, 255 }, .hoveredRectColor = { - .r = 80, .g = 80, .b = 80, .a = 255 + 80, 80, 80, 255 }, .defaultBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 75, 75, 75, 255 }, .cursorDownBorderColor = { - .r = 0, .g = 84, .b = 153, .a = 255 + 0, 84, 153, 255 }, .hoveredBorderColor = { - .r = 0, .g = 120, .b = 215, .a = 255 - }, - - .darkRectColor = { - .r = 10, .g = 10, .b = 10, .a = 255 - }, - .darkBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 0, 120, 215, 255 } }, .threePanels = { .rectColor = { - .r = 0, .g = 0, .b = 0, .a = 235 + 0, 0, 0, 235 }, .borderColor = { - .r = 0, .g = 0, .b = 0, .a = 200 - }, + 0, 0, 0, 200 + } }, .panels = { .widthMultiplier = 1.0f, .heightMultiplier = 1.0f, - .center = false + .center = false, + .hudFontHeader = false } }; @@ -105,48 +93,42 @@ static struct DjuiTheme sDjuiThemeLightCentered = { .name = "LIGHT_THEME_CENTERED", .interactables = { .textColor = { - .r = 11, .g = 11, .b = 11, .a = 255 + 11, 11, 11, 255 }, .defaultRectColor = { - .r = 222, .g = 222, .b = 222, .a = 255 + 222, 222, 222, 255 }, .cursorDownRectColor = { - .r = 204, .g = 228, .b = 247, .a = 255 + 204, 228, 247, 255 }, .hoveredRectColor = { - .r = 229, .g = 241, .b = 251, .a = 255 + 229, 241, 251, 255 }, .defaultBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 75, 75, 75, 255 }, .cursorDownBorderColor = { - .r = 0, .g = 84, .b = 153, .a = 255 + 0, 84, 153, 255 }, .hoveredBorderColor = { - .r = 0, .g = 120, .b = 215, .a = 255 - }, - - .darkRectColor = { - .r = 150, .g = 150, .b = 150, .a = 255 - }, - .darkBorderColor = { - .r = 100, .g = 100, .b = 100, .a = 255 - }, + 0, 120, 215, 255 + } }, .threePanels = { .rectColor = { - .r = 0, .g = 0, .b = 0, .a = 235 + 0, 0, 0, 235 }, .borderColor = { - .r = 0, .g = 0, .b = 0, .a = 200 - }, + 0, 0, 0, 200 + } }, .panels = { .widthMultiplier = 1.25f, .heightMultiplier = 0.88f, - .center = true + .center = true, + .hudFontHeader = false } }; @@ -155,48 +137,86 @@ static struct DjuiTheme sDjuiThemeDarkCentered = { .name = "DARK_THEME_CENTERED", .interactables = { .textColor = { - .r = 220, .g = 220, .b = 220, .a = 255 + 220, 220, 220, 255 }, .defaultRectColor = { - .r = 22, .g = 22, .b = 22, .a = 255 + 22, 22, 22, 255 }, .cursorDownRectColor = { - .r = 100, .g = 100, .b = 100, .a = 255 + 100, 100, 100, 255 }, .hoveredRectColor = { - .r = 80, .g = 80, .b = 80, .a = 255 + 80, 80, 80, 255 }, .defaultBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 75, 75, 75, 255 }, .cursorDownBorderColor = { - .r = 0, .g = 84, .b = 153, .a = 255 + 0, 84, 153, 255 }, .hoveredBorderColor = { - .r = 0, .g = 120, .b = 215, .a = 255 - }, - - .darkRectColor = { - .r = 10, .g = 10, .b = 10, .a = 255 - }, - .darkBorderColor = { - .r = 75, .g = 75, .b = 75, .a = 255 + 0, 120, 215, 255 } }, .threePanels = { .rectColor = { - .r = 0, .g = 0, .b = 0, .a = 235 + 0, 0, 0, 235 }, .borderColor = { - .r = 0, .g = 0, .b = 0, .a = 200 - }, + 0, 0, 0, 200 + } }, .panels = { .widthMultiplier = 1.25f, .heightMultiplier = 0.88f, - .center = true + .center = true, + .hudFontHeader = false + } +}; + +static struct DjuiTheme sDjuiThemeFileSelect = { + .id = "FILE_SELECT_THEME", + .name = "FILE_SELECT_THEME", + .interactables = { + .textColor = { + 11, 11, 11, 255 + }, + + .defaultRectColor = { + 200, 215, 197, 255 + }, + .cursorDownRectColor = { + 204, 228, 247, 255 + }, + .hoveredRectColor = { + 229, 241, 251, 255 + }, + + .defaultBorderColor = { + 74, 79, 74, 255 + }, + .cursorDownBorderColor = { + 0, 84, 153, 255 + }, + .hoveredBorderColor = { + 0, 120, 215, 255 + } + }, + .threePanels = { + .rectColor = { + 208, 165, 32, 255 + }, + .borderColor = { + 182, 135, 8, 255 + } + }, + .panels = { + .widthMultiplier = 1.5f, + .heightMultiplier = 0.88f, + .center = true, + .hudFontHeader = true } }; @@ -204,9 +224,17 @@ struct DjuiTheme* gDjuiThemes[] = { &sDjuiThemeLight, &sDjuiThemeDark, &sDjuiThemeLightCentered, - &sDjuiThemeDarkCentered + &sDjuiThemeDarkCentered, + &sDjuiThemeFileSelect }; +struct DjuiColor djui_theme_shade_color(struct DjuiColor color) { + color.r *= 0.5f; + color.g *= 0.5f; + color.b *= 0.5f; + return color; +} + void djui_themes_init(void) { for (s32 i = 0; i < DJUI_THEME_MAX; i++) { gDjuiThemes[i]->name = djui_language_get("DJUI_THEMES", gDjuiThemes[i]->id); diff --git a/src/pc/djui/djui_theme.h b/src/pc/djui/djui_theme.h index 493ead3b..3bee89c5 100644 --- a/src/pc/djui/djui_theme.h +++ b/src/pc/djui/djui_theme.h @@ -6,6 +6,7 @@ enum DjuiThemeType { DJUI_THEME_DARK, DJUI_THEME_LIGHT_CENTERED, DJUI_THEME_DARK_CENTERED, + DJUI_THEME_FILE_SELECT, DJUI_THEME_MAX }; @@ -19,9 +20,6 @@ struct DjuiInteractableTheme { struct DjuiColor defaultBorderColor; struct DjuiColor cursorDownBorderColor; struct DjuiColor hoveredBorderColor; - - struct DjuiColor darkRectColor; - struct DjuiColor darkBorderColor; }; struct DjuiThreePanelTheme { @@ -33,6 +31,7 @@ struct DjuiPanelTheme { f32 widthMultiplier; f32 heightMultiplier; bool center; + bool hudFontHeader; }; struct DjuiTheme { @@ -45,4 +44,5 @@ struct DjuiTheme { extern struct DjuiTheme* gDjuiThemes[]; +struct DjuiColor djui_theme_shade_color(struct DjuiColor color); void djui_themes_init(void);