From d08d04596cca3ad5af438aa0700148fee9bc5c75 Mon Sep 17 00:00:00 2001 From: Barinade Date: Sun, 4 Jul 2021 20:55:35 -0500 Subject: [PATCH] make ms.ok compatible with tables --- Themes/_fallback/Scripts/10 WifeSundries.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Themes/_fallback/Scripts/10 WifeSundries.lua b/Themes/_fallback/Scripts/10 WifeSundries.lua index 38629c0331..ccfe566454 100644 --- a/Themes/_fallback/Scripts/10 WifeSundries.lua +++ b/Themes/_fallback/Scripts/10 WifeSundries.lua @@ -126,12 +126,27 @@ end local musicstr = THEME:GetString("GeneralInfo", "RateMusicString") +local function dump(o) + if type(o) == "table" then + local s = "{ " + for k, v in pairs(o) do + if type(k) ~= "number" then + k = '"' .. k .. '"' + end + s = s .. "[" .. k .. "] = " .. dump(v) .. "," + end + return s .. "} " + else + return tostring(o) + end +end + -- **Functions** function ms.ok(m) if not m then SCREENMAN:SystemMessage("nahbro") else - SCREENMAN:SystemMessage(m) + SCREENMAN:SystemMessage(dump(m)) end end