Fix BaseButton shortcut feedback being affected by time scale

Shortcut feedback is a purely UI concept, so it shouldn't be
affected by `Engine.time_scale`.
This commit is contained in:
Hugo Locurcio
2026-04-10 18:41:57 +02:00
parent 9495deaf75
commit 4975a62a7b
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -1292,7 +1292,7 @@
LCD subpixel layout used for font anti-aliasing. See [enum TextServer.FontLCDSubpixelLayout].
</member>
<member name="gui/timers/button_shortcut_feedback_highlight_time" type="float" setter="" getter="" default="0.2">
When [member BaseButton.shortcut_feedback] is enabled, this is the time the [BaseButton] will remain highlighted after a shortcut.
When [member BaseButton.shortcut_feedback] is enabled, this is the time the [BaseButton] will remain highlighted after a shortcut. This duration is not affected by [member Engine.time_scale].
</member>
<member name="gui/timers/incremental_search_max_interval_msec" type="int" setter="" getter="" default="2000">
Timer setting for incremental search in [Tree], [ItemList], etc. controls (in milliseconds).
+1
View File
@@ -504,6 +504,7 @@ void BaseButton::shortcut_input(const Ref<InputEvent> &p_event) {
if (shortcut_feedback_timer == nullptr) {
shortcut_feedback_timer = memnew(Timer);
shortcut_feedback_timer->set_one_shot(true);
shortcut_feedback_timer->set_ignore_time_scale(true);
add_child(shortcut_feedback_timer, false, INTERNAL_MODE_BACK);
shortcut_feedback_timer->set_wait_time(GLOBAL_GET_CACHED(double, "gui/timers/button_shortcut_feedback_highlight_time"));
shortcut_feedback_timer->connect("timeout", callable_mp(this, &BaseButton::_shortcut_feedback_timeout));