Page 1 of 1

IsHidden() Virtual Menu Function

PostPosted: Mon Dec 31, 2018 11:07 am
by Major Cooke
Here's an image of a predicament I'm facing.

While it's possible to make items unselectable, what I would like is the ability to not draw them at all and simply make them not appear. However this has proven to be quite an arduous task that I keep running into walls with.

This would benefit all current options and what not including list menu items and option menu items. When this is returned true, it is not drawn and not even activated, and all hidden items are simply 'collapsed' - hidden away as if they're not even there and NOT leaving any gaps behind.

As they are virtual, modders will be able to override them. In my case for the image above, as an example:

Code: Select allExpand view
override bool IsHidden()
   let plr = players[consoleplayer].mo;
   return (!plr || !plr.CountInv("D4Chaingun"));

That would allow the option to not be shown.

This is also useful for drawing 'menu tips' that I plan on implementing where they show up at the side with a description of what each thing does.