feat(ui): temes de color del menú amb tema egípci per defecte

This commit is contained in:
JailDesigner committed 2026-05-14 09:39:46 +02:00
1 parent 80140434e7
commit 0e8a195ddd
2 files changed
+57 -14

No files matched your search

+22 -7
View File
@@ -215,19 +215,34 @@ void UiConfig::load(const std::string& file_path) {
readColorIndex(c, "notification_bg", notification_bg_);
readColorIndex(c, "exit_text", exit_text_);
readColorIndex(c, "exit_bg", exit_bg_);
readColorIndex(c, "menu_bg", menu_bg_);
readColorIndex(c, "menu_border", menu_border_);
readColorIndex(c, "menu_title", menu_title_);
readColorIndex(c, "menu_label", menu_label_);
readColorIndex(c, "menu_value", menu_value_);
readColorIndex(c, "menu_cursor", menu_cursor_);
readColorIndex(c, "menu_disabled", menu_disabled_);
readColorIndex(c, "hud_bg", hud_bg_);
readColorIndex(c, "hud_flash", hud_flash_);
readColorIndex(c, "room_text", room_text_);
readColorIndex(c, "room_text_outline", room_text_outline_);
}
// Tema actiu del menú: `menu_theme` és el nom del bloc dins de
// `menu_themes` que aporta els 7 slots de color. Si qualsevol
// de les dues claus manca o el nom no existeix, els slots
// queden amb el default compilat (= tema "classic" hardcoded
// a Defaults::UI). Per-key dins del tema també és opcional.
if (yaml.contains("menu_theme") && yaml.contains("menu_themes")) {
const auto THEME_NAME = yaml["menu_theme"].get_value<std::string>();
const auto& themes = yaml["menu_themes"];
if (themes.contains(THEME_NAME)) {
const auto& t = themes[THEME_NAME];
readColorIndex(t, "bg", menu_bg_);
readColorIndex(t, "border", menu_border_);
readColorIndex(t, "title", menu_title_);
readColorIndex(t, "label", menu_label_);
readColorIndex(t, "value", menu_value_);
readColorIndex(t, "cursor", menu_cursor_);
readColorIndex(t, "disabled", menu_disabled_);
} else {
Log::warn("UiConfig", "menu_theme '{}' no existeix a menu_themes — s'usen defaults", THEME_NAME);
}
}
// Famílies de color del HUD: blocs `hud_p1`, `hud_center`,
// `hud_p2` amb claus `label`, `value`, `shadow`. Cada bloc i
// cada clau són opcionals — el que manqui cau al default