GenericMenu virtual function to stop menu from opening

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

_bryan
Posts: 50
Joined: Tue Dec 25, 2018 4:12 am
Contact:

GenericMenu virtual function to stop menu from opening

Post by _bryan »

With the current implementation of GenericMenu as far as I know it's only possible to close a menu by closing it via the draw function after it's already been opened.

Code: Select all

class SomeMenu : GenericMenu {
  bool closeMe;
  override void Init (Menu parent) {
    super.Init(parent);
    if (whatever) {
      closeMe = true;
    }
  }

  override void Drawer() {
    if (whatever) {
      close();
      return;
    }
    ..else draw crap..
  }
}
This works in the sense that the menu closes itself, but it would be nice if the menu didn't open at all so the player doesn't have a hiccup if they try to open a menu when it might not be relevant.

An example of what I mean:

Return to “Feature Suggestions [GZDoom]”