--arg1 = mouseButton |
self = PetListPlus |
local button = this |
local click = arg1 |
local i = button:GetID() |
local mode = PetPaperDollFrameCompanionFrame.mode |
local creatureID, creatureName, spellID, icon = GetCompanionInfo(mode, i) |
local creatureID, creatureName, spellID, icon, active = GetCompanionInfo(mode, i) |
|
self.model:SetCreature(creatureID) |
self.selected[mode] = i |
|
if IsModifiedClick() then |
if ( IsModifiedClick("CHATLINK") ) then |
if ( MacroFrame and MacroFrame:IsShown() ) then |
local spellName = GetSpellInfo(spellID); |
ChatEdit_InsertLink(spellName); |
else |
local spellLink = GetSpellLink(spellID) |
ChatEdit_InsertLink(spellLink); |
end |
elseif ( IsModifiedClick("PICKUPACTION") ) then |
-- CompanionButton_OnDrag(self); |
end |
else |
if (click == "RightButton") or (self.selected[mode] == i) then |
if active then |
DismissCompanion(mode) |
else |
CallCompanion(mode, i) |
end |
elseif (click == "LeftButton") then |
self.selected[mode] = i |
end |
end |
|
self:UpdateButtons() |
end |
|
function self:OnButtonDrag() |
local button = this |
local mode = PetPaperDollFrameCompanionFrame.mode |
|
PickupCompanion(mode, button:GetID()) |
end |