🔑CMenuBind

CMenuBind metatable.

:Name(): string

Returns widget's name.


Returns widget's parent.


Returns widget's type.


:Open(): nil

Opens parent tabs.


:ForceLocalization(newText: string): nil

Not recommended for use due to its complexity

Name
Type
Description

newText

string

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


:ToolTip(newText: string): string

Name
Type
Description

newText

string

Gets or sets tooltip. Tooltip is displayed when mouse cursor is over the widget. Depends on the argument.


:ToolTip(): string


:Visible(value: boolean): nil

Name
Type
Description

value

boolean

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

Name
Type
Description

value

boolean

Gets or sets disabled state. Depends on argument.

Example

-- setter
widget:Disabled( false )

:Disabled(): boolean

Example

-- getter
local isDisabled = widget:Disabled()

:Unsafe(value: boolean): nil

Name
Type
Description

value

boolean

Gets or sets unsafe state. Unsafe widgets have warning sign. Depends on argument.


:Unsafe(): boolean


:Get(idx [?]: 0|1): Enum.ButtonCode

Name
Type
Description

idx [?]

0|1

index of the button to get value from (default: 0)

Returns widget's value. To get both of the buttons use Buttons method.


:Set(key1: Enum.ButtonCode, key2 [?]: Enum.ButtonCode): nil

Name
Type
Description

key1

primary button code

key2 [?]

secondary button code (default: Enum.ButtonCode.KEY_NONE)

Sets widget's value.


Returns widget's buttons value.


:IsDown(): boolean

Returns true when the key or both keys is down.


:IsPressed(): boolean

Returns true when the key or both keys is pressed for the first time.


:IsToggled(): boolean

Bind stores it's toggle state and switches it when the key is pressed. This method returns this state.


:SetToggled(value: boolean): nil

Name
Type
Description

value

boolean

Sets the toggle state manually.


:Image(imagePath: string, offset [?]: Vec2): nil

Name
Type
Description

imagePath

string

Path to the image.

offset [?]

Optional image offset. (default: {0.0, 0.0})

Sets widget's image.


:Icon(icon: string, offset [?]: Vec2): nil

Name
Type
Description

icon

string

icon unicode.

offset [?]

Optional icon offset. (default: {0.0, 0.0})

Sets widget's icon. Icons list

Example

--https://fontawesome.com/icons/user?f=classic&s=solid
switch:Icon("\f{007}")

:SetCallback(callback: fun(this: CMenuBind):nil, forceCall [?]: boolean): nil

Multiple callbacks could be set.

Name
Type
Description

callback

fun(this: CMenuBind):nil

function to be called on widget change.

forceCall [?]

boolean

true if you want to call callback on widget creation. (default: false)

Sets widget's on change callback.


:UnsetCallback(callback: fun(this: CMenuBind):nil): nil

Name
Type
Description

callback

fun(this: CMenuBind):nil

function to be removed from widget's callbacks.

Removes widget's on change callback.


:ColorPicker(name: string, color: Color): CMenuColorPickerAttachment

Name
Type
Description

name

string

Name of the attachment.

color

Default color.

Creates CMenuColorPickerAttachment and attaches it to the widget.


:Gear(name: string, gearIcon [?]: string, useSmallFont [?]: boolean): CMenuGearAttachment

Name
Type
Description

name

string

Name of the attachment.

gearIcon [?]

string

Gear FontAwesome icon. (default: "\uf013")

useSmallFont [?]

boolean

Use small font for gear icon. (default: true)

Creates CMenuGearAttachment and attaches it to the widget.


:Properties(name [?]: string, value [?]: string, markAsToggle [?]: boolean): nil

Name
Type
Description

name [?]

string

Overridden name to display in bind list. (default: nil)

value [?]

string

Overridden value to display alongside the name in the bind list. This can be used to provide additional context about the bind. (default: nil)

markAsToggle [?]

boolean

Indicates whether the bind should be marked as a toggle, which is particularly useful if the bind's functionality includes toggling states. Recommended to be used in conjunction with the IsToggled(). (default: false)

Updates the properties of a widget for display in the bind list.


:ShowInBindIsland(newStatus: boolean): boolean

Name
Type
Description

newStatus

boolean

Gets or sets the visibility of the bind in the bind island.


:ShowInBindIsland(): boolean


:MouseBinding(newStatus: boolean): boolean

Name
Type
Description

newStatus

boolean

Gets or sets the ability to bind the mouse button.


:MouseBinding(): boolean

Last updated