diff --git a/data/gui/window/mp_create_game.cfg b/data/gui/window/mp_create_game.cfg index d5a5c967c76..e775b341306 100644 --- a/data/gui/window/mp_create_game.cfg +++ b/data/gui/window/mp_create_game.cfg @@ -171,6 +171,23 @@ [menu_button] id = "random_faction_mode" definition = "default" + + # Note: ensure these are in the same order as the random_faction_mode enum + [option] + label = _ "Independent" + tooltip = _ "Independent: Random factions assigned independently" + [/option] + + [option] + label = _ "No Mirror" + tooltip = _ "No Mirror: No two players will get the same faction" + [/option] + + [option] + label = _ "No Ally Mirror" + tooltip = _ "No Ally Mirror: No two allied players will get the same faction" + [/option] + [/menu_button] [/column] diff --git a/src/gui/dialogs/multiplayer/mp_create_game.cpp b/src/gui/dialogs/multiplayer/mp_create_game.cpp index e8edca80931..a2033553e51 100644 --- a/src/gui/dialogs/multiplayer/mp_create_game.cpp +++ b/src/gui/dialogs/multiplayer/mp_create_game.cpp @@ -253,23 +253,10 @@ void mp_create_game::pre_show(window& win) // // Set up random faction mode menu_button // - static const random_faction_mode::sized_array names {_("Independent"), _("No Mirror"), _("No Ally Mirror")}; - static const random_faction_mode::sized_array tooltips { - _("Independent: Random factions assigned independently"), - _("No Mirror: No two players will get the same faction"), - _("No Ally Mirror: No two allied players will get the same faction") - }; - std::vector rfm_options; - for(std::size_t i = 0; i < random_faction_mode::size(); i++) { - rfm_options.emplace_back("label", names[i]); - rfm_options[i]["tooltip"] = tooltips[i]; - }; - const int initial_index = static_cast(random_faction_mode::get_enum(prefs::random_faction_mode()).value_or(random_faction_mode::type::independent)); menu_button& rfm_menu_button = find_widget(&win, "random_faction_mode", false); - - rfm_menu_button.set_values(rfm_options, initial_index); + rfm_menu_button.set_selected(initial_index); connect_signal_notify_modified(rfm_menu_button, std::bind(&mp_create_game::on_random_faction_mode_select, this));