Forum rules - please read before posting.

Container UI Problems

edited September 2022 in Technical Q&A

Hi,

I'm using the latest version 1.75.8 with the default Unity UI container included and having a couple of issues.

Movement - Direct
Input method - KB and controller
Inventory interactions - Multiple
AC is setup to use direct menu navigation

  • After the "Take all" button is clicked with the controller button, the container UI loses focus, no UI element is selected/highlighted after, the game is stuck at the container window.

  • Can't move items from the bottom inventory back to the container. The bottom inventory behaves like the regular inventory with interaction/selection after clicking the item with controller button, even with the options "Prevent interactions?" and "Prevent selections" enabled for the inventory box

Thanks

Comments

  • Welcome to the community, @kahuna.

    Thanks for the details - I'll attempt a recreation.

    Do these issues occur if you switch the Container menu's Source to Adventure Creator?

  • edited September 2022

    Hi,

    I'm sorry about the losing focus part.
    These two situations below cause the UI to lose focus.
    I have 2 items in the container

    • If I moved all the items out of the container to inventory one by one
    • If I moved the 2nd/last item to the inventory first.

    Also the "When slot is empty" is set to Disable Object.

    It seems like if you move the 2nd/last item out first, then the 2nd/last slot is disabled, and the selection is stuck on the disabled slot. I can see from the EventSystem that the 2nd/last slot button is selected, after the item is moved.

    I tried to switch to AC creator UI, the focus works but still can't move items back from inventory to container.

  • Also the "When slot is empty" is set to Disable Object.

    Set it to "Clear Content", and check "Items can be re-ordered in Menus?" in the Settings Manager's Inventory settings - does that improve behaviour?

  • Yes I did tried that by setting it to “Clear Content” and it worked. But this is not ideal either. Because there’s no highlighting of empty slot when using unity UI, the users might get loss when there’s no visual indication what’s being “highlighted”.

  • I have recreated the issues, thanks for the details.

    For the EventSystem de-selection issues: this'll involve some user choice as to what should happen in this event, so I think it best to rely on a custom event hook to allow the user to choose the behaviour on a per-element basis.

    I will provide this as part of the next update, as well as a sample script to cover this scenario. You're welcome to PM me if you'd like to be involved in testing.

    Alternatively, or in the meantime, setting "When slot is empty" to "Clear Content" should navigation to still be possible.

    For the issue of moving items to the Container: the built-in behaviour is to select items and then move them to the Container manually. This can be automated, however, through use of a simple custom script. Such a script can be found on the AC wiki here:

    https://adventure-creator.fandom.com/wiki/Auto-transfer_items_to_Containers

  • Thanks for the update. I really don’t mind having the empty slot enabled. Correct me if I’m wrong, that there’s no highlighting of the empty slots for Unity UI. I saw on another thread that there’s a highlighttexture options, but that options is only for when you use AC UI but not unity UI.

    For the item slots, I’m using two separate textures, with the active one having a box drawn around the icon to show its being highlighted. But for the empty slot, there’s only one empty slot texture.

    Since the slots are button, I open the ContainerUI prefab, the item slot buttons’ color tinting options are also turned off. So I turned on the button tinting feature thinking that will show when the slot button is highlighted. But this also didn’t work in an unexpected way, only the first item slot shows tinting/highlighting even other slot are being selected/hovered.

    Maybe that’s the reason why they are turned off. But what’s the reasoning behind that?
    It would have been so easy for the slot highlights to work if the button tinting works.

  • I got the Unity button tinting to work now.
    I had to recreate new buttons/Slots and relinked them in the the Menu Manager.

    Thanks

  • Yes, the Buttons will need a slight tweak to have them highlight when selected.

    Recreating and relinking the Buttons isn't necessary, however - the originals can be modified to highlight when selected with the Button component's Transition setting.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.