Skip to content

Commit

Permalink
make ms.ok compatible with tables
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jul 5, 2021
1 parent da41fbf commit d08d045
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion Themes/_fallback/Scripts/10 WifeSundries.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d08d045

Please sign in to comment.