diff --git a/src/controller_base.cpp b/src/controller_base.cpp index 544b96e25702..191a5348dacd 100644 --- a/src/controller_base.cpp +++ b/src/controller_base.cpp @@ -450,7 +450,7 @@ void controller_base::show_menu( const hotkey::hotkey_command& command = hotkey::get_hotkey_command(id); if(cmd_exec->can_execute_command(command) && (!context_menu || in_context_menu(command.id))) { - items.emplace_back(config{"id", id}); + items.emplace_back("id", id); } } diff --git a/src/editor/controller/editor_controller.cpp b/src/editor/controller/editor_controller.cpp index 08b79171b9e9..4e25d1876116 100644 --- a/src/editor/controller/editor_controller.cpp +++ b/src/editor/controller/editor_controller.cpp @@ -651,7 +651,7 @@ bool editor_controller::do_execute_command(const hotkey::hotkey_command& cmd, in sound::play_music_once(music_tracks_[index].id()); get_current_map_context().add_to_playlist(music_tracks_[index]); std::vector items; - items.emplace_back(config {"id", "editor-playlist"}); + items.emplace_back("id", "editor-playlist"); std::shared_ptr b = gui_->find_menu_button("menu-playlist"); show_menu(items, b->location().x +1, b->location().y + b->height() +1, false, *gui_); return true; @@ -1020,7 +1020,7 @@ void editor_controller::show_menu(const std::vector& items_arg, int xloc if((can_execute_command(command) && (!context_menu || in_context_menu(command.id))) || command.id == hotkey::HOTKEY_NULL) { - items.emplace_back(config {"id", id}); + items.emplace_back("id", id); } } diff --git a/src/editor/map/context_manager.cpp b/src/editor/map/context_manager.cpp index 0c4d5c45d190..25b1e94608d8 100644 --- a/src/editor/map/context_manager.cpp +++ b/src/editor/map/context_manager.cpp @@ -326,7 +326,7 @@ void context_manager::expand_open_maps_menu(std::vector& items, int i) const std::string label = ss.str(); const std::string details = get_menu_marker(changed); - contexts.emplace_back(config {"label", label, "details", details}); + contexts.emplace_back("label", label, "details", details); } items.insert(pos, contexts.begin(), contexts.end()); @@ -389,7 +389,7 @@ void context_manager::expand_areas_menu(std::vector& items, int i) const std::string label = ss.str(); const std::string details = get_menu_marker(changed); - area_entries.emplace_back(config {"label", label, "details", details}); + area_entries.emplace_back("label", label, "details", details); } items.insert(pos, area_entries.begin(), area_entries.end()); @@ -413,7 +413,7 @@ void context_manager::expand_sides_menu(std::vector& items, int i) label << teamname; } - contexts.emplace_back(config {"label", label.str()}); + contexts.emplace_back("label", label.str()); } items.insert(pos, contexts.begin(), contexts.end()); @@ -429,10 +429,10 @@ void context_manager::expand_time_menu(std::vector& items, int i) assert(tod_m != nullptr); for(const time_of_day& time : tod_m->times()) { - times.emplace_back(config { + times.emplace_back( "details", time.name, // Use 'details' field here since the image will take the first column - "image", time.image, - }); + "image", time.image + ); } items.insert(pos, times.begin(), times.end()); @@ -446,10 +446,10 @@ void context_manager::expand_local_time_menu(std::vector& items, int i) tod_manager* tod_m = get_map_context().get_time_manager(); for(const time_of_day& time : tod_m->times(get_map_context().get_active_area())) { - times.emplace_back(config { + times.emplace_back( "details", time.name, // Use 'details' field here since the image will take the first column - "image", time.image, - }); + "image", time.image + ); } items.insert(pos, times.begin(), times.end()); diff --git a/src/editor/palette/editor_palettes.cpp b/src/editor/palette/editor_palettes.cpp index 6bbd2edce487..30655ced33bf 100644 --- a/src/editor/palette/editor_palettes.cpp +++ b/src/editor/palette/editor_palettes.cpp @@ -62,10 +62,10 @@ void editor_palette::expand_palette_groups_menu(std::vector& items img += ".png"; } - groups.emplace_back(config { + groups.emplace_back( "label", groupname, - "icon", img, - }); + "icon", img + ); } items.insert(pos, groups.begin(), groups.end()); diff --git a/src/game_events/action_wml.cpp b/src/game_events/action_wml.cpp index e697eac21e83..d2565319f61e 100644 --- a/src/game_events/action_wml.cpp +++ b/src/game_events/action_wml.cpp @@ -711,7 +711,7 @@ WML_HANDLER_FUNCTION(set_variables,, cfg) for(std::vector::iterator i=split_vector.begin(); i!=split_vector.end(); ++i) { - data.emplace_back(config {key_name, *i}); + data.emplace_back(key_name, *i); } } } diff --git a/src/game_events/wmi_manager.cpp b/src/game_events/wmi_manager.cpp index 229bff676010..8b8fdcb29c92 100644 --- a/src/game_events/wmi_manager.cpp +++ b/src/game_events/wmi_manager.cpp @@ -130,7 +130,7 @@ void wmi_manager::get_items(const map_location& hex, && item->can_show(hex, gamedata, fc)) { // Include this item. items.push_back(item); - descriptions.emplace_back(config {"id", item->menu_text()}); + descriptions.emplace_back("id", item->menu_text()); } } } diff --git a/src/gui/dialogs/addon/manager.cpp b/src/gui/dialogs/addon/manager.cpp index b9738ce63523..9344bafaa60b 100644 --- a/src/gui/dialogs/addon/manager.cpp +++ b/src/gui/dialogs/addon/manager.cpp @@ -334,7 +334,7 @@ void addon_manager::pre_show(window& window) std::vector status_filter_entries; for(const auto& f : status_filter_types_) { - status_filter_entries.emplace_back(config {"label", t_string(f.second, GETTEXT_DOMAIN)}); + status_filter_entries.emplace_back("label", t_string(f.second, GETTEXT_DOMAIN)); } status_filter.set_values(status_filter_entries); @@ -346,7 +346,7 @@ void addon_manager::pre_show(window& window) std::vector type_filter_entries; for(const auto& f : type_filter_types_) { - type_filter_entries.emplace_back(config {"label", t_string(f.second, GETTEXT_DOMAIN), "checkbox", false}); + type_filter_entries.emplace_back("label", t_string(f.second, GETTEXT_DOMAIN), "checkbox", false); } type_filter.set_values(type_filter_entries); diff --git a/src/gui/dialogs/campaign_selection.cpp b/src/gui/dialogs/campaign_selection.cpp index fde55d9f0ace..cc49059d6e72 100644 --- a/src/gui/dialogs/campaign_selection.cpp +++ b/src/gui/dialogs/campaign_selection.cpp @@ -260,7 +260,7 @@ void campaign_selection::pre_show(window& window) for(const auto& mod : engine_.get_const_extras_by_type(ng::create_engine::MOD)) { const bool active = std::find(enabled.begin(), enabled.end(), mod->id) != enabled.end(); - mod_menu_values.emplace_back(config {"label", mod->name, "checkbox", active}); + mod_menu_values.emplace_back("label", mod->name, "checkbox", active); mod_states_.push_back(active); } diff --git a/src/gui/dialogs/multiplayer/faction_select.cpp b/src/gui/dialogs/multiplayer/faction_select.cpp index 7d756c13cb96..c8818e0db69e 100644 --- a/src/gui/dialogs/multiplayer/faction_select.cpp +++ b/src/gui/dialogs/multiplayer/faction_select.cpp @@ -157,13 +157,13 @@ void faction_select::on_faction_select(window& window) if(unit) { const std::string icon = formatter() << unit->image() << "~RC(" << unit->flag_rgb() << ">" << tc_color_ << ")"; - leaders.emplace_back(config {"label", unit->type_name(), "icon", icon}); + leaders.emplace_back("label", unit->type_name(), "icon", icon); } else if(leader == "random") { - leaders.emplace_back(config {"label", _("Random"), "icon", ng::random_enemy_picture}); + leaders.emplace_back("label", _("Random"), "icon", ng::random_enemy_picture); } else if(leader == "null") { - leaders.emplace_back(config {"label", font::unicode_em_dash}); + leaders.emplace_back("label", font::unicode_em_dash); } else { - leaders.emplace_back(config {"label", "?"}); + leaders.emplace_back("label", "?"); } } diff --git a/src/gui/dialogs/multiplayer/mp_create_game.cpp b/src/gui/dialogs/multiplayer/mp_create_game.cpp index f7c500bb9196..7afe374130ba 100644 --- a/src/gui/dialogs/multiplayer/mp_create_game.cpp +++ b/src/gui/dialogs/multiplayer/mp_create_game.cpp @@ -181,7 +181,7 @@ void mp_create_game::pre_show(window& win) // std::vector game_types; for(level_type_info& type_info : level_types_) { - game_types.emplace_back(config {"label", type_info.second}); + game_types.emplace_back("label", type_info.second); } if(game_types.empty()) { @@ -249,7 +249,7 @@ void mp_create_game::pre_show(window& win) std::vector era_names; for(const auto& era : create_engine_.get_const_extras_by_type(ng::create_engine::ERA)) { - era_names.emplace_back(config {"label", era->name, "tooltip", era->description}); + era_names.emplace_back("label", era->name, "tooltip", era->description); } if(era_names.empty()) { diff --git a/src/gui/dialogs/multiplayer/mp_staging.cpp b/src/gui/dialogs/multiplayer/mp_staging.cpp index 5ee9d9f35574..9bc03ca6675a 100644 --- a/src/gui/dialogs/multiplayer/mp_staging.cpp +++ b/src/gui/dialogs/multiplayer/mp_staging.cpp @@ -202,7 +202,7 @@ void mp_staging::add_side_node(window& window, ng::side_engine_ptr side) // We use an index-based loop in order to get the index of the selected option std::vector ai_options; for(unsigned i = 0; i < ai_algorithms_.size(); ++i) { - ai_options.emplace_back(config {"label", ai_algorithms_[i]->text}); + ai_options.emplace_back("label", ai_algorithms_[i]->text); if(ai_algorithms_[i]->id == side->ai_algorithm()) { selection = i; @@ -223,7 +223,7 @@ void mp_staging::add_side_node(window& window, ng::side_engine_ptr side) // std::vector controller_names; for(const auto& controller : side->controller_options()) { - controller_names.emplace_back(config {"label", controller.second}); + controller_names.emplace_back("label", controller.second); } menu_button& controller_selection = find_widget(&row_grid, "controller", false); @@ -290,10 +290,10 @@ void mp_staging::add_side_node(window& window, ng::side_engine_ptr side) // std::vector color_options; for(const auto& color : side->color_options()) { - color_options.emplace_back(config { + color_options.emplace_back( "label", font::get_color_string_pango(color), - "icon", (formatter() << "misc/status.png~RC(magenta>" << color << ")").str(), - }); + "icon", (formatter() << "misc/status.png~RC(magenta>" << color << ")").str() + ); } menu_button& color_selection = find_widget(&row_grid, "side_color", false); @@ -509,7 +509,7 @@ void mp_staging::network_handler(window& window) std::vector controller_names; for(const auto& controller : side->controller_options()) { - controller_names.emplace_back(config {"label", controller.second}); + controller_names.emplace_back("label", controller.second); } menu_button& controller_selection = find_widget(&row_grid, "controller", false); diff --git a/src/hotkey/hotkey_handler.cpp b/src/hotkey/hotkey_handler.cpp index c7031cd3c71d..7a75e9298fc0 100644 --- a/src/hotkey/hotkey_handler.cpp +++ b/src/hotkey/hotkey_handler.cpp @@ -410,13 +410,13 @@ void play_controller::hotkey_handler::expand_autosaves(std::vector& item if(savegame::save_game_exists(name, comp_format)) { newsaves.emplace_back(name + compression::format_extension(comp_format)); - newitems.emplace_back(config {"label", _("Back to Turn ") + std::to_string(turn)}); + newitems.emplace_back("label", _("Back to Turn ") + std::to_string(turn)); } } if(savegame::save_game_exists(start_name, comp_format)) { newsaves.emplace_back(start_name + compression::format_extension(comp_format)); - newitems.emplace_back(config {"label", _("Back to Start")}); + newitems.emplace_back("label", _("Back to Start")); } // Make sure list doesn't get too long: keep top two, midpoint and bottom. @@ -455,7 +455,7 @@ void play_controller::hotkey_handler::show_menu(const std::vector& items const hotkey::hotkey_command& command = hotkey::get_hotkey_command(id); if(id == "wml" || (can_execute_command(command) && (!context_menu || in_context_menu(command.id)))) { - items.emplace_back(config {"id", id}); + items.emplace_back("id", id); } } diff --git a/src/theme.cpp b/src/theme.cpp index edf7d060d2f6..88a332d75195 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -521,7 +521,7 @@ theme::menu::menu(const config& cfg) , items_() { for(const auto& item : utils::split(cfg["items"])) { - items_.emplace_back(config {"id", item}); + items_.emplace_back("id", item); } if(cfg["auto_tooltip"].to_bool() && tooltip_.empty() && items_.size() == 1) {