0 votes

I am writing an EditorPlugin which uses add_custom_type to add a wide variety of unique Control-derived Nodes. They are highly dependant on Styleboxes and Fonts -- things that normally a Theme would be able to provide. Unfortunately, GDScript does not allow you to name your classes, nor does any part of the Theme system seem to provide for custom class settings to be shown in the editor itself (aside from manually defining them in the Theme resource individually -- which still doesn't show them in the node itself for overrides, of course).

GDNative can supposedly provide named classes, but I don't think an EditorPlugin can even use them, nor do I have any strong desire to compile a NativeScript or custom executable with new C++ Modules for every single platform, given that I was hoping to distribute this and/or reuse it for multiple projects.

Right now, I override all of the get_stylebox (and so on) functions with custom wrappers which explicitly check for values in my desired class name before falling back to the built-in parent class, but even that only works from the side of GDScript calling them itself (for example in _draw).

Is there more I can do, or is this as good as it gets?
Is there any GDScript syntax that can add a custom_styles/style_name value to the editor for that automatic add_style_override somehow?

in Engine by (24 points)
retagged by

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.