File Select Theme

This commit is contained in:
Agent X 2023-11-13 12:16:49 -05:00
parent 02607a686e
commit 8110c83891
33 changed files with 177 additions and 117 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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"

View file

@ -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);

View file

@ -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);

View file

@ -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);
}

View file

@ -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));

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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));

View file

@ -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);
{

View file

@ -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;

View file

@ -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);

View file

@ -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);

View file

@ -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);

View file

@ -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;

View file

@ -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] = '#';

View file

@ -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);

View file

@ -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);

View file

@ -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) {

View file

@ -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);

View file

@ -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);
}
}

View file

@ -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);

View file

@ -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);