Skip to content

Commit

Permalink
gui2/tcampaign_settings: Request unescaped era names
Browse files Browse the repository at this point in the history
Otherwise everything gets displayed with a caret prefix because GUI1
markup is of course not recognized by GUI2.
  • Loading branch information
irydacea committed Jun 20, 2015
1 parent 8c5830d commit f6c77b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/game_initialization/create_engine.cpp
Expand Up @@ -725,13 +725,17 @@ std::vector<std::string> create_engine::levels_menu_item_names() const
}

std::vector<std::string> create_engine::extras_menu_item_names(
const MP_EXTRA extra_type) const
const MP_EXTRA extra_type, bool escape_markup) const
{
std::vector<std::string> names;

BOOST_FOREACH(extras_metadata_ptr extra,
get_const_extras_by_type(extra_type)) {
names.push_back(font::NULL_MARKUP + extra->name);
if (escape_markup) {
names.push_back(font::NULL_MARKUP + extra->name);
} else {
names.push_back(extra->name);
}
}

return names;
Expand Down
2 changes: 1 addition & 1 deletion src/game_initialization/create_engine.hpp
Expand Up @@ -222,7 +222,7 @@ class create_engine

std::vector<std::string> levels_menu_item_names() const;
std::vector<std::string> extras_menu_item_names(
const MP_EXTRA extra_type) const;
const MP_EXTRA extra_type, bool escape_markup = true) const;

level& current_level() const;
const extras_metadata& current_extra(const MP_EXTRA extra_type) const;
Expand Down
2 changes: 1 addition & 1 deletion src/gui/dialogs/campaign_settings.cpp
Expand Up @@ -102,7 +102,7 @@ void tcampaign_settings::update_lists(twindow& window)
era_list.clear();

if (engine_.current_level().allow_era_choice()) {
BOOST_FOREACH(std::string era, engine_.extras_menu_item_names(ng::create_engine::ERA)) {
BOOST_FOREACH(std::string era, engine_.extras_menu_item_names(ng::create_engine::ERA, false)) {
std::map<std::string, string_map> row;
string_map column;

Expand Down

0 comments on commit f6c77b7

Please sign in to comment.