You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-09 12:50:35 +00:00
Update autoload references when moving files.
Prior to this, file references in autoload were not updated when a script was moved or renamed. This adds extra logic to update the autoload references when updating project settings. Fixes #22995.
This commit is contained in:
@@ -185,6 +185,7 @@ void EditorAutoloadSettings::_autoload_edited() {
|
||||
if (path.begins_with("*"))
|
||||
path = path.substr(1, path.length());
|
||||
|
||||
// Singleton autoloads are represented with a leading "*" in their path.
|
||||
if (checked)
|
||||
path = "*" + path;
|
||||
|
||||
@@ -651,6 +652,7 @@ void EditorAutoloadSettings::autoload_add(const String &p_name, const String &p_
|
||||
UndoRedo *undo_redo = EditorNode::get_singleton()->get_undo_redo();
|
||||
|
||||
undo_redo->create_action(TTR("Add AutoLoad"));
|
||||
// Singleton autoloads are represented with a leading "*" in their path.
|
||||
undo_redo->add_do_property(ProjectSettings::get_singleton(), name, "*" + path);
|
||||
|
||||
if (ProjectSettings::get_singleton()->has_setting(name)) {
|
||||
|
||||
Reference in New Issue
Block a user