Add new code snippets
This commit is contained in:
33
Complete Projects/BFA/Global Debug.lua
Normal file
33
Complete Projects/BFA/Global Debug.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
--DEBUG_UPDATE DEBUG_ADD
|
||||
function(e, m, t, c)
|
||||
if e == "DEBUG_UPDATE" then
|
||||
return true
|
||||
elseif e == "DEBUG_ADD" and m and t then
|
||||
if c then aura_env.DebugTextArray[#aura_env.DebugTextArray + 1] = {m, t, c} else aura_env.DebugTextArray[#aura_env.DebugTextArray + 1] = {m, t} end
|
||||
WeakAuras.ScanEvents("DEBUG_UPDATE")
|
||||
end
|
||||
end
|
||||
|
||||
--DISPLAY
|
||||
function()
|
||||
if aura_env.DebugTextArray then
|
||||
aura_env.output = ""
|
||||
if #aura_env.DebugTextArray > 0 then
|
||||
for k,v in ipairs(aura_env.DebugTextArray) do
|
||||
if v[3] then aura_env.output = aura_env.output .. "|c" .. v[3] end
|
||||
aura_env.output = aura_env.output .. v[1]
|
||||
if v[3] then aura_env.output = aura_env.output .. "|r" end
|
||||
aura_env.output = aura_env.output .. "\n"
|
||||
if v[2] > 0 then
|
||||
local aura_env = aura_env
|
||||
C_Timer.After(v[2], function() table.remove(aura_env.DebugTextArray, k); WeakAuras.ScanEvents("DEBUG_UPDATE") end)
|
||||
end
|
||||
end
|
||||
end
|
||||
return aura_env.output
|
||||
end
|
||||
end
|
||||
|
||||
--INIT
|
||||
--DevTools_Dump nice
|
||||
if not aura_env.DebugTextArray then aura_env.DebugTextArray = {} end
|
||||
Reference in New Issue
Block a user