start the timer before showing the turn dialog

This commit is contained in:
Gunter Labes 2008-10-10 21:15:42 +00:00
parent d4337bf544
commit a90131bbce
3 changed files with 12 additions and 1 deletions

View file

@ -170,6 +170,8 @@ void playmp_controller::think_about_countdown(int ticks) {
void playmp_controller::play_human_turn(){
int cur_ticks = SDL_GetTicks();
show_turn_dialog();
execute_gotos();
if ((!linger_) || (is_host_))
gui_->enable_menu("endturn", true);

View file

@ -570,7 +570,9 @@ void playsingle_controller::before_human_turn(bool save)
if(preferences::turn_bell()) {
sound::play_bell(game_config::sounds::turn_bell);
}
}
void playsingle_controller::show_turn_dialog(){
if(preferences::turn_dialog()) {
std::string message = _("It is now $name|'s turn");
utils::string_map symbols;
@ -578,7 +580,9 @@ void playsingle_controller::before_human_turn(bool save)
message = utils::interpolate_variables_into_string(message, &symbols);
gui::message_dialog(*gui_, "", message).show();
}
}
void playsingle_controller::execute_gotos(){
// Execute goto-movements - first collect gotos in a list
std::vector<gamemap::location> gotos;
@ -599,7 +603,10 @@ void playsingle_controller::before_human_turn(bool save)
gui_->set_route(NULL);
}
void playsingle_controller::play_human_turn(){
void playsingle_controller::play_human_turn() {
show_turn_dialog();
execute_gotos();
gui_->enable_menu("endturn", true);
while(!end_turn_) {
play_slice();

View file

@ -62,6 +62,8 @@ protected:
virtual void play_turn(bool no_save);
virtual void play_side(const unsigned int team_index, bool save);
virtual void before_human_turn(bool save);
void show_turn_dialog();
void execute_gotos();
virtual void play_human_turn();
virtual void after_human_turn();
void end_turn_record();