Implent A global OnClicked Event For all UMG buttons,Have all buttons bound to a single OnClickedEvent

Hello!

I’m building a menu heavy game. Where buttons can be created dynamically and removed also dynamically, my preferred method of doing things would be to create a few different types of buttons, I will mark these buttons with a child which will hold their type. What I want to have is a SINGLE OnClicked event for all my buttons, and once the event is fired I will find out its type and with the type from the child and I will execute a certain set of actions. Anyone know of a proper way to implement a global an OnClicked event like the one I am describing.

Thank You!

You can create UMG “Button”

, with type and OnClicked Delegate

After that spawn this widget and bind to delegate

I now have another problem in fact, while this solution works, I would like to view my buttons as I work, since I lose that part in the details tab. The buttons must fit perfectly together so making them work by testing will not be enough. Is there a way I can bind the event but send a reference with the clicked button as well without losing the details part?

edit: I need the details tab for the already existing buttons not the ones who will be created at runtime ofc.

Yep, define a child from UButton class and expand your functionality at c++