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

Add all class_names as manual preloads to all processed gdscripts #9

Open
dugramen opened this issue Nov 25, 2024 · 0 comments
Open
Milestone

Comments

@dugramen
Copy link
Owner

dugramen commented Nov 25, 2024

Classes can't be added to the global namespace if they are not in the same directory. Instead this can be worked around and emulated by doing

const MyClass := preload("path_to_my_class.gd")

So when processing scripts at compile/save time, gather all global classes, and add them to the start of every processed script (after @tool and class_name)

@dugramen dugramen mentioned this issue Nov 25, 2024
9 tasks
@dugramen dugramen changed the title Prepend const MyClass := preload(processed_path + "/wrappers.gd").MyClass to every gdscript class to simulate global scope access to these classes Add all class_names as manual preloads to all processed gdscripts Nov 25, 2024
@dugramen dugramen added this to the 2.0 (gap) milestone Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant