Forum rules - please read before posting.

Esc toggle pause menu, but close the HUD menus (Crossfade issue?)

edited October 2014 in Technical Q&A
Hi!

My HUD is composed by 3 menus, that I plan to set as fixed (so nothing should close them).

If I click esc the game shows the pause menu without closing my HUD menus.

But if I go in the Pause menu, then select one other sub menu (ex. Options) and then I click esc again, it crossfade back to Pause menu, but it closes also all the HUD menus too.

So this works:
- Esc (alone) opens and closes Pause menu.


This doesn't work:
- Esc -> opens Pause menu.
- Click "Options" button -> crossfade to Options Menu
- Esc -> crossfade back to Pause menu -> it closses Options Menu -> it closes also the HUD menus.

Probably the issue is in Crossfade. If I give the command crossfade to a menu, it closes all the other menus.

How could I avoid to close the HUD menus?

If possible "Esc" could have the following behaviours:
- Open Pause menu if nothing is opened.
- Close (without crossfading) the last menu called, if Esc is pressed

In case let me know where is the cs file I could change to implement this.

Comments

  • The "Crossfade" option is more a remnant of AC pre-Menu Manager, when Menus had to be hard-coded (those were the days..)

    Crossfade will close all active menus, and enable just the one specified.  Instead, use an ActionList asset, with two Menu: Change state Actions to explicitly close the Pause menu, and open the Options menu.  Set the "Pause -> Options" button's Click type to Run Action List, and assign the asset.
  • edited October 2014
    I've already done that. All the buttons are implemented using action lists.

    I need to change the "Esc" keyboard input Action.

    I want:
    -> when I click Esc on keyboard (and not menu button) -> do ActionList
  • You can use the Input: Check Action for that.  Just have it running (and looped - when the Action returns FALSE, just loop it back onto itself) whenever you want the check to be made.  Be sure to set the ActionList it's placed in to Run In Background.
  • edited October 2014
    Ok. Got it.
    Thank you very much!
  • edited October 2014
    Another thing.

    Maybe it is possible to implement a way to Lock Menu On.

    So it won't be possible to close them with the crossfade.

    And last thing.
    Could you please let me know where is the code that does the crossfade? I'd like to check it and maybe adjust it to my specific needs.
  • It's in PlayerMenus.cs.  I'd actually recommend not using Crossfade at all, however - were ActionList assets around at the time of AC's initial release, it never would have been an option.
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.