Hey. I have a question. I made a button for a system. It only works when I double click the Use button. I don’t want this. Everything is working properly. What is the problem. Thanks for your response.
I believe the issue is that your widget has no focus. When opening a widget, you should call SetInputModeUIOnly with your widget as the target widget to focus on.
Are you using the Menu Anchor
widget for this?
Where / when are you calling Open
then? When the Menu Anchor
generates the underlaying widget, it gives you an option to focus on it immediately:
You confirmed you were using Menu Anchor for this. This is a special widget that handles context menus very well:
Are you using it?
It allows you to invoke another menu:
The above would work fine even without focus since we’re using buttons which autofocus whether you want it or not. However, in a busy interface granting focus manually may be necessary; as it would be in a sub-menu without actual buttons.
In your example, it seems that you’re giving focus to inventory window rather than the context menu. It’s hard to tell how you scripted it, I might have misunderstood the intent here.
First, I call the inventory windows to the Hud widget. Then I call the inventory slot to the inventory window. Then I call the Button menu from the inventory slot. This image belongs to inventory window. I showed the anchor here because I used it.
While I can’t recommend handling the whole thing this way; consider giving the focus to the correct UI element:
The menu you want to focus on is called Inventory Actions
.
By doing this:
You actually take the focus away from the menu that needs it.
I am using ‘set input mode ui only’ in both places. Inventory Window and Inventory Slot.
Is it bad to use it in two places?
Could be. Every time you call it and actually provide a widget to focus on, you’re taking it away from another widget. You can’t focus on 2 widgets. There’s probably no need to change Input Modes at all (there might be if you want to achieve something specific).
Why not just give the Actions menu focus…
Or, much better, look into how the Menu Anchor works - a special widget that does all you need and comes with a ton of extra features you will probably need to now develop the hard way…
Because if i don’t use it with inventory window. When I open the menu, I shoot with a gun. I can move. I dont want this.
Fine, good reason. But ensure you give focus to the Actions menu after opening and don’t take it away.
I’ll take a look at this. Thanks for your effort to help. You made time for me.
Also I’ll check your game.
@ClockworkOcean - how do I fix that?! Can’t edit my profile. ;p Every day Zof is more and more mine, muahaha.
Settings button. I thought it worked for you now…