1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-16 14:00:40 +00:00

Fix auto-translations in editor

This commit is contained in:
kobewi
2023-03-17 01:58:30 +01:00
parent 0291fcd7b6
commit 8f8178bda6
7 changed files with 37 additions and 5 deletions

View File

@@ -490,7 +490,7 @@ bool Window::is_embedded() const {
bool Window::is_in_edited_scene_root() const {
#ifdef TOOLS_ENABLED
return (Engine::get_singleton()->is_editor_hint() && get_tree()->get_edited_scene_root() && (get_tree()->get_edited_scene_root()->is_ancestor_of(this) || get_tree()->get_edited_scene_root() == this));
return is_part_of_edited_scene();
#else
return false;
#endif
@@ -1138,6 +1138,13 @@ void Window::_notification(int p_what) {
RS::get_singleton()->viewport_set_active(get_viewport_rid(), true);
}
#ifdef TOOLS_ENABLED
if (is_part_of_edited_scene()) {
// Don't translate Windows on scene when inside editor.
set_message_translation(false);
notification(NOTIFICATION_TRANSLATION_CHANGED);
}
#endif
notification(NOTIFICATION_THEME_CHANGED);
} break;