diff --git a/Spew.lua b/Spew.lua index 7493a37..544089f 100644 --- a/Spew.lua +++ b/Spew.lua @@ -44,7 +44,12 @@ local function pretty_tostring(value, depth) if t == "string" then return '|cff00ff00"'..value:gsub("|", "||"):gsub("([\001-\031\128-\255])", escape)..'"|r' elseif t == "table" then if depth > TABLEDEPTH then return "|cff9f9f9f{...}|r" - elseif type(rawget(value, 0)) == "userdata" and type(value.GetObjectType) == "function" then return "|cffffea00<"..value:GetObjectType()..":"..(value:GetName() or "(anon)")..">|r" + elseif type(rawget(value, 0)) == "userdata" and type(value.GetObjectType) == "function" then + if value.IsForbidden and value:IsForbidden() then + return "|cffff0000|r" + else + return "|cffffea00<"..value:GetObjectType()..":"..(value:GetName() or "(anon)")..">|r" + end else return "|cff9f9f9f"..string.join(", ", TableToString(value, nil, nil, depth+1)).."|r" end elseif colors[t] then return colors[t]..tostring(value).."|r" else return tostring(value) end @@ -86,7 +91,11 @@ function Spew(input, a1, ...) if type(a1) == "table" then if type(rawget(a1, 0)) == "userdata" and type(a1.GetObjectType) == "function" then -- We've got a frame! - Print("|cffffea00<"..a1:GetObjectType()..":"..(a1:GetName() or input.."(anon)").."|r") + if a1:IsForbidden() then + Print("|cffff0000