/trunk
--]] |
-- todo: |
-- - fix the issue with backpack, god knows what fucks it over |
local tooltip, onShow = GameTooltip |
local button = CreateFrame('Button', 'Molinari', UIParent, 'SecureActionButtonTemplate AutoCastShineTemplate') |
do |
local spell = GetSpellInfo(51005) |
local macro = '/cast %s\n/use %s' |
local macro = '/cast %s\n/use %s %s' -- bag slot |
local orig = tooltip:GetScript('OnTooltipSetItem') |
function onShow(self, ...) |
function tooltipHook(self, ...) |
if(self and orig) then orig(self, ...) end |
local item = self:GetItem() |
if(text and text == ITEM_MILLABLE and not InCombatLockdown() and IsAltKeyDown()) then |
button:ClearAllPoints() |
button:SetAttribute('macrotext', macro:format(spell, item)) |
button:SetAttribute('macrotext', macro:format(spell, GetMouseFocus():GetParent():GetID(), GetMouseFocus():GetID())) |
button:SetAllPoints(GetMouseFocus()) |
AutoCastShine_AutoCastStart(button, 0.5, 1, 0.5) |
button:Show() |
button:SetFrameStrata('DIALOG') |
button:SetScript('OnLeave', function(self) self:Hide() end) |
button:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end) |
tooltip:SetScript('OnTooltipSetItem', onShow) |