feat(ui): captura F9, tema a data/ui.yaml i retocs estètics

Captura de pantalla amb F9: volca el canvas ARGB a
screenshots/scr_<timestamp>.png via stb_image_write.

Tot el tema d'UI (colors, timings, fonts, flag hud.bg_enabled)
passa a data/ui.yaml via UiConfig; els valors de Defaults::UI
queden com a fallbacks si el fitxer falta o li manca alguna clau.

Retocs estètics: paleta "uzebox" per a la UI, strings del HUD
(P1/P2/V/T/PIRAMIDE/SALA) traduïts a locale, i fons del marcador
opcional amb backdrop continu de franja per evitar el trencament
visual durant el shake o l'animació d'entrada dels panells.
This commit is contained in:
JailDesigner committed 2026-04-24 10:58:02 +02:00
1 parent 82b229222f
commit dc8a7723e3
26 files changed
+2593 -210

No files matched your search

+11 -11
View File
@@ -14,9 +14,9 @@
#include "core/rendering/screen.hpp"
#include "core/rendering/text.hpp"
#include "core/system/event_buffer.hpp"
#include "core/ui/ui_config.hpp"
#include "game/options.hpp"
#include "game/options_apply.hpp"
#include "game/ui/ui_palette.hpp"
#include "utils/defaults.hpp"
#include "utils/defines.hpp"
#include "version.h"
@@ -844,8 +844,8 @@ auto ServiceMenu::targetBoxHeight(const Page& page) const -> int {
}
void ServiceMenu::renderBox(int box_x, int box_y, int box_w, int box_h, float eased) const {
const std::uint32_t BG_ARGB = ui_palette_[UiColor::MENU_BG];
const std::uint32_t BORDER_ARGB = ui_palette_[UiColor::MENU_BORDER];
const std::uint32_t BG_ARGB = ui_palette_[UiConfig::get().menuBg()];
const std::uint32_t BORDER_ARGB = ui_palette_[UiConfig::get().menuBorder()];
const auto ALPHA = static_cast<std::uint8_t>(std::lround(BG_ALPHA * eased));
// Fons semi-transparent (el joc queda visible apagat per darrere).
@@ -877,7 +877,7 @@ void ServiceMenu::renderPage(const Page& page, int box_x, int box_y, int box_w)
cursor_y,
Locale::get().text(page.title_key),
TITLE_KERNING,
UiColor::MENU_TITLE);
UiConfig::get().menuTitle());
cursor_y += TITLE_H + GAP_Y - TITLE_DESCENDER_TRIM;
if (!page.subtitle.empty()) {
@@ -886,11 +886,11 @@ void ServiceMenu::renderPage(const Page& page, int box_x, int box_y, int box_w)
cursor_y,
page.subtitle,
TITLE_KERNING,
UiColor::MENU_TITLE);
UiConfig::get().menuTitle());
cursor_y += TITLE_H + GAP_Y - TITLE_DESCENDER_TRIM;
}
Screen::get().fillRect(box_x + PAD_X, cursor_y, box_w - (2 * PAD_X), 1, ui_palette_[UiColor::MENU_BORDER]);
Screen::get().fillRect(box_x + PAD_X, cursor_y, box_w - (2 * PAD_X), 1, ui_palette_[UiConfig::get().menuBorder()]);
cursor_y += 1 + GAP_Y;
bool first_item = true;
@@ -907,14 +907,14 @@ void ServiceMenu::renderPage(const Page& page, int box_x, int box_y, int box_w)
: Locale::get().text(item.label_key);
const std::string VALUE = formatValue(item);
Uint8 label_color = UiColor::MENU_LABEL;
Uint8 label_color = UiConfig::get().menuLabel();
if (item.kind == Item::Kind::LABEL) {
// Mateix to que el títol de la pàgina: les LABELs actuen com
// a subtítol-divisor (p.ex. "Jugador 1" a Teclat, "ver.X.Y" a
// Sistema) i han de tenir la mateixa presència visual.
label_color = UiColor::MENU_TITLE;
label_color = UiConfig::get().menuTitle();
} else if (SELECTED) {
label_color = UiColor::MENU_CURSOR;
label_color = UiConfig::get().menuCursor();
}
int label_x = LABEL_X;
@@ -931,7 +931,7 @@ void ServiceMenu::renderPage(const Page& page, int box_x, int box_y, int box_w)
cursor_y,
"> ",
ITEM_KERNING,
UiColor::MENU_CURSOR);
UiConfig::get().menuCursor());
}
items_font_->writeDX(Text::COLOR_FLAG,
@@ -951,7 +951,7 @@ void ServiceMenu::renderPage(const Page& page, int box_x, int box_y, int box_w)
cursor_y,
VALUE,
ITEM_KERNING,
SELECTED ? UiColor::MENU_CURSOR : UiColor::MENU_VALUE);
SELECTED ? UiConfig::get().menuCursor() : UiConfig::get().menuValue());
}
cursor_y += ITEM_H;