Automatically add path to built-in scripts

(cherry picked from commit ed6ad376c6)
This commit is contained in:
kobewi 2023-07-26 14:52:45 +02:00 committed by Yuri Sizov
parent 9332a2b387
commit ef1d0cda30
1 changed files with 4 additions and 0 deletions

View File

@ -2053,6 +2053,10 @@ void SceneTreeDock::_script_created(Ref<Script> p_script) {
return; return;
} }
if (p_script->is_built_in()) {
p_script->set_path(edited_scene->get_scene_file_path() + "::");
}
EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton(); EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();
undo_redo->create_action(TTR("Attach Script"), UndoRedo::MERGE_DISABLE, selected.front()->get()); undo_redo->create_action(TTR("Attach Script"), UndoRedo::MERGE_DISABLE, selected.front()->get());
for (Node *E : selected) { for (Node *E : selected) {