Open DeadlyLampshade opened 3 years ago
Related: #2063
I have resolved this on my own fork https://github.com/DeadlyLampshade/godot Basically just wondering if anyone thinks I should submit a pull request...
Doesn't seem like the proposal has support so far. You can open PR if you want, in worst case it will just get closed.
Related to #2063 (directly relating rather than through the goost issue)
@willnationsdev KoBeWi already mentioned #2063.
There's a label drawn alongside it, this label is usually colored, like we see for exported Vector Classes.
Label color has been added as a theme property in https://github.com/godotengine/godot/pull/58727, and I have a PR open to make the label background a theme stylebox property in https://github.com/godotengine/godot/pull/59770
It has a slider which can be turned on or off.
EditorSpinSlider already has set_hide_slider()
and is_hiding_slider()
methods, but they aren't exposed.
I opened a PR to expose hide_slider
(https://github.com/godotengine/godot/pull/60086). The only part of this proposal left is to allow using EditorSpinSlider outside of the editor, but I think a better solution is to add all of the non-editor-specific features of EditorSpinSlider to SpinBox and make EditorSpinSlider inherit SpinBox. After all, EditorSpinSlider is basically just SpinBox but better.
Describe the project you are working on
I like to consider a plugin/addon developer for Godot, I am often experimenting on ideas for addons.
Describe the problem or limitation you are having in your project
EditorSpinSlider is a class used internally by Godot for basically everything that uses a spinbox, it's similar to the generic SpinBox objects with a few feature differences.
The main problem is that from the features I've listed, changing the color of the label, and turning on and off the slider, are completely inaccessible to GDScript, despite everything else basically being exposed to the editor.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
To put it simply, I want properties such as custom_label_color and hide_slider to be exposed to the editor, so that we can use it to create better plugins.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Not the biggest expert on C++, but...
The biggest problem would be rewriting all 12 EditorProperty's that uses custom label colors to use:
instead of set_custom_label_color.
If this enhancement will not be used often, can it be worked around with a few lines of script?
You would have to write an entirely new class that extends Range or SpinBox to do the exact same thing, so no.
Is there a reason why this should be core and not an add-on in the asset library?
It's a very small, simple change that that would reduce the need for a more expansive SpinBox addon for EditorInspectorPlugin's