mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-26 23:28:35 +00:00
Skip delay(20) in play_slice during ai_interact,
...do not redraw screen twice during ai_interact.
This commit is contained in:
parent
f291c96c1b
commit
ac02ec159f
@ -179,7 +179,7 @@ bool controller_base::handle_scroll(CKey& key, int mousex, int mousey, int mouse
|
||||
return scrolling;
|
||||
}
|
||||
|
||||
void controller_base::play_slice()
|
||||
void controller_base::play_slice(bool is_delay_enabled)
|
||||
{
|
||||
CKey key;
|
||||
events::pump();
|
||||
@ -206,7 +206,9 @@ void controller_base::play_slice()
|
||||
// scrolling ended, update the cursor and the brightened hex
|
||||
get_mouse_handler_base().mouse_update(browse_);
|
||||
}
|
||||
get_display().delay(20);
|
||||
if (is_delay_enabled){
|
||||
get_display().delay(20);
|
||||
}
|
||||
}
|
||||
slice_end();
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public:
|
||||
controller_base(int ticks, const config& game_config, CVideo& video);
|
||||
virtual ~controller_base();
|
||||
|
||||
void play_slice();
|
||||
void play_slice(bool is_delay_enabled = true);
|
||||
|
||||
int get_ticks();
|
||||
|
||||
|
@ -849,8 +849,7 @@ void playsingle_controller::play_ai_turn(){
|
||||
|
||||
void playsingle_controller::handle_generic_event(const std::string& name){
|
||||
if (name == "ai_user_interact"){
|
||||
play_slice();
|
||||
gui_->draw();
|
||||
play_slice(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user