Open arkology opened 1 day ago
Possible alternatives for fixing original issues:
Pros: 1) Easier for user to setup.
Cons: 1) This property will always be present, even in release builds. 2) Reference cross will still be that big and hide part of textures, which may be important for low-res textures. 3) Impossible to customise reference cross from plugins.
Pros: 1) Looks more simular to functionality of other nodes. 2) More stuff could be added later like editing range value and offset using gizmo.
Cons: 1) Reference cross will be visible only when node is selected
Describe the project you are working on
Editor plugins?
Describe the problem or limitation you are having in your project
It is impossible to remove
TextureProgressBar
's radial reference cross from editor (or change its appearance), so usage of this node in plugins is limited.Describe the feature / enhancement and how it helps to overcome the problem or limitation
Replace hardcoded radial reference cross with editor-only internal
Marker2D
node. This will no only unblockTextureProgressBar
(its radial modes) usage in plugins, but also remove hardcoded stuff (better code?).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Calling
set_fill_mode()
will add childMarker2D
node toTextureProgressBar
. Current hardcoded reference cross drawing code will be replaced withreference_cross_marker->set_position(p);
Inside plugin it will be possible to access thisMarker2D
node and then you could remove it.Implementing this could fix issues https://github.com/godotengine/godot/issues/46266 and https://github.com/godotengine/godot/issues/96859.
Currently I working on implementing this, so suggestions about functionality implementations are appreciated. For example, right now I don't have 100% consensus about how exactly to implement addition of
Marker2D
inset_fill_mode()
- should it be created or deleted every time mode changes (radial <-> linear), or created inTextureProgressBar
constructor and then just added as child while callingset_fill_mode()
(actually, second option sounds better).If this enhancement will not be used often, can it be worked around with a few lines of script?
Could not be worked around, as reference cross is hardcoded.
Is there a reason why this should be core and not an add-on in the asset library?
Because radial reference cross drawing is directly hardcoded in
NOTIFICATION_DRAW
code.