A sheet may carry a faint picture of its subject
A data set's art.paper-<motif>.png (ball, seats, stand, kickoff, training, locker, fans) is drawn under a menu window's content in the light skin; without such pictures the sheet stays plain. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
8f607a9d89
commit
a87535018f
2 files changed
+22
-1
No files matched your search
+20
-1
@@ -614,6 +614,25 @@ class App final : public Rml::EventListener {
|
||||
esc(world_->name(*c)) + "</span></span>"
|
||||
: "";
|
||||
}
|
||||
// A sheet may carry a faint picture of its subject under its content: the data set's
|
||||
// "art.paper-<motif>.png" for the menu, else its general one. The paper's own tone and
|
||||
// gradient stay on top of the picture's; without such pictures the sheet is plain.
|
||||
std::string window_art() {
|
||||
static const std::map<std::string, std::string> motifs{
|
||||
{"stadium", "seats"}, {"advertising", "stand"}, {"environment", "fans"}, {"training", "training"}, {"camps", "training"},
|
||||
{"lineup", "kickoff"}, {"tactics", "kickoff"}, {"squad", "locker"}, {"contracts", "locker"}, {"transfer", "locker"},
|
||||
{"tables", "stand"}, {"league", "stand"}, {"other", "stand"}, {"strengths", "stand"}, {"statistics", "kickoff"},
|
||||
{"scorers", "kickoff"}, {"fairplay", "kickoff"}};
|
||||
if (theme_ != "silver") return {};
|
||||
const auto found = motifs.find(menu_);
|
||||
for (const std::string motif : {found == motifs.end() ? std::string("ball") : found->second, std::string("ball")}) {
|
||||
const auto key = "art.paper-" + motif + ".png";
|
||||
const auto art = renderer_.image(key, false, 2048);
|
||||
if (art.token.empty() || art.width <= 0 || art.height <= 0) continue;
|
||||
return "<div class=\"window-art\">" + picture(art, 2720, 1932, true) + "</div>";
|
||||
}
|
||||
return {};
|
||||
}
|
||||
std::string window(const std::string &heading, const std::string &content,
|
||||
bool close = true) {
|
||||
// a sheet of paper on two more; it slides in once when its menu opens, not on every redraw
|
||||
@@ -635,7 +654,7 @@ class App final : public Rml::EventListener {
|
||||
return "<div class=\"sheet-under first" + arriving + "\"></div><div class=\"sheet-under second" + arriving + "\"></div><div class=\"window" + arriving + "\"><div class=\"titlebar\"" + club_rule + ">" +
|
||||
(close ? btn("close", "<span>×</span>", "close", "id=\"window-close\" aria-label=\"" + std::string(menu_ == "bank" && bank_view_ != "entrance" ? "Zurück zur Bankhalle" : "Fenster schließen") + "\"")
|
||||
: "<span style=\"width:76dp;\"></span>") +
|
||||
"<h1>" + esc(heading) + "</h1>" + club_mark + "</div><div class=\"content\">" +
|
||||
"<h1>" + esc(heading) + "</h1>" + club_mark + "</div>" + window_art() + "<div class=\"content\">" +
|
||||
content + "</div>" + (amount_ ? render_amount() : "") + "</div>";
|
||||
}
|
||||
std::string
|
||||
|
||||
Reference in new issue
Block a user