The entry into the game on a pad: main menu, new game, managers, clubs, the season's opening
The main menu and everything up to the first day are written on one pad that lies in the middle of a table: the settings of a new game, the managers with their portraits, the clubs of a league, the entrants of the European cups, the cup draw and its overview. Saved games, mods and the sound open on the same pad. The table fills the window at any aspect while the pad stays whole. There is one style of portrait. The main menu asks before it leaves, and the ribbon of the notebook leads back to it. A stage that changes its height while it is drawn is now drawn once more; before, the notebook kept the height of the screen it came from. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
1 parent
f25abc2e16
commit
048ccbecaa
20 files changed
+637
-812
No files matched your search
+26
-9
@@ -432,6 +432,7 @@ class App final : public Rml::EventListener {
|
||||
// A menu window (2720 x 2040 at the middle of the stage) is shown as large as the screen
|
||||
// allows; the desk behind it is cropped. Without a window the whole stage is fitted.
|
||||
bool window_zoom_ = false;
|
||||
bool entry_stage_ = false; // the stage shows the table of the entry: it fills the window
|
||||
std::string scene_ = "main", menu_, theme_ = "silver", active_mod_,
|
||||
selected_mod_, notice_, country_ = "nation:de", league_,
|
||||
selected_club_;
|
||||
@@ -895,6 +896,13 @@ class App final : public Rml::EventListener {
|
||||
bool page_native() const;
|
||||
static std::string pg(double units);
|
||||
static std::string pg_css(std::string_view css);
|
||||
// the entry into the game: one pad on a table (front_screens.inc)
|
||||
static constexpr double kEntryUnit = 2.29665;
|
||||
static std::string es(double units);
|
||||
std::string entry_stage(const std::string &paper, const std::string &over = {});
|
||||
std::string entry_sheet(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right = {});
|
||||
std::string entry_pad(const std::string &kicker, const std::string &title, const std::string &body, const std::string &foot, const std::string &right = {}, const std::string &over = {});
|
||||
std::string render_files_pad();
|
||||
static std::string pg_upper(const std::string &text);
|
||||
static std::string pg_kicker(const std::string &text, const std::string &css = {});
|
||||
static std::string pg_stat(const std::string &label, const std::string &value, const std::string &sub = {});
|
||||
@@ -1076,8 +1084,10 @@ class App final : public Rml::EventListener {
|
||||
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
|
||||
const bool desk = !wanted && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
||||
if (wanted == window_zoom_ && desk == desk_top_) return;
|
||||
const bool entry = doc_->QuerySelector(".es-stage") != nullptr;
|
||||
const bool desk = !wanted && !entry && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
||||
if (wanted == window_zoom_ && desk == desk_top_ && entry == entry_stage_) return;
|
||||
entry_stage_ = entry;
|
||||
window_zoom_ = wanted;
|
||||
desk_top_ = desk;
|
||||
resize();
|
||||
@@ -1090,11 +1100,13 @@ class App final : public Rml::EventListener {
|
||||
return;
|
||||
scale_ = std::min(double(pw) / 3840, double(ph) / 2160);
|
||||
if (window_zoom_) scale_ = std::max(scale_, std::min(double(pw) / 2760, double(ph) / 2080));
|
||||
// the table of the entry fills the window; its pad (930 x 690 units about the middle) stays whole
|
||||
if (entry_stage_) scale_ = std::min({std::max(double(pw) / 3840, double(ph) / 2160), double(pw) / (930 * kEntryUnit), double(ph) / (690 * kEntryUnit)});
|
||||
canvas_left_ = (pw - 3840 * scale_) / 2;
|
||||
canvas_top_ = (ph - 2160 * scale_) / 2;
|
||||
if (desk_top_ && canvas_top_ > 0) canvas_top_ = 0;
|
||||
// a career's desk is as high as the screen shows of it; menus keep their 16:9 stage
|
||||
const bool desk_scene = scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub";
|
||||
const bool desk_scene = !entry_stage_ && (scene_ == "engine" || scene_ == "desktop" || scene_ == "managerhub");
|
||||
const double fitted = std::min(double(pw) / 3840, double(ph) / 2160);
|
||||
const int stage_height = desk_scene ? std::clamp(int(ph / fitted), 2160, 2880) : 2160;
|
||||
if (stage_height != desktop_height()) {
|
||||
@@ -1199,27 +1211,32 @@ class App final : public Rml::EventListener {
|
||||
context_dirty_ = true;
|
||||
doc_->SetClassNames(body_classes());
|
||||
std::string markup;
|
||||
if (scene_ == "main")
|
||||
// from the main menu the saves and the sound are written on the pad as well
|
||||
const bool pad_menu = scene_ == "main" && (menu_ == "load" || menu_ == "settings");
|
||||
if (pad_menu)
|
||||
markup = menu_ == "load" ? render_files(false, false) : render_settings();
|
||||
else if (scene_ == "main")
|
||||
markup = main_menu();
|
||||
else if (scene_ == "mods")
|
||||
markup = mods_page();
|
||||
else if (scene_ == "newgame")
|
||||
markup = main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_newgame()+"</div>";
|
||||
markup = render_newgame();
|
||||
else if (scene_ == "manager")
|
||||
markup = (adding_manager_?render_desktop():main_menu())+"<div class=\"fill\" style=\"z-index:100;\">"+render_manager()+"</div>";
|
||||
markup = render_manager();
|
||||
else if (scene_ == "managerhub")
|
||||
markup = render_desktop()+"<div class=\"fill menu-layer\" style=\"z-index:100;\">"+render_career()+"</div>";
|
||||
else if (scene_ == "opening")
|
||||
markup = main_menu()+"<div class=\"fill\" style=\"z-index:100;\">"+render_opening()+"</div>";
|
||||
markup = render_opening();
|
||||
else if (scene_ == "live")
|
||||
markup = render_live();
|
||||
else if (source_)
|
||||
markup = render_desktop();
|
||||
if (!menu_.empty())
|
||||
if (!menu_.empty() && !pad_menu)
|
||||
markup += render_menu(menu_);
|
||||
setting_menu_markup_ = true;
|
||||
notebook_finish(markup);
|
||||
element("canvas")->SetInnerRML(markup);
|
||||
needs_render_ = false;
|
||||
++document_generation_;
|
||||
sync_window_zoom();
|
||||
live_detail_pending_ = live_ticker_pending_ = false;
|
||||
@@ -1262,7 +1279,7 @@ class App final : public Rml::EventListener {
|
||||
: theme_ == "matchday"
|
||||
? "saturate(0.13) brightness(0.56)"
|
||||
: "saturate(0.34) brightness(0.70)");
|
||||
needs_render_ = false;
|
||||
// (a stage that changed its height while this was drawn asks for one more drawing)
|
||||
last_rendered_menu_ = menu_;
|
||||
last_report_state_ = report_state;
|
||||
scale_chalk_shadow();
|
||||
|
||||
Reference in new issue
Block a user