Reference › Function reference › UI

UI.condition_display.CreateConditionButton

public

Call as

addon:CreateConditionButton()

Available directly through addon; no dependency is needed.

What it does

Create a native button using the shared condition widget lifecycle and workbench theme. SetText, SetDisabled and SetCallback configure its label and interaction; OnClick receives the mouse button. Add it to the callback parent with parent:AddChild(widget).

Arguments

NameTypeWhat it does
selfRMAddonRotation Master addon instance (implicit with colon calls).

Returns

1RMConditionButtonNative button with label, disabled state and lease-protected callbacks.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

It reads no game API directly.

Example

local button = addon:CreateConditionButton()
button:SetText(L["Use current target"])
button:SetCallback("OnClick", function() value.unit = "target" end)
parent:AddChild(button)

How the addon calls it

Dependencies

Source

UI/condition_display.lua, line 148. Read only in game; Duplicate makes an editable copy.

UI.condition_display.CreateConditionButton(self)
 return self:AcquireConditionWidget('RM-ConditionButton',buttonConstructor)

Back to Function reference