Port career setup, manager hub and context-aware native UI (by Codex)
This commit is contained in:
1 parent
d88bf2872a
commit
d085697bb9
37 files changed
+1447
-421
No files matched your search
@@ -84,6 +84,8 @@ void App::entry_begin() {
|
||||
bind_world(entry_catalog_);
|
||||
start_options_ = {{"duration", 5}, {"difficulty", 3}, {"players", 1},
|
||||
{"mode", 3}, {"league", true}, {"world", true}};
|
||||
if(source_ && world_ && entry_catalog_->manifest().at("id")==world_->manifest().at("id"))start_options_=snap().state.at("edits").at("setup");
|
||||
start_options_["mode"]=3;
|
||||
adding_manager_ = false;
|
||||
managers_draft_ = Json::array();
|
||||
manager_index_ = 0;
|
||||
@@ -240,14 +242,15 @@ bool App::entry_action(const std::string &action, Rml::Element *target) {
|
||||
return true;
|
||||
}
|
||||
if (action == "setup-step") {
|
||||
start_options_["mode"]=3;
|
||||
if(id=="mode")return true;
|
||||
const auto step = target->GetAttribute<int>("data-step", 0);
|
||||
const int limit = id == "duration" ? 5
|
||||
: id == "difficulty" ? 10
|
||||
: id == "players"
|
||||
? (start_options_.value("league", true) ? 4 : 1)
|
||||
: 3;
|
||||
if (id == "duration" || id == "difficulty" || id == "players" ||
|
||||
id == "mode")
|
||||
if (id == "duration" || id == "difficulty" || id == "players")
|
||||
start_options_[id] =
|
||||
std::clamp(start_options_.value(id, 1) + step, 1, limit);
|
||||
const int current = start_options_.value(id, 1);
|
||||
@@ -291,6 +294,7 @@ bool App::entry_action(const std::string &action, Rml::Element *target) {
|
||||
}
|
||||
return true;
|
||||
} else if (action == "manager-clubs") {
|
||||
if(career_national_entry()||entry_full())return true;
|
||||
selections_["manager-name"] = field("manager-name");
|
||||
entry_picker_country_ = country_;
|
||||
entry_picker_league_ = league_;
|
||||
|
||||
Reference in new issue
Block a user