Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors when renaming/moving/deleting global scripts #90186

Merged
merged 1 commit into from
Apr 6, 2024

Commits on Apr 5, 2024

  1. 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.
    Maran23 committed Apr 5, 2024
    Configuration menu
    Copy the full SHA
    dda06a8 View commit details
    Browse the repository at this point in the history