Complete Modern game setup and manager selection with staged confirmation (by Codex)

This commit is contained in:
Codex committed 2026-10-26 09:50:22 +01:00
1 parent a0bb8b47dc
commit 967520190d
18 files changed
+1784 -531

No files matched your search

+37 -2
View File
@@ -401,6 +401,12 @@ class App final : public Rml::EventListener {
Json managers_draft_ = Json::array(),
start_options_ = {{"duration", 5}, {"difficulty", 3}, {"players", 1},
{"mode", 3}, {"league", true}, {"world", true}};
std::shared_ptr<const Catalog> entry_catalog_;
const DataSource *entry_source_ = nullptr;
uint64_t entry_revision_ = 0;
std::string club_search_, entry_return_scene_ = "main",
entry_picker_country_, entry_picker_league_;
bool manager_confirm_ = false, manager_success_ = false;
int manager_index_ = 0;
bool manager_picker_ = false, adding_manager_ = false;
struct Drag {
@@ -584,10 +590,14 @@ class App final : public Rml::EventListener {
return nullptr;
}
void load_world(const fs::path &file) {
reset_settings();
reset_files();
auto next = Catalog::open(file);
auto demo = std::make_unique<DemoSource>(next);
publish_world(std::move(next), std::move(demo));
}
void publish_world(std::shared_ptr<const Catalog> next,
std::unique_ptr<DemoSource> demo) {
reset_settings();
reset_files();
ticket_.reset();
renderer_.world(next);
world_ = std::move(next);
@@ -725,6 +735,24 @@ class App final : public Rml::EventListener {
void render_context();
void context_menu(const std::string &id, int x, int y);
void drag_event(Rml::Event &);
std::shared_ptr<const Catalog> entry_world() const {
return entry_catalog_ ? entry_catalog_ : world_;
}
bool entry_name_valid() const;
bool entry_used_club(const std::string &) const;
bool entry_used_portrait(int) const;
bool entry_full() const { return adding_manager_ && managers_draft_.size() >= 4; }
void entry_begin();
void entry_add();
void entry_cancel();
void entry_choose_defaults();
void entry_sync_club();
void entry_confirm();
bool entry_action(const std::string &, Rml::Element *);
bool entry_change(Rml::Element *);
bool entry_input(Rml::Element *);
bool entry_event(Rml::Event &);
Json entry_snapshot() const;
std::string render_newgame();
std::string render_manager();
std::string render_opening();
@@ -853,6 +881,11 @@ class App final : public Rml::EventListener {
element("canvas")->SetInnerRML(markup);
element("canvas")->SetProperty("overflow", statistics_trophy_.contains("asset") ? "visible" : "hidden");
setting_menu_markup_ = false;
if (manager_confirm_ || manager_success_) {
Rml::ElementList behind;
doc_->QuerySelectorAll(behind, "#entry-manager-underlay button,#entry-manager-underlay input,#entry-manager-underlay select,.window>.titlebar button");
for (auto *node : behind) node->SetProperty("pointer-events", "none");
}
news_after_render();
if (!report_detail_kind_.empty() || !planning_dialog_.empty() || !contracts_dialog_.empty() || !toto_dialog_.empty() || !transfer_dialog_.empty() || !career_view_.value("dialog", "").empty() || !stadium_view_.value("dialog", "").empty()) {
Rml::ElementList behind;
@@ -1300,6 +1333,8 @@ public:
return 0;
}
};
#include "modern/ui/entry_controls.inc"
#include "modern/ui/entry_screens.inc"
#include "modern/ui/controls.inc"
#include "modern/ui/widgets_screens.inc"
#include "modern/ui/widgets_controls.inc"