🗂️CMenuGroup

CMenuGroup metatable

:Name(): string

Returns group's name.


:Parent(): CThirdTab

Returns group's parent.


Returns widget type.


:Open(): nil

Opens parent tabs.


Name
Type
Description

widgetName

string

Finds the widget by name.


:Switch(switchName: string, defaultValue [?]: boolean, imageIcon [?]: string): CMenuSwitch

Name
Type
Description

switchName

string

defaultValue [?]

boolean

(default: false)

imageIcon [?]

string

Path to image or FontAwesome icon unicode. (default: "")

Creates new CMenuSwitch.


:Bind(bindName: string, defaultValue [?]: Enum.ButtonCode, imageIcon [?]: string): CMenuBind

Name
Type
Description

bindName

string

defaultValue [?]

(default: Enum.ButtonCode.BUTTON_CODE_INVALID)

imageIcon [?]

string

Path to image or FontAwesome icon unicode. (default: "")

Creates new CMenuBind.


:Slider(sliderName: string, minValue: integer, maxValue: integer, defaultValue: integer, format [?]: string|fun(value: integer):string): CMenuSliderInt

Name
Type
Description

sliderName

string

minValue

integer

maxValue

integer

defaultValue

integer

format [?]

string|fun(value: integer):string

Format string or function to format value. See example. (default: "%d")

Creates new CMenuSliderInt or CMenuSliderFloat depents on arg types. minValue, maxValue and defaultValue should be integer to create CMenuSliderInt.

Example

-- Create slider with integer values
group:Slider( "slider", 0, 100, 50, "%d" )
-- Create slider with integer values and custom format function
group:Slider( "slider", 0, 100, 50, function( value ) return "%d%%" end ) -- turns into
"50%"

:Slider(sliderName: string, minValue: number, maxValue: number, defaultValue: number, format [?]: string|fun(value: number):string): CMenuSliderFloat

Name
Type
Description

sliderName

string

minValue

number

maxValue

number

defaultValue

number

format [?]

string|fun(value: number):string

Format string or function to format value. See example. (default: "%f")

Creates new CMenuSliderFloat.

Example

-- Create slider with float values
group:Slider( "slider", 0.0, 1.0, 0.5, "%.2f" ) -- turns into "0.50"
-- Create slider with float values and custom format function
group:Slider( "slider", 0.0, 100.0, 50.0, function( value )
	if value < 50 then
		return "Low(%f)"
	else
		return "High(%f)"
  end
end )

:ColorPicker(colorPickerName: string, color: Color, imageIcon [?]: string): CMenuColorPicker

Name
Type
Description

colorPickerName

string

color

imageIcon [?]

string

Path to image or FontAwesome icon unicode. (default: "")

Creates new CMenuColorPicker.


:Button(buttonName: string, callback: function, altStyle [?]: boolean): CMenuButton

Name
Type
Description

buttonName

string

callback

function

func(this: CMenuButton):nil function to call on button click.

altStyle [?]

boolean

Use alternative button style. (default: false)

Creates new CMenuButton.

Example

group:Button( "button", function( this )
	Log.Write( "Button '" .. this:Name() .. "' has been clicked."  )
end )

:Combo(comboName: string, items: string[], defaultValue [?]: integer): CMenuComboBox

Name
Type
Description

comboName

string

items

string[]

defaultValue [?]

integer

Index of default item. (starts from 0) (default: 0)

Creates new CMenuComboBox.


:MultiCombo(multiComboName: string, items: string[], enabledItems: string[]): CMenuMultiComboBox

Name
Type
Description

multiComboName

string

items

string[]

enabledItems

string[]

table of enabled items

Creates new CMenuMultiComboBox.

Example

group:MultiCombo( "multiCombo", { "item1", "item2", "item3" }, { "item1", "item3" } )

:MultiSelect(multiSelectName: string, items: {nameId: string, imagePath: string, isEnabled: boolean}[], expanded [?]: boolean): CMenuMultiSelect

Name
Type
Description

multiSelectName

string

items

{nameId: string, imagePath: string, isEnabled: boolean}[]

See example.

expanded [?]

boolean

false if you want to create MultiSelect in collapsed state. (default: false)

Creates new CMenuMultiSelect.

Example

group:MultiSelect( "multiSelect", {
 	{ "1", "panorama/images/heroes/icons/npc_dota_hero_antimage_png.vtex_c", false },
 	{ "2", "panorama/images/heroes/icons/npc_dota_hero_antimage_png.vtex_c", false },
}, true )

:Input(inputName: string, defaultValue: string, imageIcon [?]: string): CMenuInputBox

Name
Type
Description

inputName

string

defaultValue

string

imageIcon [?]

string

Path to image or FontAwesome icon unicode. (default: "")

Creates new CMenuInputBox.


:Label(labelText: string, imageIcon [?]: string): CMenuLabel

Name
Type
Description

labelText

string

imageIcon [?]

string

Path to image or FontAwesome icon unicode. (default: "")

Creates new CMenuLabel.


:Disabled(value: boolean): nil

Name
Type
Description

value

boolean

Gets or sets group's disabled state. Depends on argument.

Example

-- setter
group:Disabled( false )

:Disabled(): boolean

Example

-- getter
local isDisabled = group:Disabled()

:Visible(value: boolean): nil

Name
Type
Description

value

boolean

Gets or sets group's visible state. Depends on argument.

Example

-- setter
group:Visible(false)

:Visible(): boolean

Example

-- getter
local isVisible = group:Visible()

:SearchHidden(value: boolean): nil

Name
Type
Description

value

boolean

Gets or sets group's search state. Depends on argument.

Example

-- setter
group:SearchHidden(false)

:SearchHidden(): boolean

Example

-- getter
local isSearchHidden = group:SearchHidden()

Last updated