Heres the setup… a bunch (eventually probably like 30-40+) of stats for items in an inventory. Followed AntiquisTheGame’s tutorial to a t but now I’m adding extra functionality. I obviously dont want say an apple to have weapon damage, tool damage, item health, poison rate, etc. showing up in my sizeBox that holds all of these so I got to thinking, whats the best way to hide them.
So my mind of course goes to my bindings for the actual stats, the text, like so…
And I add a setVisibility(Collapsed) to true (no item selected) and the inverse to false. Then I realize two things. A) that wont work, because im checking if I have an item selected, when I need to check if the item has a value. Also, I’ll need to create a variable for every textblock so that I can wire it into the setVisibility() node otherwise the whole inventory is collapsed.
So I then setup a branch on each true and false for, in this pictures case, if weight == 0.0f; (that would mean a null value, unlses someone can think of a better way to check if a float has been set to something otherthan the stock 0.0… its in a struct as you can see) anways if weight == 0.0f; then setVisiblity(collapsed) else setVisiblity(visible)
Like so… but this doesnt work, it remains hidden no matter what.
So my last remaining option is to bind the visibility, which works fine, but its a heck of a load of functions and bindings to create, even if it does mean I dont need the variables.
That works. Any better ideas? I thought about changing it so that for each item in ItemDataStruct addChildWidget(TextBlockWidget) but then I would have to do more figuring out about how to set visiblity up on that, I’m just learning the more intricate parts of UMG now, adding widgets into widgets is new to me.
Any help would be appreciated. Thank you.