WoWInterface SVN mikma

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /EnemyScanner2
    from Rev 710 to Rev 711
    Reverse comparison

Rev 710 → Rev 711

EnemyScanner2.lua
44,6 → 44,26
if self[event] then return self[event](self, event, ...) end
end)
 
-- function for SetScript("OnUpdate")
local function onUpdate(self,elapsed)
total = total + elapsed
if total >= 1 then
updating = ES2timer:GetScript("OnUpdate")
if updating and not next(ES2messages) then
debugprint(2,"Timer stopped",1,0,0)
ES2timer:SetScript("OnUpdate",nil)
EnemyScanner2:Clear()
end
for k,v in pairs(ES2temptable) do
if time() == v["spotted"] then
local uid = ES2temptable[k]
EnemyScanner2:DelMessage(uid)
end
end
total = 0
end
end
 
-- Register all the needed events.
function EnemyScanner2:Enable()
EnemyScanner2:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
172,6 → 192,7
end
 
-- Scanned, now update.
total = 0
ES2timer:SetScript("OnUpdate",onUpdate)
end
end
240,25 → 261,6
end
end
 
-- function for SetScript("OnUpdate")
local function onUpdate(self,elapsed)
total = total + elapsed
if total >= 1 then
updating = ES2timer:GetScript("OnUpdate")
if updating and not next(ES2messages) then
ES2timer:SetScript("OnUpdate",nil)
EnemyScanner2:Clear()
end
for k,v in pairs(ES2temptable) do
if time() == v["spotted"] then
local uid = ES2temptable[k]
EnemyScanner2:DelMessage(uid)
end
end
total = 0
end
end
 
-- This is where almost all of the magic is happening! CLEU <3
function EnemyScanner2:COMBAT_LOG_EVENT_UNFILTERED(_, _, minievent, _, guidsource, source, sourceflags, sourceflagsraid, guidtarget, target, targetflags, targetflagsraid, ...)
-- bit.band the flag to check the following:
377,6 → 379,18
end
end
 
local function ShowTooltip(self)
GameTooltip:SetOwner(self, "ANCHOR_NONE")
GameTooltip:SetPoint("BOTTOM", self, "TOP")
GameTooltip:ClearLines()
GameTooltip:AddLine("Doubleclick to clear messages")
GameTooltip:Show()
end
 
local function HideTooltip()
GameTooltip:Hide()
end
 
-- Initialize the anchor where rows are SetPoint'd.
function EnemyScanner2:Initialize()
anchor:SetFrameStrata("MEDIUM")
395,6 → 409,12
self:StopMovingOrSizing()
EnemyScanner2DB.position.point, EnemyScanner2DB.position.x, EnemyScanner2DB.position.y = "BOTTOMLEFT", self:GetLeft(), self:GetBottom()
end)
anchor:SetScript("OnDoubleClick", function()
ES2timer:SetScript("OnUpdate",nil)
EnemyScanner2:Clear()
end)
anchor:SetScript("OnEnter", ShowTooltip)
anchor:SetScript("OnLeave", HideTooltip)
anchor:SetPoint(EnemyScanner2DB.position.point, EnemyScanner2DB.position.x, EnemyScanner2DB.position.y)
anchor:Hide()
end