-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
Move global script class cache to separate file #70557
Conversation
If it's not difficult, could you check if class icons are preserved after export? Perhaps it is worth splitting the cache into two files, since icons are not needed after export? |
Icon path is just a single string, so it's not worth stripping it. Previously icons were also included, because they were in |
This also closes godotengine/godot-proposals#5631. |
Good work, however moving global-class cache to This will cause some issues. For example: I enable a plugin with global class in my project. If I drop This is the reproduction for the example: global_class_issue.zip. It will cause error using this branch. |
If now you try to remove these keys from project.godot and open the project again, will this error occur when the project is initialized or not? A possible solution is to run plugins after the GDScript class cache is initialized? |
If your plugin preloads a resource (texture, audio) it will have the same problem if the resources are not imported yet. |
I opened a new PR that should fix this issue #70668 |
One thing we should check is how it works when exporting from the command line without the Edit: Yep, did a test and that's broken. Trying to export a simple project without existing
And the exported project fails to load the script classes:
MRP (exporting with editor build compiled from this PR, as "custom debug template"): |
Weird, because it does create the |
Yeah this might be related to #69511. I think it was working in 3.x so it seems to be a regression. For my simple MRP, it works OK by forcing the initial import / script class cache generation with |
Thanks! |
This has also broken the only way (that I know of, at least) of getting a list of all custom classes in at runtime by using |
The new way of getting classes is documented. |
had to delete the |
This PR removes
_global_script_classes
and_global_script_class_icons
fromproject.godot
and moves them to a separate file.godot/global_script_class_cache.cfg
. The file is also included in the exported project.Closes godotengine/godot-proposals#5631
Also fixes #62889