Jump to content

SSE Papyrus: Close "Container" UI


Grimaer

Recommended Posts

I'm basically looking for the inverse of Container.Activate(PlayerRef), that closes the container and kicks you out of the inventory UI window.

 

I read that there was a way to close player inventory by disabling the controls and re-enabling them. That didn't kick me out of the container UI, so I left the controls disabled (for science!) when i closed out manually and had to alt-F4 because everything was locked, so I know i did it right, it just didn't work for this particular scenario. I've had no luck with Google - is this at all possible?

Link to comment
Share on other sites

I had no idea it was a thing, and I already have SKSE installed so it's a great suggestion. It doesn't seem to do anything at all though.

 

I play on PC with a PS4 controller. No issues with it but I wasn't sure how the buttons mapped, so I used

Debug.Notification(Input.GetMappedControl(277)

to confirm that "Tween Menu" is assigned to scancode 277 (the same button is used to close out of menus and inventories that opens that menu)

 

But Input.TapKey(Input.GetMappedKey("Tween Menu", 0xFF)) does nothing. I checked it with the keyboard scancode too (it's 15, the Tab key apparently, which the game ignores) - nothing. I tried it in an onPlayerLoadGame event (after a few seconds' wait), with no UI open and no other buttons being pressed. It's compiling with no errors, and the debug.notification on the previous line is showing up as expected. I even enabled Papyrus logs, which don't have anything to say about it.

 

What am I missing?

Link to comment
Share on other sites

I wouldn't have even thought of that being an issue. I had previously tried calling it directly with Input.TapKey(277) but that didn't seem to do anything different. I tried your method just to be sure though.

 

It also finally occurred to me to register for keypress events to see if it was even firing - it is, I get notifications every time I enter the menu, cancel out of a container or the menu, and also when the script fires the appropriate TapKey. Apparently the game's just ignoring it. (Tested it with Jump, too. Same thing, tapping the key via script does nothing in-game, but the script picks up that the key was pressed.)

 

Is there any reason the game engine would fail to receive keypresses via script? It's working on the Papyrus side, it just doesn't seem to be getting sent to the engine.

Edited by Grimaer
Link to comment
Share on other sites

Yeah, it worked with controls set to mouse/keyboard, so it's the same bug from before. At least I know what the issue is now, even if there's nothing I can do about it. It's not gamebreaking or anything, and it's still possible to detect controller vs mouse/keyboard inputs so a conditional in-game heads up can be incorporated. All in all, not so bad. Thanks for all the help!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...