Garry's Mod Wiki

DMenuOptionCVar

Description

This is used internally - although you're able to use it you probably shouldn't.

An internal panel used by DMenu. It acts as a menu option that can be checked. It automatically sets and reads the given console variable.

It can be right clicked to toggle without closing the DMenu.

Use DMenu:AddCVar instead.

View source

Parent

Derives methods, etc not listed on this page from DMenuOption.

Implements

Implements or overrides the following hooks/methods. If you want to override these, you probably want to call the original function too.

Methods

string DMenuOptionCVar:GetConVar()
Returns the console variable used by the DMenuOptionCVar.
string DMenuOptionCVar:GetValueOff()
Returns the value of the console variable when the DMenuOptionCVar is not checked.
string DMenuOptionCVar:GetValueOn()
Return the value of the console variable when the DMenuOptionCVar is checked.
DMenuOptionCVar:SetConVar( string cvar )
Sets the console variable to be used by DMenuOptionCVar.
DMenuOptionCVar:SetValueOff( string value )
Sets the value of the console variable when the DMenuOptionCVar is not checked.
DMenuOptionCVar:SetValueOn( string value )
Sets the value of the console variable when the DMenuOptionCVar is checked.