|
--]] |
|
local milling, prospecting = GetSpellInfo(51005), GetSpellInfo(31252) |
local button = CreateFrame('Button', 'Molinari', UIParent, 'SecureActionButtonTemplate, AutoCastShineTemplate') |
|
local button = CreateFrame('Button', 'Molinari', UIParent, 'SecureActionButtonTemplate AutoCastShineTemplate') |
button:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end) |
button:RegisterEvent('PLAYER_LOGIN') |
local strings = { |
[ITEM_MILLABLE] = GetSpellInfo(51005), |
[ITEM_PROSPECTABLE] = GetSpellInfo(31252), |
} |
|
-- multiply the size of the sparks for extra awesomeness |
for k, v in next, button.sparkles do |
v:SetWidth(v:GetWidth() * 3) |
v:SetHeight(v:GetHeight() * 3) |
end |
|
local function tooltipHook(self) |
local function hookScript(self) |
if(self:GetItem() and IsAltKeyDown() and not InCombatLockdown()) then |
local text = GameTooltipTextLeft2:GetText() |
local spell = strings[text] |
|
if(text and (text == ITEM_MILLABLE or text == ITEM_PROSPECTABLE)) then |
local scribe = text == ITEM_MILLABLE |
if(spell) then |
local anchor = GetMouseFocus() |
|
button:SetAttribute('macrotext', string.format('/cast %s\n/use %s %s', scribe and milling or prospecting, anchor:GetParent():GetID(), anchor:GetID())) |
button:SetAttribute('macrotext', string.format('/cast %s\n/use %s %s', spell, anchor:GetParent():GetID(), anchor:GetID())) |
button:ClearAllPoints() |
button:SetAllPoints(anchor) |
button:Show() |
|
if(scribe) then |
if(text == ITEM_MILLABLE) then |
AutoCastShine_AutoCastStart(button, 0.5, 1, 0.5) |
else |
AutoCastShine_AutoCastStart(button, 1, 0.5, 0.5) |