Close button system

Hi,
I have a menu created from a DataTable. The menu is composed of a button for the items categories, and a scroll box for the content.


In game, it works like this:

I’d like that when I click on a category button, if another one is open, it closes.
I’d like a single scroll box on the screen at the same time.
I don’t know how to do it, I struggle with this logic, even more so since I only have access to one button in the blueprint since the others are generated…

You dispatch the click from the generated widget to the parent widget, sending a self reference. The parent can close the previous widget and open another one.

I understand the reasoning but I can’t manage to apply it to my case.


Here’s the parent widget. Where am I supposed to tell it to close previous widget?

I do not see any callbacks up there at all.


Here’s what I meant:

  • this is the generated widget with the scroll box:

When its buttons is clicked it shows its scroll box and calls the Event Dispatcher.

  • the widget (or actor) who generates the scroll box widgets can listen to those calls:

It remembers who is currently open so it can be closed.


Not sure what needs to happen when the same button is clicked twice - not handled here.

2 Likes

thank YOU. I’m having a hard time with UMG :slight_smile:

1 Like

Well, I’m back. Based on what you gave as a solution in your last post, how could we handle clicking the same button twice to open/close the child menu?

Compare those 2. If they’re the same - we’re clicking the same button.

1 Like