IsHidden() Virtual Menu Function

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

Moderator: GZDoom Developers

IsHidden() Virtual Menu Function

Postby Major Cooke » Mon Dec 31, 2018 11:07 am

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.
User avatar
Major Cooke
The road to Hell is paved in the carrion she leaves behind.
 
Joined: 28 Jan 2007
Discord: Major Cooke#0846

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests