feat(ui): temes de color del menú amb tema egípci per defecte
This commit is contained in:
1 parent
80140434e7
commit
0e8a195ddd
2 files changed
+57
-14
No files matched your search
+35
-7
@@ -9,13 +9,6 @@ colors:
|
|||||||
notification_bg: 64
|
notification_bg: 64
|
||||||
exit_text: 71
|
exit_text: 71
|
||||||
exit_bg: 2
|
exit_bg: 2
|
||||||
menu_bg: 2
|
|
||||||
menu_border: 232
|
|
||||||
menu_title: 237
|
|
||||||
menu_label: 58
|
|
||||||
menu_value: 232
|
|
||||||
menu_cursor: 71
|
|
||||||
menu_disabled: 16
|
|
||||||
hud_bg: 9
|
hud_bg: 9
|
||||||
hud_flash: 63
|
hud_flash: 63
|
||||||
# Rètol de transició de sala (ROOM_INTRO i ROOM_OUTRO). Independents
|
# Rètol de transició de sala (ROOM_INTRO i ROOM_OUTRO). Independents
|
||||||
@@ -27,6 +20,41 @@ colors:
|
|||||||
room_text: 55 # or brillant (#FFDA00, = hud_center.value)
|
room_text: 55 # or brillant (#FFDA00, = hud_center.value)
|
||||||
room_text_outline: 10 # marró cremat (#482400, = hud_center.shadow)
|
room_text_outline: 10 # marró cremat (#482400, = hud_center.shadow)
|
||||||
|
|
||||||
|
# Tema actiu del menú de servei. Ha de coincidir amb una clau de
|
||||||
|
# `menu_themes`; si manca o no existeix, cada slot cau al default
|
||||||
|
# compilat a Defaults::UI (= tema "classic"). Canviar de tema requereix
|
||||||
|
# reiniciar el joc — la càrrega de paleta es fa només en arrencar.
|
||||||
|
menu_theme: egyptian
|
||||||
|
|
||||||
|
# Conjunts de colors del menú de servei. Cada tema defineix els 7 slots
|
||||||
|
# (sense prefix `menu_` perquè ja som dins del bloc del tema). Si manca
|
||||||
|
# alguna clau dins d'un tema, cau al default compilat. Per afegir un
|
||||||
|
# tema nou, només cal una nova entrada aquí i posar-ne el nom a
|
||||||
|
# `menu_theme`.
|
||||||
|
menu_themes:
|
||||||
|
# Tema històric (defaults compilats). Cian + verd llima + magenta —
|
||||||
|
# paleta arcade clàssica, freda i amb molt contrast.
|
||||||
|
classic:
|
||||||
|
bg: 2 # marró-vermell fosc (#480000)
|
||||||
|
border: 232 # cian brillant (#00B6FF)
|
||||||
|
title: 237 # lavanda (#B6B6FF)
|
||||||
|
label: 58 # verd llima (#48FF00)
|
||||||
|
value: 232 # cian brillant (#00B6FF) — coincideix amb el border
|
||||||
|
cursor: 71 # magenta-vermell (#FF0055)
|
||||||
|
disabled: 16 # verd fosc (#004800)
|
||||||
|
# Tema "egípci": família or/ambre/marró coherent amb el HUD i el
|
||||||
|
# rètol de transició de sala (room_text). El bg comparteix to amb
|
||||||
|
# `room_text_outline` i `hud_center.shadow` perquè el menú "creixi"
|
||||||
|
# del mateix món visual que el joc.
|
||||||
|
egyptian:
|
||||||
|
bg: 10 # marró cremat (#482400)
|
||||||
|
border: 55 # or brillant (#FFDA00)
|
||||||
|
title: 127 # groc llimona viu (#FFFF55)
|
||||||
|
label: 47 # ambre (#FFB600)
|
||||||
|
value: 191 # crema clar (#FFFFAA)
|
||||||
|
cursor: 23 # vermilló (#FF4800)
|
||||||
|
disabled: 19 # oliva fosc (#6D4800)
|
||||||
|
|
||||||
timings:
|
timings:
|
||||||
notification_ms: 4000
|
notification_ms: 4000
|
||||||
exit_ms: 4000
|
exit_ms: 4000
|
||||||
|
|||||||
@@ -215,19 +215,34 @@ void UiConfig::load(const std::string& file_path) {
|
|||||||
readColorIndex(c, "notification_bg", notification_bg_);
|
readColorIndex(c, "notification_bg", notification_bg_);
|
||||||
readColorIndex(c, "exit_text", exit_text_);
|
readColorIndex(c, "exit_text", exit_text_);
|
||||||
readColorIndex(c, "exit_bg", exit_bg_);
|
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_bg", hud_bg_);
|
||||||
readColorIndex(c, "hud_flash", hud_flash_);
|
readColorIndex(c, "hud_flash", hud_flash_);
|
||||||
readColorIndex(c, "room_text", room_text_);
|
readColorIndex(c, "room_text", room_text_);
|
||||||
readColorIndex(c, "room_text_outline", room_text_outline_);
|
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`,
|
// Famílies de color del HUD: blocs `hud_p1`, `hud_center`,
|
||||||
// `hud_p2` amb claus `label`, `value`, `shadow`. Cada bloc i
|
// `hud_p2` amb claus `label`, `value`, `shadow`. Cada bloc i
|
||||||
// cada clau són opcionals — el que manqui cau al default
|
// cada clau són opcionals — el que manqui cau al default
|
||||||
|
|||||||
Reference in new issue
Block a user