mirror of
https://github.com/lihop/godot-xterm.git
synced 2025-05-04 20:24:23 +02:00
Fix bell behaviour according to tests
This commit is contained in:
parent
dc97c56b17
commit
685884965e
2 changed files with 31 additions and 4 deletions
|
@ -564,11 +564,14 @@ bool Terminal::get_bell_muted() const {
|
|||
|
||||
void Terminal::set_bell_cooldown(const double time) {
|
||||
bell_cooldown = time;
|
||||
bell_timer->stop();
|
||||
|
||||
double remaining_time = std::max(0.0, bell_cooldown - bell_timer->get_time_left());
|
||||
if (remaining_time > 0)
|
||||
bell_timer->start(remaining_time);
|
||||
if (!bell_timer->is_stopped()) {
|
||||
bell_timer->stop();
|
||||
|
||||
double remaining_time = std::max(0.0, bell_cooldown - bell_timer->get_time_left());
|
||||
if (remaining_time > 0)
|
||||
bell_timer->start(remaining_time);
|
||||
}
|
||||
}
|
||||
|
||||
double Terminal::get_bell_cooldown() const {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue