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
| Name | Type | What it does |
|---|---|---|
self | RMAddon | Rotation Master addon instance (implicit with colon calls). |
Returns
| 1 | RMConditionButton | Native 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
Conditions.talent.traitsWidgettreeButton=addon:CreateConditionButton();treeButton:SetText(L["Show talent tree"]);treeButton:SetAutoWidth(true)
Dependencies
buttonConstructor→UI.condition_display.buttonConstructor
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)