XLQP Gen1
ElementsNavigation & windows

AddOptionGrid

Select visual option cards with optional embedded controls and runtime layout settings.

AddOptionGrid

Adds selectable option cards with images or embedded XLQP elements. Supports single or multiple selection, automatic columns, a settings popover, and saved flags. Aliases: CreateOptionGrid and OptionGrid.

local Options = Tab:AddOptionGrid({
    Name = "Mode",
    Default = "balanced",
    Options = {
        {Name = "Instant", Value = "instant"},
        {Name = "Balanced", Value = "balanced"},
        {Name = "Deep", Value = "deep"},
    },
    Callback = function(value, entry)
        print(value)
    end,
})

Options

FieldDefault / behavior
Name / TitleOption Grid.
OptionsList of option tables or scalar values.
Default / ValueInitial selected value; list for multiple selection.
Multi / MultiSelectFalse; true returns a selected-value list.
RowsTrue; false selects the vertical list layout.
Height, Width, Custom260, 500, false. Width is fixed only in custom sizing mode.
CardWidth, CardHeight82 each; minimum 54.
Spacing, Columns6 and 0. Zero columns means automatic layout.
Icon / HeaderIcon, SettingsIconHeader and settings icons.
ShowHeaderIcon, ShowSettingsButton, ShowSettingsSummaryTrue unless disabled.
Flag, SaveFlag identity and persistence through window configuration saving.
Callback(valueOrValues, entry)Selection callback.

Option entries support Name, Value, Image, Disabled, LayoutOrder, Callback, Elements, and Build / function-valued Content. Element specifications use {Type = "Slider", Config = {...}}; a builder receives the element API, content frame, option entry, and grid.

Controller

AddOption, RemoveOption, UpdateOption, Clear, Set(value, silent), Get, GetSelected, SetMulti, SetRows, SetCardSize(width, height), SetSpacing, SetColumns, SetCustom, Resize(height, width), SetIcon, SetSettingsIcon, SetSettingsOpen, and ToggleSettings.

AddElement(optionValue, elementType, config) adds a control to an existing option card and returns the created controller when successful.

The callback's first value is a scalar for single selection or a cloned selected-value list for multiple selection. Disabled cards cannot be selected.