I have the following UMG widgets:
The PDA can have zero, one, or two InventoryGrid widgets, and the InventoryGrid widget can have one or more InventorySlot widgets. Ideally, I’d like my InventoryGrid widget to cleanly listen for a right mouse button event.
Right now, I have my player controller listening to the RMB via a custom input mapping. If the PDA is open, I want to sent the RMB to the PDA to handle, otherwise I do some other gameplay logic.
However, I don’t know how to cleanly do this. Somehow I need the PDA to know whats under the cursor and send it an event depending on what it is. If its an InventorySlot widget for example, the PDA widget should send it a DropItem event.
Any thoughts on how to do this cleanly?
Also if I have too, I thought it’d be fine for the PDA to notify all children when it receives a RMB click, and the children could just check if the mouse was in the widget and act accordingly. A bit more work and duplication but doable. However, I’m not sure how to notify all children of this?