|
--]] |
|
-- 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 |