1
0
Fork 0

Fix root node auto translation settings affecting editor root

This commit is contained in:
Haoyu Qiu 2025-06-15 00:15:32 +08:00
parent 46c495ca21
commit 2a7fa46110
1 changed files with 6 additions and 2 deletions

View File

@ -2018,14 +2018,18 @@ SceneTree::SceneTree() {
root = memnew(Window);
root->set_min_size(Size2i(64, 64)); // Define a very small minimum window size to prevent bugs such as GH-37242.
root->set_process_mode(Node::PROCESS_MODE_PAUSABLE);
root->set_auto_translate_mode(GLOBAL_GET("internationalization/rendering/root_node_auto_translate") ? Node::AUTO_TRANSLATE_MODE_ALWAYS : Node::AUTO_TRANSLATE_MODE_DISABLED);
root->set_name("root");
root->set_title(GLOBAL_GET("application/config/name"));
if (Engine::get_singleton()->is_editor_hint()) {
root->set_wrap_controls(true);
root->set_auto_translate_mode(Node::AUTO_TRANSLATE_MODE_ALWAYS);
} else {
root->set_auto_translate_mode(GLOBAL_GET("internationalization/rendering/root_node_auto_translate") ? Node::AUTO_TRANSLATE_MODE_ALWAYS : Node::AUTO_TRANSLATE_MODE_DISABLED);
}
// Set after auto translate mode to avoid changing the displayed title back and forth.
root->set_title(GLOBAL_GET("application/config/name"));
#ifndef _3D_DISABLED
if (root->get_world_3d().is_null()) {
root->set_world_3d(Ref<World3D>(memnew(World3D)));