Reference › Function reference › UI

UI.condition_display.CreateConditionLink

public

Call as

addon:CreateConditionLink()

Available directly through addon; no dependency is needed.

What it does

Create native wrapping text with optional leading image and pointer callbacks. SetImage and SetImageSize configure the image; OnEnter, OnLeave and OnClick use the condition callback contract. Add it to the callback parent with parent:AddChild(widget); callbacks expire when its lease is released.

Arguments

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

Returns

1RMConditionLinkNative interactive text and image control with measured height and disabled state.

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 link = addon:CreateConditionLink()
link:SetImage("Interface\\Icons\\Spell_Nature_Rejuvenation")
link:SetImageSize(16, 16)
link:SetText(L["Rejuvenation"])
link:SetCallback("OnClick", function(_, _, button) if button == "RightButton" then value.spell = nil end end)
parent:AddChild(link)

Dependencies

Source

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

UI.condition_display.CreateConditionLink(self)
 return self:AcquireConditionWidget('RM-ConditionLink',function() return labelConstructor(true) end)

Back to Function reference