The career as a notebook: a book on a table instead of a desk with windows
After the design mock-up: a leather-bound book with a seam, a stack of sheets, markers at the left edge for nine categories and at the top edge for their pages, a paper clip, a pencil in its loop, and the whistle that kicks off. Wood, leather and paper are computed from noise and tinted by the skin. The home pages carry the cards on a grid of 8 x 5: up to five pages that can be named, cards moved by dragging, menus with the right mouse button for sizes, adding and removing. The cards are drawn anew from one model that the demo and the engine both fill. The career menus are sheets of the book for now, in their old format; the picture of a page's subject lies very faintly on the paper of every page. The status line at the foot is gone. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
b2500eb7b6
commit
0d8e7b4dd4
10 files changed
+1300
-73
No files matched your search
+48
-4
@@ -199,6 +199,21 @@ public:
|
||||
const auto &r = entries_.at(token).raster;
|
||||
return {token, r.width, r.height};
|
||||
}
|
||||
// A picture computed by the program itself; `key` names its variant (e.g. the skin).
|
||||
Picture texture(const std::string &slot, const std::string &key, const std::function<editor::images::Raster()> &make) {
|
||||
const auto token = "modern-texture-" + slot + ".png";
|
||||
auto found = entries_.find(token);
|
||||
if (found == entries_.end() || found->second.key != key) {
|
||||
if (const auto loaded = loaded_sources_.find(token); loaded != loaded_sources_.end()) {
|
||||
Rml::ReleaseTexture(loaded->second, this);
|
||||
loaded_sources_.erase(loaded);
|
||||
}
|
||||
auto raster = make();
|
||||
entries_[token] = {key, false, raster.width, std::move(raster)};
|
||||
}
|
||||
const auto &r = entries_.at(token).raster;
|
||||
return {token, r.width, r.height};
|
||||
}
|
||||
Picture generated_png(const std::string &slot,const std::string &png){
|
||||
const auto token="modern-generated-"+slot+".png",digest=content::sha256(png);
|
||||
auto found=entries_.find(token);
|
||||
@@ -639,7 +654,7 @@ class App final : public Rml::EventListener {
|
||||
{"lineup", "bench"}, {"tactics", "bench"}, {"squad", "locker"}, {"contracts", "locker"}, {"transfer", "press"},
|
||||
{"tables", "stand"}, {"league", "stand"}, {"other", "stand"}, {"strengths", "stand"}, {"statistics", "kickoff"},
|
||||
{"scorers", "kickoff"}, {"fairplay", "kickoff"}};
|
||||
if (theme_ != "silver") return {};
|
||||
if (theme_ != "silver" || notebook_page()) 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";
|
||||
@@ -667,11 +682,15 @@ class App final : public Rml::EventListener {
|
||||
}
|
||||
} catch (const std::exception &) {
|
||||
}
|
||||
return "<div class=\"sheet-under first" + arriving + "\"></div><div class=\"sheet-under second" + arriving + "\"></div><div class=\"window" + arriving + "\"><div class=\"titlebar\"" + club_rule + ">" +
|
||||
// on a page of the notebook the sheet has no frame of its own and lies where the book lies
|
||||
const bool page = notebook_page();
|
||||
if (page) club_mark.clear();
|
||||
return (page ? "<div class=\"nb-sheet-layer\" style=\"top:" + scalar(notebook_top()) + "dp;\"><div class=\"window nb-sheet" + arriving + "\"><div class=\"titlebar\">"
|
||||
: "<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>" + window_art() + "<div class=\"content\">" +
|
||||
content + "</div>" + (amount_ ? render_amount() : "") + "</div>";
|
||||
content + "</div>" + (amount_ ? render_amount() : "") + "</div>" + (page ? "</div>" : "");
|
||||
}
|
||||
std::string
|
||||
select(const std::string &id,
|
||||
@@ -835,6 +854,28 @@ class App final : public Rml::EventListener {
|
||||
int calendar_month_ = -1, calendar_from_ = 0;
|
||||
std::string calendar_anim_;
|
||||
std::string render_calendar_year();
|
||||
// the career's notebook (notebook.inc)
|
||||
double notebook_top() const;
|
||||
std::string notebook_section_of(const std::string &route) const;
|
||||
std::string notebook_shell(const std::function<bool(const std::string &)> &enabled, const std::string &head);
|
||||
Picture notebook_art();
|
||||
// the home page (notebook_home.inc)
|
||||
std::string notebook_crest(const Json &team, double size);
|
||||
std::string notebook_chart(const std::string &slot, const std::vector<std::pair<std::vector<int>, std::string>> &series, double w, double h);
|
||||
std::string notebook_card(const std::string &type, int cols, int rows, const Json &model, std::string &look);
|
||||
Json ¬ebook_pages();
|
||||
void notebook_pages_changed();
|
||||
void notebook_home_do(const std::string &command);
|
||||
bool notebook_home_event(Rml::Event &event);
|
||||
// the home pages and their cards; an open menu, a page being named, a card being dragged
|
||||
Json home_, home_menu_, home_drag_, home_model_;
|
||||
int home_page_ = 0, home_rename_ = -1;
|
||||
bool home_swallow_click_ = false;
|
||||
std::string notebook_home(const Json &model);
|
||||
Json notebook_news();
|
||||
static Json notebook_lamps(Json lamps);
|
||||
// a career menu is a page of the notebook, not a window of its own
|
||||
bool notebook_page() const { return (scene_ == "desktop" || scene_ == "engine") && !menu_.empty(); }
|
||||
bool calendar_month_action(const std::string &, Rml::Element *);
|
||||
void calendar_open_month(int);
|
||||
Json planning_calendar() const;
|
||||
@@ -983,7 +1024,8 @@ class App final : public Rml::EventListener {
|
||||
}
|
||||
// Called after the stage was rebuilt: zoom in when it now shows a menu window.
|
||||
void sync_window_zoom() {
|
||||
const bool wanted = doc_->QuerySelector(".window") != nullptr || doc_->QuerySelector(".live-stage") != nullptr;
|
||||
// a page of the notebook is no window: the book keeps the whole stage
|
||||
const bool wanted = (doc_->QuerySelector(".window") != nullptr && doc_->QuerySelector(".nb-sheet") == nullptr) || doc_->QuerySelector(".live-stage") != nullptr;
|
||||
if (!wanted) window_shown_ = "\x01";
|
||||
// the career's desk hangs from the top edge of a taller screen, so its bar is the
|
||||
// screen's bar and the spare height shows the stadium below
|
||||
@@ -1708,6 +1750,8 @@ public:
|
||||
#include "modern/ui/engine_almanac.inc"
|
||||
#include "modern/ui/engine_reports.inc"
|
||||
#include "modern/ui/calendar_year.inc"
|
||||
#include "modern/ui/notebook.inc"
|
||||
#include "modern/ui/notebook_home.inc"
|
||||
#include "modern/ui/finance_simulation.inc"
|
||||
#include "modern/ui/statistics_analysis.inc"
|
||||
#include "modern/ui/engine_rankings.inc"
|
||||
|
||||
Reference in new issue
Block a user