In common UI you push widgets to stack, then pop them either with a button or “back” action (typically escape). I want to pop widgets with custom actions, like inventory should be opened AND CLOSED with “I” button, player list with “P”, etc.
How do I properly set this up? I seriously couldn’t find anything about it. I’m using EnhancedInput.
So I don’t know about EnhancedInput since I’ve not used that before, but with CommonUI the only solution I could think of is to
- Add an input action to your data table for each widget (e.g. ‘I’ for ‘Close_Inventory’, ‘P’ for ‘Close_PlayerList’, etc.)
- Create a button class/blueprint based on CommonButtonBase
- Place the button in your widget
- Set the button’s triggering input action to the respective input action
- Deactivate the widget on button press
- Make the button invisible
1 Like
I ended up adding a property “CustomBackAction” to a subset of UCommonActivatableWidget and registering handle back action to it. Doesn’t seem to be fully functional in 5.2 but 5.3 promises full Enhanced Input support, so until then, I guess.
Thank you ! It’s solved my problem !
1 Like