Faction Select: declared an execute() helper
(cherry-picked from commit 0632f91bd6
)
This commit is contained in:
parent
b5344a7991
commit
a1a46b059d
3 changed files with 4 additions and 8 deletions
|
@ -30,6 +30,8 @@ class faction_select : public modal_dialog
|
|||
public:
|
||||
faction_select(ng::flg_manager& flg_manager, const std::string& color, const int side);
|
||||
|
||||
DEFINE_SIMPLE_EXECUTE_WRAPPER(faction_select)
|
||||
|
||||
private:
|
||||
ng::flg_manager& flg_manager_;
|
||||
|
||||
|
|
|
@ -213,10 +213,7 @@ bool mp_join_game::fetch_game_config()
|
|||
|
||||
ng::flg_manager flg(era_factions, *side_choice, lock_settings, use_map_settings, saved_game);
|
||||
|
||||
gui2::dialogs::faction_select dlg(flg, color, side_num);
|
||||
dlg.show();
|
||||
|
||||
if(dlg.get_retval() != gui2::retval::OK) {
|
||||
if(!gui2::dialogs::faction_select::execute(flg, color, side_num)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -403,10 +403,7 @@ void mp_staging::on_team_select(window& window, ng::side_engine_ptr side, menu_b
|
|||
|
||||
void mp_staging::select_leader_callback(ng::side_engine_ptr side, grid& row_grid)
|
||||
{
|
||||
gui2::dialogs::faction_select dlg(side->flg(), side->color_id(), side->index() + 1);
|
||||
dlg.show();
|
||||
|
||||
if(dlg.get_retval() == retval::OK) {
|
||||
if(gui2::dialogs::faction_select::execute(side->flg(), side->color_id(), side->index() + 1)) {
|
||||
update_leader_display(side, row_grid);
|
||||
|
||||
set_state_changed();
|
||||
|
|
Loading…
Add table
Reference in a new issue