WoWInterface SVN gPeen

Compare Revisions

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

Rev 2 → Rev 3

gPeen/core.lua
1,3 → 1,9
if ( not LynStats ) then return end
 
if ( not LynStats.plugins ) then
LynStats.plugins = {}
end
 
local addon = CreateFrame("Button", "gPeen", LynStats)
addon.text = gPeen:CreateFontString(nil, "OVERLAY")
 
18,7 → 24,7
critical = 0,
}
 
local function getHighest()
function addon:getHighest()
local db = gPeenDB
local hit, crit = 0, 0
local lastHit, lastCrit = 0, 0
39,7 → 45,7
return hit, crit, spellHit, spellCrit
end
 
local function BuffPeen(spellName, amount, critical)
function addon:BuffPeen(spellName, amount, critical)
assert(type(spellName) == "string", format("bad argument #1 to 'BuffPeen' (string expected, got %s)", type(spellName)))
assert(type(amount) == "number", format("bad argument #2 to 'BuffPeen' (number expected, got %s)", type(amount)))
 
76,7 → 82,7
end
 
gPeenDB = db
hit, crit = getHighest()
hit, crit = self:getHighest()
addon.text:SetText("|cffffffff"..hit.."|r/|cffffffff"..crit.."|r")
addon:SetWidth(addon.text:GetStringWidth())
end
102,7 → 108,7
addon.text:SetText("|cffffffff0|r/|cffffffff0|r")
addon:SetWidth(addon.text:GetStringWidth())
elseif ( IsShiftKeyDown() and button == "LeftButton" ) then
hit, crit, spellHit, spellCrit = getHighest()
hit, crit, spellHit, spellCrit = self:getHighest()
SendChatMessage("gPeen: Highest Damage/Healing Records", channel)
SendChatMessage("-----------------------------------------------", channel)
SendChatMessage("(Normal) "..spellHit..": "..hit, channel)
112,7 → 118,7
 
local function onEvent(self, event, time, eventType, srcGUID, srcName, srcFlags, dstGUID, dstName, dstFlags, spellID, spellName, spellSchool, amount, school, resisted, blocked, absorbed, critical)
if ( not addon.text:GetText() ) then
hit, crit = getHighest()
hit, crit = self:getHighest()
addon.text:SetText("|cffffffff"..hit.."|r/|cffffffff"..crit.."|r")
addon:SetWidth(addon.text:GetStringWidth())
return
121,7 → 127,7
if ( eventType == "SPELL_DAMAGE" or eventType == "SPELL_PERIODIC_DAMAGE" or eventType == "SPELL_HEAL" or eventType == "SPELL_PERIODIC_HEAL" ) then
if ( bit_bor(srcFlags, COMBATLOG_FILTER_ME) == COMBATLOG_FILTER_ME ) then
if ( not (resisted and blocked and absorbed) ) then
BuffPeen(spellName, amount, critical)
self:BuffPeen(spellName, amount, critical)
end
end
end
138,7 → 144,6
addon:SetWidth(addon.text:GetStringWidth())
addon:SetHeight(15)
addon:SetScale(GetCVar("UIScale"))
addon:SetPoint("RIGHT", LynStats, "LEFT", -20, 0)
addon:SetScript("OnEnter", onEnter)
addon:SetScript("OnLeave", function() GameTooltip:Hide() end)
addon:SetScript("OnClick", onClick)
147,4 → 152,6
addon:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
addon:RegisterEvent("PLAYER_LOGIN")
 
tinsert(LynStats.plugins, addon)
 
addon:SetPoint("RIGHT", LynStats, "LEFT", -(#LynStats.plugins * 20), 0)