Add read-only Almanac desktop and match history views (by Codex)
This commit is contained in:
1 parent
af60e499a2
commit
d42c855843
29 files changed
+2009
-35
No files matched your search
@@ -74,7 +74,7 @@ const std::vector<std::string> &desktop_routes() {
|
||||
"camp", "training", "transfer", "tactics", "settings",
|
||||
"scorers", "advertising", "stadium", "statistics", "environment",
|
||||
"fairplay", "highscore", "contracts", "balance", "newplayer",
|
||||
"news"};
|
||||
"news", "almanac"};
|
||||
return value;
|
||||
}
|
||||
const std::vector<WidgetDefinition> &widget_definitions() {
|
||||
@@ -170,6 +170,21 @@ bool valid_desktop(const Json &layout) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool migrate_desktop(Json &layout) {
|
||||
try {
|
||||
if (layout.at("objects").contains("app-almanac"))
|
||||
return valid_desktop(layout);
|
||||
auto next = layout;
|
||||
next["objects"]["app-almanac"] = object(0, 0, 1, 1, false, true);
|
||||
if (!valid_desktop(next) ||
|
||||
!find_space(next, "app-almanac", left, top, false))
|
||||
return false;
|
||||
layout = std::move(next);
|
||||
return true;
|
||||
} catch (const Json::exception &) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
bool place_desktop_object(Json &layout, const std::string &id, int x, int y,
|
||||
bool nearest) {
|
||||
if (!valid_desktop(layout) || !layout["objects"].contains(id))
|
||||
|
||||
Reference in new issue
Block a user