WoWInterface SVN Molinari

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /trunk
    from Rev 10 to Rev 11
    Reverse comparison

Rev 10 → Rev 11

Molinari/Molinari.lua
26,32 → 26,27
 
--]]
 
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)
61,7 → 56,7
end
 
function button:MODIFIER_STATE_CHANGED(event, key)
if(self:IsShown() and string.match(key, 'ALT')) then
if(self:IsShown() and string.match(key, 'ALT$')) then
if(InCombatLockdown()) then
self:RegisterEvent('PLAYER_REGEN_DISABLED')
else
82,12 → 77,24
self:SetAttribute('*type*', 'macro')
 
self:SetScript('OnLeave', function() self:Hide() end)
GameTooltip:HookScript('OnTooltipSetItem', tooltipHook)
GameTooltip:HookScript('OnTooltipSetItem', hookScript)
end
 
button:SetScript('OnEvent', function(self, event, ...) self[event](self, event, ...) end)
button:RegisterEvent('PLAYER_LOGIN')
 
-- temporary scaling of spark objects
for key, value in next, button.sparkles do
value:SetWidth(value:GetWidth() * 3)
value:SetHeight(value:GetHeight() * 3)
end
 
-- temporary fix for blizzard's bug with secure frames and anchoring on the ContainerFrame
hooksecurefunc('ContainerFrame_GenerateFrame', function(frame, size, id)
if(size ~= 1 and id == 0) then
ContainerFrame1Item1:SetPoint('BOTTOMRIGHT', ContainerFrame1, 'BOTTOMRIGHT', -12, 30)
end
end)
\ No newline at end of file +if(not CONTAINERFRAMEFIX and FUXFUXFUXFUX) then + hooksecurefunc('ContainerFrame_GenerateFrame', function(self, size, id) + if(size ~= 1 and id == 0) then + ContainerFrame1Item1:SetPoint('BOTTOMRIGHT', ContainerFrame1MoneyFrameCopperButton, 'BOTTOMRIGHT', 3, 21) + end + end) + CONTAINERFRAMEFIX = true +end \ No newline at end of file