Open dirigonaut opened 1 year ago
Adding this here as I did not want to pollute the request but I have been loving working with Godot and the 4.0 upgrade while a little bumpy has added a ton of wonderful features that I am looking forward to using once I have finished my migration. So thank you all for all of your efforts.
I'm not sure if this is a good idea for several reasons:
Themes work best when they affect dozens of elements in the project (or more). If they don't, you may end up feeling like you're fighting the theme system by having to override it all the time for every node.
I do think I will be able to get what I want using Panels and a shader as mentioned above so this is not super critical for me. It just feels weird to me to have a styling system that works for only some of the styled elements.
Hell it might even be that I am misunderstanding what the intent behind themes are, cause to me it has a lot of similarities with CSS. I can go in and create a structured layout on a screen using v/hboxs, grids, margins which are feel a lot like tables and div tags in Html. We even have H/VFlow containers and that is a web convention. I also get that this is not web dev but there are a lot of similar paradigms that have been pulled in. I do think that to create loosely coupled UIs applying these concepts for UI design can be very helpful. Being able to reskin really aids in prototyping solutions.
Describe the project you are working on
I am working on a 2d isometric game that has is utilizing TextureProgressBars as part of the Hud to display Health/Mana information. I am currently reworking the Hud in the middle of an upgrade to Godot 4.0 from 3.5 since it broke a lot of my .tres files.
Describe the problem or limitation you are having in your project
I have been getting heavily into using themes for skinning the UI since the upgrade to Godot 4.0 broke a lot of resources for me. To avoid this in the future I am looking to use themes more with the plus of being able to reskin. I have setup a pipeline to import spritesheets and build themes with them. Themes with TextureStyleBoxes makes it almost trivial to reskin container elements of the UI. After getting the whole process setup for PanelContainers and Panels I started to move on to getting the themes setup for the TextureProgressBar as I will have a lot of those on my hud.
This is when I found out that per the documentation the TextureProgressBar do not support themes and instead use Texture2Ds. So my issue is that Godot has this amazing feature of themes, that is even used for the base ProgressBar, but if I want to reskin TextureProgressBars I can't use themes.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
So my proposal would be to allow TextureProgressBars to use themes like the ProgressBar.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I have a feeling proposal one is not viable as I think that the TextureProgressBars are Texture2Ds for their radial fill mode which I do not know how StyleBoxes would handle. If this is not a problem however I do think solution 1 makes things more consistent though might render ProgressBar redundant?
All in all I think proposal 2 is probably the easiest to get off the ground and accomplishes what I am primarily after which is being able to use themes with TextureProgressBars.
If this enhancement will not be used often, can it be worked around with a few lines of script?
How much effort this is to do is going to be based on how the end user builds their control scenes for UI elements. But the code in the end that the user would be writing would be to recreate the cascading nature of Godot Themes or they need to create tooling scripts that reach out to a datastore of whatever type to pull what themed textures they should be using.
As an alternative to recreating themes which is probably what I am going to do is put a PanelContainer over a ProgressBar that way I can bypass using a TextureProgressBar all together since it does not have themes. Though we will see how well this works for me once I get to actually wanting to make a radial ProgressBar but I might just resort to shaders as a hack.
Is there a reason why this should be core and not an add-on in the asset library?
It should be in core because Themes are in core.