fixup some mp configure UI associated to the random factions option

This commit is contained in:
Chris Beck 2015-03-13 14:33:14 -04:00
parent bf5fd171a8
commit 8fffc852f5
2 changed files with 14 additions and 4 deletions

View file

@ -84,6 +84,7 @@ configure::configure(game_display& disp, const config &cfg, chat& c, config& gam
observers_game_(disp.video(), _("Observers"), gui::button::TYPE_CHECK),
oos_debug_(disp.video(), _("Debug OOS"), gui::button::TYPE_CHECK),
shuffle_sides_(disp.video(), _("Shuffle sides"), gui::button::TYPE_CHECK),
random_faction_mode_label_(disp.video(), _("Random Factions:"), font::SIZE_SMALL, font::LOBBY_COLOR),
random_faction_mode_(disp, std::vector<std::string>()),
cancel_game_(disp.video(), _("Back")),
launch_game_(disp.video(), _("OK")),
@ -186,6 +187,8 @@ configure::configure(game_display& disp, const config &cfg, chat& c, config& gam
shuffle_sides_.set_check(engine_.shuffle_sides_default());
shuffle_sides_.set_help_string(_("Assign sides to players at random"));
random_faction_mode_label_.set_help_string(_("Allow for mirror matchups when random factions are chosen"));
std::vector<std::string> translated_modes;
for(size_t i = 0; i < mp_game_settings::RANDOM_FACTION_MODE_COUNT; ++i) {
std::string mode_str = mp_game_settings::RANDOM_FACTION_MODE_to_string(static_cast<mp_game_settings::RANDOM_FACTION_MODE> (i));
@ -193,7 +196,7 @@ configure::configure(game_display& disp, const config &cfg, chat& c, config& gam
}
random_faction_mode_.set_items(translated_modes);
random_faction_mode_.set_selected(engine_.random_faction_mode());
random_faction_mode_.set_help_string(_("Independent: Random factions assigned independently uniformly at random\nNo Mirror: No two players will get the same faction\nNo Ally Mirror: No two allied players will get the same faction"));
random_faction_mode_.set_help_string(_("Independent: Random factions assigned independently\nNo Mirror: No two players will get the same faction\nNo Ally Mirror: No two allied players will get the same faction"));
#if 0
// The possible vision settings
@ -497,6 +500,7 @@ void configure::hide_children(bool hide)
observers_game_.hide(hide);
oos_debug_.hide(hide);
shuffle_sides_.hide(hide);
random_faction_mode_label_.hide(hide);
random_faction_mode_.hide(hide);
cancel_game_.hide(hide);
launch_game_.hide(hide);
@ -549,8 +553,8 @@ void configure::layout_children(const SDL_Rect& rect)
int slider_width = options_pane_left_.width() - 40;
int xpos_left = 0;
int ypos_left = 0;
unsigned int xpos_left = 0;
unsigned int ypos_left = 0;
ypos_left += 2 * border_size;
options_pane_left_.add_widget(&shuffle_sides_, xpos_left, ypos_left);
@ -558,14 +562,19 @@ void configure::layout_children(const SDL_Rect& rect)
xpos_left + (options_pane_left_.width() - xpos_left) / 2 + border_size, ypos_left);
ypos_left += shuffle_sides_.height() + border_size;
options_pane_left_.add_widget(&random_faction_mode_label_, xpos_left, ypos_left);
xpos_left += random_faction_mode_label_.width() + border_size;
options_pane_left_.add_widget(&random_faction_mode_, xpos_left, ypos_left);
xpos_left += random_faction_mode_.width() + border_size;
if(!local_players_only_) {
options_pane_left_.add_widget(&password_button_,
(ca.x + first_column_width / 2) - 40, ypos_left);
std::max(xpos_left + 2* border_size, (options_pane_left_.width() / 2) + border_size), ypos_left);
} else {
password_button_.hide(true);
}
xpos_left = 0;
ypos_left += random_faction_mode_.height() + border_size;
options_pane_left_.add_widget(&countdown_game_, xpos_left, ypos_left);

View file

@ -79,6 +79,7 @@ private:
gui::button observers_game_;
gui::button oos_debug_;
gui::button shuffle_sides_;
gui::label random_faction_mode_label_;
gui::combo random_faction_mode_;
gui::button cancel_game_;