Forum rules - please read before posting.

Check menu state during transition

I have implemented checks so that the ESC active input will close inventories, containers etc if those are visible. If none is visible, then ESC will open the Pause menu. My issue here is that most of my menus have a short transition, and when a menu is mid transition it isn't considered visible. I can click to open an inventory, hit ESC during its 0.5 transition to open the Pause menu, and end up with both on my screen. Would it be possible for those checks to consider the menu visible throughout the entire transition (as soon as it starts to fade in, and only after it has fully faded out)?

Comments

  • For anyone interested, I managed to solve this issue by creating a custom action that is basically a duplicate of ActionMenuCheck.cs, except it has one more option: Menu is Visible or Transitioning.

    To do this, you just need to replace this line:

    public enum MenuCheckType { MenuIsVisible, MenuIsLocked, ElementIsVisible };

    with this line:

    public enum MenuCheckType { MenuIsVisible, MenuIsVisibleOrTransitioning, MenuIsLocked, ElementIsVisible };

    This line:

    if (checkType == MenuCheckType.MenuIsVisible || checkType == MenuCheckType.MenuIsLocked)

    with this line:

    if (checkType == MenuCheckType.MenuIsVisible || checkType == MenuCheckType.MenuIsLocked || checkType == MenuCheckType.MenuIsVisibleOrTransitioning)

    And include this if statement under CheckCondition ():

                if (checkType == MenuCheckType.MenuIsVisibleOrTransitioning)
                {
    
                    if (_menu.IsFading() || _menu.IsVisible())
                    {
                        return true;
                    }
                    else
                    {
                        return false;
                    }
    
                }
    

    You also need, of course, to change all references from ActionMenuCheck to ActionMenuCheckCustom (or whatever you want to name your new action).

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.