Removed a bunch of things deprecated at level 3
* Legacy campaign difficulty syntax * [combo] in [modification]s * Support for legacy DescriptionWML in the MP Faction Select dialog
This commit is contained in:
parent
3e9424fa33
commit
50a3960abd
4 changed files with 5 additions and 59 deletions
|
@ -425,10 +425,6 @@ std::string create_engine::select_campaign_difficulty(int set_value)
|
|||
difficulties.push_back(d["define"]);
|
||||
}
|
||||
|
||||
if(difficulties.empty()) {
|
||||
difficulties = utils::split(current_level().data()["difficulties"]);
|
||||
}
|
||||
|
||||
// No difficulties found. Exit
|
||||
if(difficulties.empty()) {
|
||||
return "";
|
||||
|
|
|
@ -79,36 +79,6 @@ config generate_difficulty_config(const config& source)
|
|||
|
||||
// Populate local config with difficulty children
|
||||
result.append_children(source, "difficulty");
|
||||
|
||||
// Convert legacy format to new-style config if latter not present
|
||||
if(result.empty() && source.has_attribute("difficulties")) {
|
||||
deprecated_message("[campaign]difficulties", DEP_LEVEL::FOR_REMOVAL, {1, 15, 0}, "Use [difficulty] instead.");
|
||||
if(source.has_attribute("difficulty_descriptions")) {
|
||||
deprecated_message("[campaign]difficulty_descriptions", DEP_LEVEL::FOR_REMOVAL, {1, 15, 0}, "Use [difficulty] instead.");
|
||||
}
|
||||
|
||||
std::vector<std::string> difficulty_list = utils::split(source["difficulties"]);
|
||||
std::vector<std::string> difficulty_opts = utils::split(source["difficulty_descriptions"], ';');
|
||||
|
||||
if(difficulty_opts.size() != difficulty_list.size()) {
|
||||
difficulty_opts = difficulty_list;
|
||||
}
|
||||
|
||||
for(std::size_t i = 0; i < difficulty_opts.size(); ++i) {
|
||||
config temp;
|
||||
gui2::legacy_menu_item parsed(difficulty_opts[i], "Use [difficulty] instead.");
|
||||
|
||||
temp["define"] = difficulty_list[i];
|
||||
temp["image"] = parsed.icon();
|
||||
temp["label"] = parsed.label();
|
||||
temp["description"] = parsed.description();
|
||||
temp["default"] = parsed.is_default();
|
||||
temp["old_markup"] = true; // To prevent double parentheses in the dialog
|
||||
|
||||
result.add_child("difficulty", std::move(temp));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
@ -95,27 +95,11 @@ void faction_select::pre_show(window& window)
|
|||
// flag_rgb here is unrelated to any handling in the unit class
|
||||
const std::string flag_rgb = !side["flag_rgb"].empty() ? side["flag_rgb"].str() : "magenta";
|
||||
|
||||
// Handle legacy DescriptionWML format.
|
||||
if(name.find_first_of("=") != std::string::npos) {
|
||||
gui2::legacy_menu_item parsed(name, "Use separate name= and image= keys. Multiple text columns are no longer supported.");
|
||||
item["label"] = (formatter() << side["image"] << "~RC(" << flag_rgb << ">" << tc_color_ << ")").str();
|
||||
data.emplace("faction_image", item);
|
||||
|
||||
if(!side.has_attribute("image")) {
|
||||
item["label"] = (formatter() << parsed.icon() << "~RC(" << flag_rgb << ">" << tc_color_ << ")").str();
|
||||
data.emplace("faction_image", item);
|
||||
}
|
||||
|
||||
item["label"] = parsed.label();
|
||||
if(!parsed.description().empty()) {
|
||||
item["label"] += " " + parsed.description();
|
||||
}
|
||||
data.emplace("faction_name", item);
|
||||
} else {
|
||||
item["label"] = (formatter() << side["image"] << "~RC(" << flag_rgb << ">" << tc_color_ << ")").str();
|
||||
data.emplace("faction_image", item);
|
||||
|
||||
item["label"] = name;
|
||||
data.emplace("faction_name", item);
|
||||
}
|
||||
item["label"] = name;
|
||||
data.emplace("faction_name", item);
|
||||
|
||||
list.add_row(data);
|
||||
}
|
||||
|
|
|
@ -258,11 +258,7 @@ void mp_options_helper::display_custom_options(const std::string& type, int node
|
|||
} else if(opt.key == "spacer") {
|
||||
option_node.add_child("options_spacer_node", empty_map);
|
||||
|
||||
} else if(opt.key == "choice" || opt.key == "combo") {
|
||||
if(opt.key == "combo") {
|
||||
deprecated_message("combo", DEP_LEVEL::FOR_REMOVAL, {1, 15, 0}, "Use [choice] instead.");
|
||||
}
|
||||
|
||||
} else if(opt.key == "choice") {
|
||||
if(!option_cfg.has_child("item")) {
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue