WoWInterface SVN gPeen

Compare Revisions

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

Rev 3 → Rev 2

gPeen/core.lua
1,9 → 1,3
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")
 
24,7 → 18,7
critical = 0,
}
 
function addon:getHighest()
local function getHighest()
local db = gPeenDB
local hit, crit = 0, 0
local lastHit, lastCrit = 0, 0
45,7 → 39,7
return hit, crit, spellHit, spellCrit
end
 
function addon:BuffPeen(spellName, amount, critical)
local function 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)))
 
82,7 → 76,7
end
 
gPeenDB = db
hit, crit = self:getHighest()
hit, crit = getHighest()
addon.text:SetText("|cffffffff"..hit.."|r/|cffffffff"..crit.."|r")
addon:SetWidth(addon.text:GetStringWidth())
end
108,7 → 102,7
addon.text:SetText("|cffffffff0|r/|cffffffff0|r")
addon:SetWidth(addon.text:GetStringWidth())
elseif ( IsShiftKeyDown() and button == "LeftButton" ) then
hit, crit, spellHit, spellCrit = self:getHighest()
hit, crit, spellHit, spellCrit = getHighest()
SendChatMessage("gPeen: Highest Damage/Healing Records", channel)
SendChatMessage("-----------------------------------------------", channel)
SendChatMessage("(Normal) "..spellHit..": "..hit, channel)
118,7 → 112,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 = self:getHighest()
hit, crit = getHighest()
addon.text:SetText("|cffffffff"..hit.."|r/|cffffffff"..crit.."|r")
addon:SetWidth(addon.text:GetStringWidth())
return
127,7 → 121,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
self:BuffPeen(spellName, amount, critical)
BuffPeen(spellName, amount, critical)
end
end
end
144,6 → 138,7
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)
152,6 → 147,4
addon:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
addon:RegisterEvent("PLAYER_LOGIN")
 
tinsert(LynStats.plugins, addon)
 
addon:SetPoint("RIGHT", LynStats, "LEFT", -(#LynStats.plugins * 20), 0)