Merge pull request #76513 from YuriSizov/editor-dont-run-too-fast

Avoid accessing the theme too early in EditorRunBar
This commit is contained in:
Rémi Verschelde 2023-04-27 23:57:00 +02:00
commit b81387d6b7
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -45,6 +45,10 @@ EditorRunBar *EditorRunBar::singleton = nullptr;
void EditorRunBar::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
_reset_play_buttons();
} break;
case NOTIFICATION_THEME_CHANGED: {
_update_play_buttons();
pause_button->set_icon(get_theme_icon(SNAME("Pause"), SNAME("EditorIcons")));
@ -434,8 +438,6 @@ EditorRunBar::EditorRunBar() {
write_movie_button->set_tooltip_text(TTR("Enable Movie Maker mode.\nThe project will run at stable FPS and the visual and audio output will be recorded to a video file."));
write_movie_button->connect("toggled", callable_mp(this, &EditorRunBar::_write_movie_toggled));
_reset_play_buttons();
quick_run = memnew(EditorQuickOpen);
add_child(quick_run);
quick_run->connect("quick_open", callable_mp(this, &EditorRunBar::_quick_run_selected));