Linked the PetButton action dragging to the master "Button Lock" setting in the config

This commit is contained in:
Hendrik Leppkes
2008-11-09 12:10:46 +01:00
parent 4ca8075cfd
commit 670913ee1a
+19
View File
@@ -19,6 +19,22 @@ local function onEnter(self, ...)
KeyBound:Set(self)
end
local function onDragStart(self)
if InCombatLockdown() then return end
if not Bartender4.db.profile.buttonlock or IsModifiedClick("PICKUPACTION") then
self:SetChecked(0)
PickupPetAction(self.id)
self:Update()
end
end
local function onReceiveDrag(self)
if InCombatLockdown() then return end
self:SetChecked(0)
PickupPetAction(self.id)
self:Update()
end
Bartender4.PetButton = {}
Bartender4.PetButton.prototype = PetButtonPrototype
function Bartender4.PetButton:Create(id, parent)
@@ -37,6 +53,9 @@ function Bartender4.PetButton:Create(id, parent)
button.OnEnter = button:GetScript("OnEnter")
button:SetScript("OnEnter", onEnter)
button:SetScript("OnDragStart", onDragStart)
button:SetScript("OnReceiveDrag", onReceiveDrag)
button.flash = _G[name .. "Flash"]
button.cooldown = _G[name .. "Cooldown"]
button.icon = _G[name .. "Icon"]