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:
Charles Dang 2018-05-15 11:53:24 +11:00
parent 3e9424fa33
commit 50a3960abd
4 changed files with 5 additions and 59 deletions

View file

@ -425,10 +425,6 @@ std::string create_engine::select_campaign_difficulty(int set_value)
difficulties.push_back(d["define"]); difficulties.push_back(d["define"]);
} }
if(difficulties.empty()) {
difficulties = utils::split(current_level().data()["difficulties"]);
}
// No difficulties found. Exit // No difficulties found. Exit
if(difficulties.empty()) { if(difficulties.empty()) {
return ""; return "";

View file

@ -79,36 +79,6 @@ config generate_difficulty_config(const config& source)
// Populate local config with difficulty children // Populate local config with difficulty children
result.append_children(source, "difficulty"); 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; return result;
} }

View file

@ -95,27 +95,11 @@ void faction_select::pre_show(window& window)
// flag_rgb here is unrelated to any handling in the unit class // 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"; const std::string flag_rgb = !side["flag_rgb"].empty() ? side["flag_rgb"].str() : "magenta";
// Handle legacy DescriptionWML format. item["label"] = (formatter() << side["image"] << "~RC(" << flag_rgb << ">" << tc_color_ << ")").str();
if(name.find_first_of("=") != std::string::npos) { data.emplace("faction_image", item);
gui2::legacy_menu_item parsed(name, "Use separate name= and image= keys. Multiple text columns are no longer supported.");
if(!side.has_attribute("image")) { item["label"] = name;
item["label"] = (formatter() << parsed.icon() << "~RC(" << flag_rgb << ">" << tc_color_ << ")").str(); data.emplace("faction_name", item);
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);
}
list.add_row(data); list.add_row(data);
} }

View file

@ -258,11 +258,7 @@ void mp_options_helper::display_custom_options(const std::string& type, int node
} else if(opt.key == "spacer") { } else if(opt.key == "spacer") {
option_node.add_child("options_spacer_node", empty_map); option_node.add_child("options_spacer_node", empty_map);
} else if(opt.key == "choice" || opt.key == "combo") { } else if(opt.key == "choice") {
if(opt.key == "combo") {
deprecated_message("combo", DEP_LEVEL::FOR_REMOVAL, {1, 15, 0}, "Use [choice] instead.");
}
if(!option_cfg.has_child("item")) { if(!option_cfg.has_child("item")) {
continue; continue;
} }