hotkey: Replace previous announcements when toggling Accelerated Speed
Fixes that weird annoying thing where pressing ctrl+a twice results in two overlapping text messages about the exact same thing.
This commit is contained in:
parent
d65b9d0195
commit
0314716aa3
1 changed files with 5 additions and 2 deletions
|
@ -214,15 +214,18 @@ void play_controller::hotkey_handler::toggle_accelerated_speed()
|
|||
{
|
||||
preferences::set_turbo(!preferences::turbo());
|
||||
|
||||
display::announce_options ao;
|
||||
ao.discard_previous = true;
|
||||
|
||||
if (preferences::turbo())
|
||||
{
|
||||
utils::string_map symbols;
|
||||
symbols["hk"] = hotkey::get_names(hotkey::hotkey_command::get_command_by_command(hotkey::HOTKEY_ACCELERATED).command);
|
||||
gui()->announce(_("Accelerated speed enabled!") + "\n" + VGETTEXT("(press $hk to disable)", symbols), font::NORMAL_COLOR);
|
||||
gui()->announce(_("Accelerated speed enabled!") + "\n" + VGETTEXT("(press $hk to disable)", symbols), font::NORMAL_COLOR, ao);
|
||||
}
|
||||
else
|
||||
{
|
||||
gui()->announce(_("Accelerated speed disabled!"), font::NORMAL_COLOR);
|
||||
gui()->announce(_("Accelerated speed disabled!"), font::NORMAL_COLOR, ao);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue