WoWInterface SVN Molinari

Compare Revisions

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

Rev 3 → Rev 4

Molinari/Molinari.lua
13,7 → 13,7
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
 
· Neither the name of the <ORGANIZATION> nor the names of its contributors may
· Neither the name of the add-on nor the names of its contributors may
be used to endorse or promote products derived from this software without
specific prior written permission.
 
30,40 → 30,37
 
--]]
 
-- todo:
-- - fix the issue with backpack, god knows what fucks it over
local tooltip, tooltipHook = GameTooltip
 
 
local tooltip, onShow = GameTooltip
 
local button = CreateFrame('Button', 'Molinari', UIParent, 'SecureActionButtonTemplate AutoCastShineTemplate')
button:RegisterForClicks('LeftButtonUp')
button:RegisterEvent('MODIFIER_STATE_CHANGED')
 
-- lazy hack for blizzard's sizes
 
for k, v in next, button.sparkles do
v:SetWidth(v:GetWidth() * 3)
v:SetHeight(v:GetHeight() * 3)
end
 
do
local spell = GetSpellInfo(51005)
local macro = '/cast %s\n/use %s %s' -- bag slot
local milling, prospecting = GetSpellInfo(51005), GetSpellInfo(31252)
local macro = '/cast %s\n/use %s %s'
local orig = tooltip:GetScript('OnTooltipSetItem')
 
function tooltipHook(self, ...)
if(self and orig) then orig(self, ...) end
local item = self:GetItem()
 
if(item) then
if(self:GetItem()) then
local text = GameTooltipTextLeft2:GetText()
 
if(text and text == ITEM_MILLABLE and not InCombatLockdown() and IsAltKeyDown()) then
button:ClearAllPoints()
button:SetAttribute('macrotext', macro:format(spell, GetMouseFocus():GetParent():GetID(), GetMouseFocus():GetID()))
button:SetAllPoints(GetMouseFocus())
AutoCastShine_AutoCastStart(button, 0.5, 1, 0.5)
button:Show()
if(text and not InCombatLockdown() and IsAltKeyDown()) then
if(text == ITEM_MILLABLE or text == ITEM_PROSPECTABLE) then
local spell = text == ITEM_MILLABLE and milling or prospecting
button:ClearAllPoints()
button:SetAttribute('macrotext', macro:format(spell, GetMouseFocus():GetParent():GetID(), GetMouseFocus():GetID()))
button:SetAllPoints(GetMouseFocus())
AutoCastShine_AutoCastStart(button, 0.5, 1, 0.5)
button:Show()
end
end
end
end