Skip to content

Commit

Permalink
Try to use Gmod's PrintTable
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelIT7 committed Apr 3, 2024
1 parent a237153 commit 6c73e6a
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions _testing/gmod_testing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -62,28 +62,6 @@ local code = [[local ret, err = pcall(function()
print("engine.TickInterval: ", engine.TickInterval())
print("engine.ActiveGamemode: ", engine.ActiveGamemode())
local printtbl = nil
local function PrintTable(tbl, tabs) -- I don't think we currently can load Gmod's PrintTable
if !tbl then return end
tabs = tabs or 0
local start_str = ""
for k=1, tabs do
start_str = start_str .. " "
end
for k, v in pairs(tbl) do
if (type(v) == "table") then
print(start_str .. tostring(k) .. ": ")
printtbl(v, tabs + 1)
else
print(start_str .. tostring(k), v)
end
end
end
printtbl = PrintTable
print("=== engine.GetAddons ===")
PrintTable(engine.GetAddons())
print("=== engine.GetUserContent ===")
Expand Down Expand Up @@ -117,6 +95,7 @@ local ret, err = pcall(function()
require("lua_threaded")
iFace = LuaThreaded.CreateInterface()
iFace:InitGmod()
iFace:RunFile("lua/includes/util.lua")
iFace:RunString(code)
--iFace:RunHook("ExampleHook", "ExampleArg", 1234, Vector(1, 2, 3))
end)
Expand Down

0 comments on commit 6c73e6a

Please sign in to comment.