From 3e6f25f17c114d5cfeafdfd47bf55348c7e3b91a Mon Sep 17 00:00:00 2001 From: Applevangelist Date: Fri, 26 May 2023 08:28:08 +0200 Subject: [PATCH] #UTILS * Added UTILS.PrintTableToLog() --- Moose Development/Moose/Utilities/Utils.lua | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Moose Development/Moose/Utilities/Utils.lua b/Moose Development/Moose/Utilities/Utils.lua index 14557fe47..7b0467ed1 100644 --- a/Moose Development/Moose/Utilities/Utils.lua +++ b/Moose Development/Moose/Utilities/Utils.lua @@ -385,6 +385,23 @@ UTILS.BasicSerialize = function(s) end end +function UTILS.PrintTableToLog(table, indent) + if not table then + BASE:E("No table passed!") + return + end + if not indent then indent = 0 end + for k, v in pairs(table) do + if type(v) == "table" then + BASE:I(string.rep(" ", indent) .. tostring(k) .. " = {") + UTILS.PrintTableToLog(v, indent + 1) + BASE:I(string.rep(" ", indent) .. "}") + else + BASE:I(string.rep(" ", indent) .. tostring(k) .. " = " .. tostring(v)) + end + end +end + UTILS.ToDegree = function(angle) return angle*180/math.pi