📋CMenuMultiSelect

CMenuMultiSelect metatable.

:Name(): string

Returns widget's name.


:Update(items: {nameId: string, imagePath: string, isEnabled: boolean}[], expanded [?]: boolean): nil

Name
Type
Description

items

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

See CMenuGroup:MultiSelect.

expanded [?]

boolean

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

Updates the multiselect values.


:OneItemSelection(newState: boolean): boolean

Name
Type
Description

newState

boolean

Gets or sets one item selection state. One item selection allows only one item to be selected. Depends on the argument.


:OneItemSelection(): boolean


:DragAllowed(newState: boolean): boolean

Name
Type
Description

newState

boolean

Gets or sets drag allowed state. Drag allows items to be ordered by cursor. Depends on the argument.


:DragAllowed(): boolean


Returns widget's parent.


Returns widget 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(itemId: string): boolean

Name
Type
Description

itemId

string

Returns enable state of the item in multiselect.


:Set(enabledItems: string[]): nil

Name
Type
Description

enabledItems

string[]

A table of enabled items; other items will be disabled.

Sets a new value for the item by itemId or sets a new list of enabled items


:Set(itemId: string, value: boolean): nil

Name
Type
Description

itemId

string

value

boolean


:ListEnabled(): string[]

Returns array of enabled itemIds.


: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
widget:Icon("\f{007}")

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

Multiple callbacks could be set.

Name
Type
Description

callback

fun(this: CMenuMultiSelect):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: CMenuMultiSelect):nil): nil

Name
Type
Description

callback

fun(this: CMenuMultiSelect):nil

function to be removed from widget's callbacks.

Removes widget's on change callback.


:UpdateBackgroundColors(colors: table<string>): nil

Name
Type
Description

colors

table<string>

Table with background colors.

Updates widget's background colors.


:UpdateImageColors(colors: table<string>): nil

Name
Type
Description

colors

table<string>

Table with image colors.

Updates widget's image colors.


:UpdateToolTips(colors: table<string>): nil

Name
Type
Description

colors

table<string>

Table with new tooltips

Updates widget's tooltips

Last updated