/EnemyScanner2
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") |
end |
-- Scanned, now update. |
total = 0 |
ES2timer:SetScript("OnUpdate",onUpdate) |
end |
end |
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: |
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") |
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 |