Editor/Context Manager: take a team reference for edit_side_dialog

This commit is contained in:
Charles Dang 2024-08-31 21:56:39 -04:00
parent fbc7a27cdd
commit 25de2962ae
3 changed files with 3 additions and 5 deletions

View file

@ -1091,7 +1091,7 @@ bool editor_controller::do_execute_command(const hotkey::ui_command& cmd, bool p
get_current_map_context().remove_side();
return true;
case HOTKEY_EDITOR_SIDE_EDIT:
context_manager_->edit_side_dialog(gui_->viewing_team_index());
context_manager_->edit_side_dialog(gui_->viewing_team());
return true;
// Transitions

View file

@ -235,10 +235,8 @@ void context_manager::load_mru_item(unsigned index, bool force_same_context /* =
load_map(mru[index], !force_same_context);
}
void context_manager::edit_side_dialog(int side_index)
void context_manager::edit_side_dialog(const team& t)
{
team& t = get_map_context().teams()[side_index];
editor_team_info team_info(t);
if(gui2::dialogs::editor_edit_side::execute(team_info)) {

View file

@ -130,7 +130,7 @@ public:
void edit_scenario_dialog();
/** Display a side edit dialog and process user input. */
void edit_side_dialog(int side_index);
void edit_side_dialog(const team& t);
/** Display a new map dialog and process user input. */
void new_map_dialog();