create separate code paths for sp idle notification and mp idle notification

although atm they do the same thing
This commit is contained in:
Chris Beck 2014-02-21 21:39:27 -05:00
parent 3cbf1087ed
commit d6c2594686
4 changed files with 20 additions and 4 deletions

View file

@ -549,3 +549,10 @@ bool playmp_controller::can_execute_command(const hotkey::hotkey_command& cmd, i
}
return res;
}
void playmp_controller::do_idle_notification()
{
resources::screen->add_chat_message(time(NULL), "Wesnoth", 0,
"This side is in an idle state. To proceed with the game, the host must assign it to another controller.",
events::chat_handler::MESSAGE_PUBLIC, false);
}

View file

@ -58,6 +58,7 @@ protected:
virtual void after_human_turn();
virtual void finish_side_turn();
virtual void play_network_turn();
virtual void do_idle_notification();
void init_turn_data();
turn_info* turn_data_;

View file

@ -691,10 +691,7 @@ void playsingle_controller::play_side(const unsigned int side_number, bool save)
} else if(current_team().is_idle()) {
try{
end_turn_enable(false);
resources::screen->add_chat_message(time(NULL), "Wesnoth", 0,
"This side is in an idle state. To proceed with the game, the host must assign it to another controller.",
events::chat_handler::MESSAGE_PUBLIC, false);
do_idle_notification();
before_human_turn(save);
while(1) {
play_idle_loop();
@ -917,6 +914,16 @@ void playsingle_controller::play_ai_turn(){
}
/**
* Will handle sending a networked notification in descendent classes.
*/
void playsingle_controller::do_idle_notification()
{
resources::screen->add_chat_message(time(NULL), "Wesnoth", 0,
"This side is in an idle state. To proceed with the game, the host must assign it to another controller.",
events::chat_handler::MESSAGE_PUBLIC, false);
}
/**
* Will handle networked turns in descendent classes.
*/

View file

@ -83,6 +83,7 @@ protected:
virtual hotkey::ACTION_STATE get_action_state(hotkey::HOTKEY_COMMAND command, int index) const;
void play_ai_turn();
void play_idle_loop();
virtual void do_idle_notification();
virtual void play_network_turn();
virtual void init_gui();
void check_time_over();