Ejemplo n.º 1
0
void mp_staging::on_team_select(window& window, ng::side_engine_ptr side, menu_button& team_menu, bool& handled, bool& halt)
{
	side->set_team(team_menu.get_value());

	// First, remove the node from the tree
	find_widget<tree_view>(&window, "side_list", false).remove_node(side_tree_map_[side]);

	// Then add a new node as a child to the appropriate team's node
	add_side_node(window, side);

	set_state_changed();

	handled = true;
	halt = true;
}
Ejemplo n.º 2
0
void mp_staging::on_ai_select(ng::side_engine_ptr side, menu_button& ai_menu, const bool saved_game)
{
	// If this is a saved game, we need to reduce the index by one, to account for
	// the "Keep saved AI" option having been added to the computer player menu
	int i = ai_menu.get_value();
	if(saved_game) {
		i--;
	}

	if(i < 0) {
		side->set_ai_algorithm("use_saved");
	} else {
		side->set_ai_algorithm(ai_algorithms_[i]->id);
	}

	set_state_changed();
}
Ejemplo n.º 3
0
void mp_staging::on_ai_select(ng::side_engine_ptr side, menu_button& ai_menu)
{
	side->set_ai_algorithm(ai_algorithms_[ai_menu.get_value()]->id);

	set_state_changed();
}