Refactor everything to modules

This commit is contained in:
2025-01-01 14:57:43 +01:00
parent 59d2b999c2
commit 137ce0a3a7
12 changed files with 2119 additions and 2100 deletions

29
Modules/DumpTable.lua Normal file
View File

@@ -0,0 +1,29 @@
local addonname, shared = ...
---@cast shared HeimdallShared
---@cast addonname string
if not shared.dumpTable then
---@param table table
---@param depth number?
shared.dumpTable = function(table, depth)
if not table then
print(tostring(table))
return
end
if depth == nil then
depth = 0
end
if (depth > 200) then
print("Error: Depth > 200 in dumpTable()")
return
end
for k, v in pairs(table) do
if (type(v) == "table") then
print(string.rep(" ", depth) .. k .. ":")
shared.dumpTable(v, depth + 1)
else
print(string.rep(" ", depth) .. k .. ": ", v)
end
end
end
end