Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix errors when renaming/moving/deleting global scripts
When renaming or moving global scripts, the following errors can appear: - Attempt to open script 'xxx' resulted in error 'File not found'. - Failed loading resource: xxx. Make sure resources have been imported by opening the project in the editor at least once. - Parser Error: Class 'xxx' hides a global script class. When deleting scripts, errors appear when opening the 'Create Node Dialog' as the script cache still contains the removed global scripts. The following errors can appear: - Attempt to open script 'xxx' resulted in error 'File not found'. - Failed loading resource: xxx. Make sure resources have been imported by opening the project in the editor at least once. editor/create_dialog.cpp:241 - Condition "scr.is_null()" is true. All this errors can be fixed by correctly handling the cases. They involves removing the old path and adding the new one (if not deleted) to the ScriptServer. This is somewhat similar if the file is moved or deleted outside Godot and detected by the file watcher, but more specialized for this particular usecase, since we know the old and the new path / correctly know what the user just did.
- Loading branch information