From 670913ee1af2c772ce053c398e37c09a08b59c96 Mon Sep 17 00:00:00 2001 From: Hendrik Leppkes Date: Sun, 9 Nov 2008 12:10:46 +0100 Subject: [PATCH] Linked the PetButton action dragging to the master "Button Lock" setting in the config --- PetButton.lua | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/PetButton.lua b/PetButton.lua index cb798b8..b1edfa6 100644 --- a/PetButton.lua +++ b/PetButton.lua @@ -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"]