Separate Matchday balance colours from the skin accent (by Codex)

This commit is contained in:
Codex committed 2026-10-27 22:28:28 +01:00
1 parent 85a1fe5a95
commit 94dc5ecbc4
8 files changed
+42 -10

No files matched your search

+2 -2
View File
@@ -48,7 +48,7 @@ void App::engine_render() {
out = "<div class=\"desktop-layer\"><div class=\"info-bar\"><div class=\"identity\">" + crest(club, 82) +
"<span><strong>" + esc(engine_text(team.at("name"))) + "</strong><small>" + esc(engine_text(person.at("name"))) +
"</small></span></div><div class=\"info-date\">" + esc(meta.at("date").get<std::string>()) + "<small>" +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\">" +
esc(meta.at("season").at("label").get<std::string>()) + "</small></div><div class=\"info-cash\"><small>Guthaben</small><strong id=\"engine-cash\" class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" +
esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div></div>";
init_desktop();
for (const auto &[id, o] : desktop_.at("objects").items()) {
@@ -71,7 +71,7 @@ void App::engine_render() {
body = "<div class=\"desk-calendar-month\"><span>" + std::string(months[size_t(m - 1)]) + " " + std::to_string(y) + "</span></div><div class=\"desk-calendar-body\"><span>" + weekdays[std::chrono::weekday{std::chrono::sys_days(ymd)}.c_encoding()] + "</span><strong>" + std::to_string(d) + "</strong><small>" + esc(meta.at("season").at("label").get<std::string>()) + "</small></div>";
} else if (id == "account") {
const auto savings = desk.at("accounts").at("savings");
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong>" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-unavailable", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>—</strong></span>", "desk-ticket", "disabled") + "</div>";
body = widget_heading("Vereinskasse", false) + "<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(engine_money_minor(desk.at("accounts").at("cash"))) + "\">" + esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div><div class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" + (savings.is_null() ? std::string("—") : esc(engine_price(savings))) + "</strong></div>" + btn("engine-unavailable", glyph("ticket", 36) + "<span><span>Eintritt</span><strong>—</strong></span>", "desk-ticket", "disabled") + "</div>";
} else if (id == "opponent-crest" && desk.at("nextFixture").is_object()) {
const auto &next = desk.at("nextFixture");
const auto &other = next.at(next.at("home").at("id") == team.at("id") ? "away" : "home");
+2 -2
View File
@@ -55,7 +55,7 @@ std::string App::render_desktop() {
"identity", "id=\"desktop-identity\"") +
"<div class=\"info-date\">" + std::string(widget_data_.at("matchday")==0?"Saisonvorbereitung":std::to_string(widget_data_.at("matchday").get<int>())+". Spieltag") + "<small>" +
esc(widget_data_.at("season").get<std::string>()) +
"</small></div><div class=\"info-cash\"><small>"+std::string(national?"Aufgabenbereich":"Guthaben")+"</small><strong>" +
"</small></div><div class=\"info-cash\"><small>"+std::string(national?"Aufgabenbereich":"Guthaben")+"</small><strong class=\"" + money_classes(national ? 0 : s.state.at("cash").get<int64_t>()) + "\">" +
(national?std::string("Nationalmannschaft"):cash(s.state.value("cash", int64_t(0)))) + "</strong></div></div>";
if(desktop_.value("grid",true))for(int row=0;row<7;++row)for(int col=0;col<15;++col)out+="<span class=\"desktop-grid-dot\" style=\"left:"+std::to_string(64+col*248)+"dp;top:"+std::to_string(224+row*248)+"dp;\"></span>";
for (const auto &[id, o] : desktop_["objects"].items()) {
@@ -139,7 +139,7 @@ std::string App::render_camp() {
stars + "</span></div>";
}
body += "<div class=\"field-row\"><strong>Preis</strong><strong "
"class=\"accent\">" +
"class=\"money-amount\">" +
(chosen->at("price").is_null() ? std::string("—") : (engine_mode_ ? money(chosen->at("price").get<int64_t>(), {{"code", "EUR"}, {"minor_units", 2}}) : cash(chosen->at("price").get<int64_t>()))) + "</strong></div>";
const std::array<const char *, 4> focus = {"Kondition", "Technik", "Spiel",
"Erholung"};
+1
View File
@@ -66,6 +66,7 @@
namespace bmh::modern_ui {
namespace {
std::string esc(std::string_view value) { return editor::escaped(value); }
std::string money_classes(int64_t value) { return value < 0 ? "money-amount is-negative" : "money-amount"; }
std::string scalar(double n) {
std::ostringstream s;
s.imbue(std::locale::classic());
+1 -1
View File
@@ -97,7 +97,7 @@ std::string App::widget(const std::string &id, const Json &o) {
glyph("arrow-diagonal", 26) + "</span></div>";
if (id == "account")
return heading("Vereinskasse") +
"<div class=\"desk-account-main\"><span>Guthaben</span><strong>" +
"<div class=\"desk-account-main\"><span>Guthaben</span><strong class=\"" + money_classes(s.state.at("cash").get<int64_t>()) + "\">" +
cash(s.state.at("cash")) +
"</strong></div><div "
"class=\"desk-account-bottom\"><div><span>Sparbuch</span><strong>" +