Hi,
So I’m working on a vendor system and I wanted to grey out and make some of the text red when the player cannot afford the item. Each item is in a slot and fills up a grid in another widget. I made a dispatcher and binded an event to check the player’s price and update the opacity and colors of the slot. The problem is that it only updates the slot that the player recently clicked on because I fire the dispatcher each time a payment is made. Any ideas as to why this is happening?
If you want a kind of ‘all siblings triggered’ scenario, then you need a custom event in the main widget, which each of the siblings binds to on construct.
Does binding them on construct in their own class not work? Because when I stepped through the code, they were all binded. But when I click the button to by an item, only the button that was clicked runs the dispatcher and the siblins aren’t triggered even though they are bound to the event
You could just use ‘get all widgets of class’ to find them and just send the signal to all of them, from the custom event.
It’s absolutely fine with a few buttons, people get neurotic about not using ‘get’ nodes, but they’re fine in this sort of case. Even just for testing…
When I run this get all widgets of class, the outputted array is of size 0. I’m creating the widgets and adding them to a grid slot. Are those not counted as widgets in that node? They are being displayed but that node get all widgets of class isn’t finding any widgets of that class.
I can get it to work by doing this but I wasn’t sure if casting would be the best way of doing this. Maybe I could use a blueprint interface as well but I wanted to see if you had any other ideas before I just take that route lol