Moved Hotkey and MacroText handling to the ButtonBar prototype and show the Hotkey on Pet and Stance Bar (default off)

This commit is contained in:
Hendrik Leppkes
2008-11-01 14:51:45 +01:00
parent f4ee55d1a4
commit 29f204b662
8 changed files with 78 additions and 46 deletions
+14
View File
@@ -42,6 +42,7 @@ function Bartender4.PetButton:Create(id, parent)
button.icon = _G[name .. "Icon"]
button.autocastable = _G[name .. "AutoCastable"]
button.autocast = _G[name .. "Shine"]
button.hotkey = _G[name .. "HotKey"]
button:SetNormalTexture("")
local oldNT = button:GetNormalTexture()
@@ -120,6 +121,19 @@ function PetButtonPrototype:Update()
end
end
self:UpdateCooldown()
self:UpdateHotkeys()
end
function PetButtonPrototype:UpdateHotkeys()
local key = self:GetHotkey() or ""
local hotkey = self.hotkey
if key == "" or self.parent.config.hidehotkey then
hotkey:Hide()
else
hotkey:SetText(key)
hotkey:Show()
end
end
function PetButtonPrototype:ShowButton()