-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Make EditorInterface.get_editor_scale()
static
#66109
Conversation
I had to use a similar workaround to pass the |
Yes, I think this is the way to go. Ideally, we'd expose some kind of |
You don't need to do that, your control already has access to the editor theme as long as it's inside of the tree (and if it's not, then theming doesn't really matter). |
Calling static methods on instances should work fine. It's the fact that it works fine which can be problematic for some static methods which we don't want to allow calling on instances (typically static methods that return an instance). |
Ah, okay then. Even more reason to do it properly and not just for one use case. |
Is it really possible to make a node also an API singleton? It's in the editor's scene tree, that also means there is a particular place it should be registered I guess, as the lifetime of the object isn't bound by |
Superseded by #75694. |
To avoid having to do workarounds like this https://github.com/Zylann/godot_voxel/blob/41e364624fd5b038ad296eefeb7bfddebea9c697/util/godot/editor_scale.cpp#L10
EditorInterface
is internally a singleton though, so if it is desired to expose it entirely as a singleton, it could be changed.