Draggable minimap button with tooltip, click handlers, and position persistence.
ui:MinimapButton({
icon = "Interface\\Icons\\Ability_warrior_charge",
tooltip = "My Routine",
angle = 220,
onClick = function(button, ui) ui.frame:Toggle() end,
onRightClick = function(button, ui)
synq.enabled = not synq.enabled
end,
})
| Option | Type | Default | Description |
|---|---|---|---|
| icon | string | Question mark icon | Texture path |
| tooltip | string | function(GameTooltip) | UI title | Hover tooltip |
| angle | number | 220 | Initial position (degrees) |
| onClick | function(button, ui) | Toggle UI frame | Left-click handler |
| onRightClick | function(button, ui) | none | Right-click handler |
Default left-click toggles ui.frame. Position auto-saves and is drag-to-reposition. Combat-safe on all unlockers.
Pass a function to tooltip for dynamic, multi-line tooltip content:
ui:MinimapButton({
icon = "Interface\\Icons\\Spell_shadow_shadowbolt",
tooltip = function(tip)
tip:AddLine("|cFFFFD700My Routine|r")
tip:AddLine("Left-click: Settings")
tip:AddLine(synq.enabled and "|cFF00FF00Enabled|r" or "|cFFFF0000Disabled|r")
end,
})
Access the button frame directly via ui.minimapButton after creation.
Next: See a complete Getting Started Example putting it all together.