A modal dialog (fl_selector) that asks the player to pick one choice from a combo box.
It shows itself in the center of the screen as soon as it is created. Set its texts with
set_title, set_text and set_value, and add the choices with add_choice; picking a
choice runs its callback and removes the dialog. Derives from DFrame.
Summary
Methods
Methods
Adds a choice to the combo box. Selecting it runs the callback and removes the selector.
local selector = vgui.Create('fl_selector')
selector:set_title(t'ui.admin.selector.title')
selector:set_text(t'ui.admin.selector.message')
selector:set_value(t'ui.admin.selector.roles')
for _, role in pairs(Bolt:get_roles()) do
selector:add_choice(role.name, function()
Cable.send('fl_bolt_set_role', self.player, role.role_id)
end)
end
Parameters
- text String label of the choice
- callback Function optional, defaults to
nilcalled without arguments when the choice is selected
Builds and shows the modal dialog: a message label and a combo box. Selecting a choice runs its callback and removes the selector.
Sets the message shown above the combo box and resizes the dialog to fit it.
Parameters
- text String
Sets the title of the dialog window.
Parameters
- text String
Sets the text shown in the combo box before anything is selected.
Parameters
- value String
Resizes the dialog to fit the message and the combo box.