Menu Component
This Component refers to the return value of menu:AddButton
, menu:AddSubmenu
, menu:AddSeparator
, menu:AddCheckbox
, menu:AddList
or menu:AddSlider
.
component:SetLabel
Sets the label of the component.
component:SetLabel(label)
- label:
string
component:SetRightLabel
component:SetRightLabel
isn't available for Separators, Checkboxes, Lists
and Sliders.
Sets the label of the component.
component:SetRightLabel(rightLabel)
- rightLabel:
string
component:SetDescription
component:SetDescription
isn't available for Separators.
Sets the description of the component.
component:SetDescription(description)
- description:
string
component:SetBadges
Sets the badges of the component.
component:SetBadges(badges)
- badges:
table
(object
)- left?:
string
- right?:
string
- left?:
component:Disable
component:Disable
isn't available for Separators.
Disables/Enables the component.
component:Disable(disable)
- disable:
boolean
component:ToggleVisibility
Toggles the visibility of the component.
component:ToggleVisibility(visible)
- visible:
boolean
component:Remove
Removes the component from the menu and deletes it completely.
component:Remove()
component:OnSelect
component:Disable
isn't available for Separators.
Adds a callback that gets executed when the component is selected.
component:OnSelect(callback)
- callback:
function(component: Component)
component:OnClick
component:OnClick
isn't available for Checkboxes and Separators.
Adds a callback that gets executed when the component is clicked.
component:OnClick(callback)
- callback:
function(component: Component)