Bind player rankings and fair play to recorded season events (by Codex)
This commit is contained in:
1 parent
6b4aa9772d
commit
738ecc7a09
27 files changed
+436
-36
No files matched your search
@@ -16,6 +16,10 @@ App::report_picker_items(const std::string &kind) const {
|
||||
std::vector<std::pair<std::string, std::string>> items;
|
||||
if (!world_ || !report_picker_kind(kind))
|
||||
return items;
|
||||
if(engine_mode_&&menu_=="scorers") {
|
||||
if(kind=="scorer-scope")return {{"0","Gesamte Liga"},{"1","Eigener Verein"}};
|
||||
return engine_reports_picker_items(kind,engine_rankings_state_.at("league"));
|
||||
}
|
||||
if (engine_mode_ && (menu_=="tables"||menu_=="strengths"||menu_=="league"||menu_=="other")) return engine_reports_picker_items(kind);
|
||||
if (engine_mode_ && menu_ == "friendlies") return engine_friendly_picker_items(kind);
|
||||
if (menu_ == "statistics")
|
||||
@@ -75,6 +79,12 @@ App::report_picker_items(const std::string &kind) const {
|
||||
std::string App::report_picker_value(const std::string &kind) const {
|
||||
if (!world_ || !report_picker_kind(kind))
|
||||
return {};
|
||||
if(engine_mode_&&menu_=="scorers") {
|
||||
if(kind=="scorer-scope")return std::to_string(engine_rankings_state_.at("scope").get<int>());
|
||||
if(kind=="league")return engine_rankings_state_.at("league");
|
||||
for(const auto &l:engine_reports_index_.at("data").at("leagues"))if(l.at("id")==engine_rankings_state_.at("league"))return l.at("nationId").is_string()?l.at("nationId").get<std::string>():"__other__";
|
||||
return {};
|
||||
}
|
||||
if(engine_mode_&&menu_=="other")return kind=="competition"&&engine_other_value_.is_object()?engine_other_value_.at("viewId").get<std::string>():"";
|
||||
if(engine_mode_&&(menu_=="tables"||menu_=="strengths"||menu_=="league"||menu_=="other")){if(kind=="filter")return std::to_string(engine_reports_state_.at("filter").get<int>());if(kind=="league")return engine_reports_state_.at("league");const auto live_index=engine_report_index(engine_data_,engine_reports_index_);for(const auto &l:live_index.at("leagues"))if(l.at("id")==engine_reports_state_.at("league"))return l.at("nationId").is_string()?l.at("nationId").get<std::string>():"__other__";return {}; }
|
||||
if (menu_ == "statistics")
|
||||
@@ -217,7 +227,13 @@ bool App::report_picker_action(const std::string &action, Rml::Element *target)
|
||||
? Json(std::stoi(value)) : Json(value);
|
||||
close_report_picker(false);
|
||||
// Commit even an unchanged country: the Gold resets its first league.
|
||||
if(engine_mode_&&menu_=="other")engine_other_load(value,0);
|
||||
if(engine_mode_&&menu_=="scorers") {
|
||||
std::string league=engine_rankings_state_.at("league");int scope=engine_rankings_state_.at("scope");
|
||||
if(kind=="league")league=value;else if(kind=="scorer-scope")scope=std::stoi(value);
|
||||
else if(kind=="country")for(const auto &l:engine_reports_index_.at("data").at("leagues"))if((l.at("nationId").is_string()?l.at("nationId").get<std::string>():"__other__")==value){league=l.at("id");break;}
|
||||
rankings_remember_scroll();engine_rankings_load(league,scope);
|
||||
}
|
||||
else if(engine_mode_&&menu_=="other")engine_other_load(value,0);
|
||||
else if(engine_mode_&&(menu_=="tables"||menu_=="strengths"||menu_=="league"||menu_=="other")){
|
||||
std::string league=engine_reports_state_.at("league");int filter=engine_reports_state_.at("filter");
|
||||
if(kind=="league")league=value;
|
||||
|
||||
Reference in new issue
Block a user