[MENUDEF] Extensions to IfOption

Moderator: GZDoom Developers

Post Reply
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

[MENUDEF] Extensions to IfOption

Post by amv2k9 »

IfOption already exists, but it seems to be limited to referencing options defined by ZDoom, and incapable of checking mod-defined ones. So this suggestion is for extending IfOption to support mod-defined options, or, if need be, a new type of IfOption block that can support mod-defined options.

In addition, this suggestion is for extending IfOption (or, again, a new type of IfOption block) beyond its current capability to check true/false.

Code: Select all

IfOption("YourOptionHere",1,EQUALORGREATER)
{
 IfOption("YourOptionHere",4,LESSTHAN)
 {
  ...
 }
 ...
}
Flags:
EQUAL: Executes the block if the option's value is the exact same as the specified value. The default if no flags are specified.
INVERT: Executes the block if the option value is anything but equal to the specified value.
GREATERTHAN: Executes the block if the option value is greater than the specified value.
LESSTHAN: Executes the block if the option value is less than the specified value.
EQUALORGREATER: Executes the block if the option value is equal to, or greater than, the specified value.
EQUALORLESS: Executes the block if the option value is equal to, or less than, the one specified.

If IfOption had this capability, it'd be incredibly useful for mods that have lots of options. For example, if you had a mod with a suite of audio/visual options, you could fit them all in an IfOption block, allowing the player to hide them for when they're not changing them. For another example, say you have options that are interdependent:

Code: Select all

OptionValue "SpawnImpVariants"
{
 0,"Off"
 1,"Dark Imp Only"
 2,"Slime Imp Only"
 3,"Mecha Imp Only"
 4,"All Imp Variants"
}

IfOption("ImpVariants",1)
{
 Slider "Dark Imp Spawn Chance","DarkImpSpawn",1,8,1,0
}
 IfOption("ImpVariants",2)
{
 Slider "Slime Imp Spawn Chance","SlimeImpSpawn",1,8,1,0
}
IfOption("ImpVariants",3)
{
 Slider "Mecha Imp Spawn Chance","MechaImpSpawn",1,8,1,0
}
IfOption("ImpVariants",4)
{
 Slider "All Imp Variants Spawn Chance","AllImpVarSpawn",1,8,1,0
}
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49234
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: [MENUDEF] Extensions to IfOption

Post by Graf Zahl »

Sorry, but you are grossly misunderstanding what 'ifoption' does. It is not there to control content at run time but at compile time! What you suggest here goes far beyond the capabilities of the menu system as currently implemented.
User avatar
amv2k9
Posts: 2178
Joined: Sun Jan 10, 2010 4:05 pm
Location: Southern California

Re: [MENUDEF] Extensions to IfOption

Post by amv2k9 »

Well, darn. :?
Gez
 
 
Posts: 17946
Joined: Fri Jul 06, 2007 3:22 pm

Re: [MENUDEF] Extensions to IfOption

Post by Gez »

That's a big limitation indeed. I was thinking some sort of "IfSelection" block would allow to create elements changing depending on the selection (such as the mugshots in the Wolf3D skill menu) but such a thing wouldn't actually be possible without a lot of work in the menu system then.
Post Reply

Return to “Closed Feature Suggestions [GZDoom]”