⚙️CMenuGearAttachment

CMenuGearAttachment metatable.

:Name(): string

Returns widget's name.


Returns widget's parent.


Returns widget type.


:Open(): nil

Opens parent tabs.


:ForceLocalization(newText: string): nil

Not recommended for use due to its complexity

Changes text in the widget. The path to the widget is not affected. May be used for dynamic text customization or recolor.


Finds the widget by name.


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

Creates new CMenuSwitch.


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

Creates new CMenuBind.


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

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
gear:Slider( "slider", 0, 100, 50, "%d" )
-- Create slider with integer values and custom format function
gear: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

Creates new CMenuSliderFloat.

Example

-- Create slider with float values
gear:Slider( "slider", 0.0, 1.0, 0.5, "%.2f" ) -- turns into "0.50"
-- Create slider with float values and custom format function
gear: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

Creates new CMenuColorPicker.


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

Creates new CMenuComboBox.


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

Creates new CMenuMultiComboBox.

Example

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

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

Creates new CMenuMultiSelect.

Example

gear: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

Creates new CMenuInputBox.


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

Creates new CMenuLabel.


:Visible(value: boolean): nil

Gets or sets visible state. Depends on argument.

Example

-- setter
widget:Visible(false)

:Visible(): boolean

Example

-- getter
local isVisible = widget:Visible()

:Disabled(value: boolean): nil

Gets or sets disabled state. Depends on argument.

Example

-- setter
widget:Disabled( false )

:Disabled(): boolean

Example

-- getter
local isDisabled = widget:Disabled()

Last updated