So, I’m creating a widget that I can toss into a slew of different menus (that are widgets themselves) that selects a player 1-4. I’d like to have it call a function/event or what have you that tells its parent a player has been selected and gives the player number.
I know with the custom events, I have to get reference to the object, and cast it to the correct type. The problem I’m having is that widgets can’t inherit from other widgets, and I have several different menus that can all be individually showing different players, so I’d have to go to each menu one by one, cast it into one of the menu types, and if it succeeds, tell it the player’s been selected. I’d rather avoid doing that since every time I make a new menu, I’d have to add it to the list of possible casting types.
Event Dispatchers are no good because I still have to cast it to the correct type to get reference to the event I want called (or I simply don’t understand event dispatchers).
Blueprint Interfaces have the same problem, you have to cast it to the correct type. I just want to basically send a message to an object that says, “Hey, this player was selected, do stuff with it.”
I want to be able to simply drop it into a widget, it automatically finds its parent and tells it when a player is selected and which player it is.
I’m wondering if there’s a way to send a message like that, or am I wasting my time looking for a way around it?