WoWInterface SVN PetListPlus

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 3 to Rev 4
    Reverse comparison

Rev 3 → Rev 4

trunk/Main.lua
80,6 → 80,8
button:EnableMouseWheel(true)
button:SetWidth(150)
button:SetHeight(32)
button:RegisterForClicks("LeftButtonUp", "RightButtonUp")
button:RegisterForDrag("LeftButton")
 
button.icon = button:CreateTexture("$parentIcon", "ARTWORK")
button.icon:SetWidth(32)
101,13 → 103,12
button.name:SetPoint("TOPLEFT", button.icon, "TOPRIGHT", 5, -2)
button.name:SetPoint("BOTTOMRIGHT")
 
button:SetScript("OnClick", self.OnButtonClick)
--function()
--self.model:SetCreature(button:GetID())
-- self:OnButtonClick(button, arg1)
--end)
--local cooldown = CreateFrame("Cooldown", "$parentCooldown", button, "CooldownFrameTemplate")
 
button:SetScript("OnMouseWheel", function(_,direction)
button:SetScript("OnClick", self.OnButtonClick)
button:SetScript("OnDragStart", self.OnButtonDrag)
button:SetScript("OnReceiveDrag", self.OnButtonDrag)
button:SetScript("OnMouseWheel", function(_,direction)
--Scrolls +2/-2, doesnt exceed max value
self.scrollBar:SetValue(min(self.scrollBar:GetValue() + (direction * -2), select(2, self.scrollBar:GetMinMaxValues())))
end)
160,13 → 161,42
--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