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

GenericMenu virtual function to stop menu from opening

Postby _bryan » Sat Jun 27, 2020 3:00 am

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 allExpand view
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:

_bryan
 
Joined: 25 Dec 2018
Discord: everybodyisking

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests