UIS continuity/polishing help

CruttMutt

Member
Hello! I have got a little stuck with my inventory in regards to the final "feel" being a little off so I was wondering the best way to approach this.

Things can get a little funny and fiddly when using a controller (in particular using InControl). It's fine with keyboard and mouse but with a controller, it can be hard to navigate intuitively, after having someone test my game systems I watched them struggle with the menus a lot.

To make it easier to explain, I have taken a video and I will note the timepoints here and what I am trying to do. I think all the issues are linked or can be fixed with the same method but I can't work out what it is and trying different options in the "Display Panel" script didn't seem to work right where I thought it might. This will make more sense below but I thought the "Set open on active" might resolve this but it just turns off the tab entirely and just having the "selectable on open" did not fix the main issues started below. Basically, I would like my menus to open blank (not a particular tab open if possible) and always on the same menu button for continuity and for the sake of player muscle memory navigating menus. Bad navigation is enough to make you throw a game out as we all know haha.

Anyway! Here is the vid:

Points:
0:00 INVENTORY - When I open the inventory, it will always open on the last tab I had open. Basically here I would just like it to always open all tabs closed and select the option from the menu tabs (or open always on the inventory tab if one open is necessary). I watched the tester get frustrated opening and having to cancel the selected tab and try and find and navigate through to where they wanted to go, so if it's always the same it can be intuitive and they can adapt quickly. (FYI: The rest of my questions may actually be resolved in the same way).

0:38 SHOPS - Opening a shop with the controller has nothing at all selected at the start and all panels open. Can it start with all panels closed and choose from the "Buy/Sell/Close" menu first? Or if it has to start with the buy panel open for whatever reason, it makes me need to press 'cancel' before it selects the top buy option the first time I open a shop on play. That's quite confusing to work out. So even if the buy panels stay open, I would need to it always either auto select the (Buy/Sell/Exit) menu panel OR if necessary the top buy option. It's a bit inconsistent right now.

1:23 STORAGE - This one is quite odd in the same respect as the shop, but as you can see it opens with a quantity picker active that you then need to cancel back and find the right menu you want and it was almost too much to explain to the tester without doing it first so really, the same thing again. I need it to start just with the menu tab buttons selected and nothing else open ideally.

The end just shows the crafting working fine, always selects the top option which is super!

So... sorry it seems like a lot but it's actually just the same request in different forms. I thought I would just try to make it super clear to not waste your time.

Thanks! I hope you have a suggestion for me :) Appreciate any help a lot.

Cheers!
 
Thank you for the clear explanation.

Unfortunatly I do not have a solution that works for all of these menus at the same time.
Each Menu is it's own script and they do not inherit from a base menu script.

If you wish you can override some menus with your own custom scripts to have the exact functionality you want. Most of the functions are virtual and the members are most of the times protected.

That being said you mentioned a few things which I think are worth implementing in the next release.

For the Main Menu, I open the last opened submenu when you open it. I actually don't give any options to change that default functionality.
I'll add it right now. Find the new Main Menu attached.
You can use the new OpenFirstSubMenu or OpenNoSubMenu option.

Essentially I changed the OnOpen function such that it checks the enum value and decides which submenu, if any, to open.

I did something similar for the ShopMenu and the StorageMenu. You can find the new one below too.

For the Storage Menu, the Quantity picker shouldn't appear as soon as it opens, perhaps you need to disable it in the scene, or change the options on it's Display Panel to not enable on start or enable.

If those changes don't do exactly what you wish feel free to override the menus with your own custom scripts.
It would really help if you shared your solution to your problem, this way I can try to look into incorporating those changes inside the base classes if possible.

I hope that helps
 

Attachments

  • MainMenu.cs
    4.9 KB · Views: 6
  • ShopMenu.cs
    16.4 KB · Views: 7
  • StorageMenu.cs
    8.8 KB · Views: 6
Thank you so much for getting to these so quick!

You have very much understood my request and there is some great progression already, the mainmenu script works very nicely and ticks all the boxes! Great new feature.

Unfortunately, I am having some issues and errors with the others but I fiddled with them and they are running now. There is some new code in them that my version of 1.1.7 might not be savey to yet? The same errors happen on both of them, but using shopmenu as a reference the error is:

Assets\Opsive\UltimateInventorySystem\Scripts\UI\Menus\Shop\ShopMenu.cs(21,32): error CS0234: The type or namespace name 'UI' does not exist in the namespace 'Opsive.Shared' (are you missing an assembly reference?)

Which has to do with this (line 21):
using Text = Opsive.Shared.UI.Text;

The one I have in my UIS scripts folder staes a similar (line 20):
using Text = Opsive.UltimateInventorySystem.UI.CompoundElements.Text;

So maybe something has changed there I don't currently have. I changed that line to the old version, just for the sake of testing, it accepts it and seems to be fine for now. So all good! Just probably good for you to know.

So results so far though! It has actually sorted out the storage quantity issue but not in the way you'd think haha (I do have it disabled in the scene fyi). If I have either of the store/retrieve selected I get the quantity issue but if I have none selected it opens in "store" but properly with no quantity issue. Honestly, I am super happy with it. It's easy to navigate and does not feel like it's wrong at all so no stress on that one anymore. Thanks!! Seriously, nailed it so far. This is much more controller friendly having these options :)

Here's the fun part... haha? The shop one is the only one that's still a bit shakey. The options of what tab open work great but I still get the control issues. On closer inspection (this is happening in the video too), it seems it is actually selecting the correct first option, so all is working for a split second but then it automatically unselects itself. If I hit it on time (before it unselects) it opens the buy menu, selects the first item, and then does the same thing again and deselects the first item. Same as before in the video. If I follow this with a cancel (like the video) it then reselects the first buy item and then from there... it all works perfectly haha. So it's actually ONLY on the first time I open the shop menu on hitting play or reloading. So in theory... It actually is doing what I want, but only not the first time. So I imagine I will probably get stuck on this for a while haha. I will update you if I manage to figure anything out myself. I can see it can work, so it is an odd anomaly.

Regardless I am very happy with the progress so far, I will inevitably need to figure this out but this has been really great pushing me past this obstacle so far. Thank you!!
 
Last edited:
Ah yes, I forgot I made a change.
In the next release, The CompoundElement Text will be moved to the shared folders.
So the fix you applied is the correct one.

For the ShopMenu error, I haven't tested it but try this change:
Code:
/// <summary>
/// Handle the On Open event.
/// </summary>
public override void OnOpen()
{
    base.OnOpen();
    switch (m_MenuOpenOptions) {
        case MenuOpenOptions.OpenBuySubMenu:
            OpenBuy();
            break;
        case MenuOpenOptions.OpenSellSubMenu:
            OpenSell();
            break;
        case MenuOpenOptions.OpenNoSubMenu:
            OpenBuy();
            m_InventoryGrid.Panel.Close();
            EventSystemManager.Select(m_BuyButton.gameObject);
            break;
        default:
            throw new ArgumentOutOfRangeException();
    }
    
}

You are using the OpenNoSubMenu right? In the code above I added a line to select the buy button so you shouldn't have to press back before selecting the item.
But really that shouldn't be the case so there might be a bug somewhere else.
Let me know your findings.
 
That's a very handy line of code! Thank you!! It did not fix it, but it allowed me to concoct a bandage fix with my shakey improv knowledge of coding haha.

Firstly I had to change the "EventSystemManager.Select(m_BuyButton.gameObject)" to "UltimateInventorySystem.Input.EventSystemManager.Select(m_BuyButton.gameObject)".

I then noticed that whatever was happening was on initialization on the shop for the first time and somewhere in the code it must be deactivating the selection. So some sort of bug, I guess. So I took out the code from the OpenNoSub section, slapped it in an IEnumorator at the bottom of the script, and just had it call that Coroutine with a yield waitforseconds to activate after whatever deactivated it. This has actually worked. It's not super clean or the best way I am sure, and the button does a little flash as it deactivates/reactivates but that's not a huge deal since it will only do it once on load and it works. Which is the most important bit. Probably something that can be fine-tuned but most important it's cohesive for the player. Could even possibly be hidden with an animation or fade when the shop opens. I'll think of something.

This is basically what I slapped at the end and called:

Code:
IEnumerator WaitAndSelect()

        {

            OpenBuy();

            m_InventoryGrid.Panel.Close();

            yield return new WaitForSeconds(1);

            UltimateInventorySystem.Input.EventSystemManager.Select(m_BuyButton.gameObject);

        }

Could be just related to me, or InControl or maybe all controllers. Not sure since I have only tried InControl with a ps4 controller. But, as a work around it all seems to be running fluidly enough now! Everything with a bit of imagination can be tailored to work.

Thanks for all the help so far. At this point, I should probably be wary about updating but I have learned a lot more now too. Thanks heaps!
 
Last edited:
I'm glad it works for you now.

I'm currently working on the Adventure Kit. Hopefully I'll have a good solution to correctly solve these problems by the time it comes out. We're still in the early days though
 
Top