From d66c9cfebabbe9cf2aaad86b3664dcd6fe66e995 Mon Sep 17 00:00:00 2001 From: Max Aller Date: Wed, 18 Feb 2026 19:42:32 -0800 Subject: [PATCH] Fix game speed UI not resetting when game is restarted _reset_time_scales() has a visibility guard that was originally needed to prevent resets on session start. After 4e06e305bf scoped the call to only run when all sessions end, the guard is unnecessary and prevents the speed state from being properly reset. Replace is_visible_in_tree() with an is_inside_tree() guard on the UI update only, to avoid theme access warnings while still allowing the state reset when the Game tab is not active. Also includes a fix to the reset-to-1.0x button, which will now always be disabled if the speed is already 1.0x. Fixes #115400. --- editor/run/game_view_plugin.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/editor/run/game_view_plugin.cpp b/editor/run/game_view_plugin.cpp index e44e8149a1..8d8c8bb92f 100644 --- a/editor/run/game_view_plugin.cpp +++ b/editor/run/game_view_plugin.cpp @@ -561,7 +561,9 @@ void GameView::_update_debugger_buttons() { suspend_button->set_disabled(empty); camera_override_button->set_disabled(empty); speed_state_button->set_disabled(empty); - reset_speed_button->set_disabled(empty); + bool disabled = time_scale_index == DEFAULT_TIME_SCALE_INDEX; + + reset_speed_button->set_disabled(empty || disabled); PopupMenu *menu = camera_override_menu->get_popup(); @@ -676,12 +678,11 @@ void GameView::_embed_options_menu_menu_id_pressed(int p_id) { } void GameView::_reset_time_scales() { - if (!is_visible_in_tree()) { - return; - } time_scale_index = DEFAULT_TIME_SCALE_INDEX; debugger->reset_time_scale(); - _update_speed_buttons(); + if (is_inside_tree()) { + _update_speed_buttons(); + } } void GameView::_speed_state_menu_pressed(int p_id) {