Please rename the print function to some other name. As a developer, it is important for me to display the values of variables in the chat and I use the original Blizzard code for this function, but your addon overwrites it...
The functionality of your implementation is the simplest and it is not able to display several variables, and also an unnecessary postscript [INFO] is added... Please rename your function or modify it to the original Blizzard functionality. I attach the original code below:
local LOCAL_ToStringAllTemp = {}
function tostringall(...)
local n = getn(arg)
-- Simple versions for common argument counts
if (n == 1) then
return tostring(arg[1])
elseif (n == 2) then
return tostring(arg[1]), tostring(arg[2])
elseif (n == 3) then
return tostring(arg[1]), tostring(arg[2]), tostring(arg[3])
elseif (n == 0) then
return
end
local needfix
for i = 1, n do
local v = arg[i]
if (type(v) ~= "string") then
needfix = i
break
end
end
if (not needfix) then return unpack(arg) end
wipe(LOCAL_ToStringAllTemp)
for i = 1, needfix - 1 do
LOCAL_ToStringAllTemp[i] = arg[i]
end
for i = needfix, n do
LOCAL_ToStringAllTemp[i] = tostring(arg[i])
end
return unpack(LOCAL_ToStringAllTemp)
end
local LOCAL_PrintHandler = function(...)
DEFAULT_CHAT_FRAME:AddMessage(strjoin(" ", tostringall(unpack(arg))))
end
function setprinthandler(func)
if (type(func) ~= "function") then
error("Invalid print handler")
else
LOCAL_PrintHandler = func
end
end
function getprinthandler() return LOCAL_PrintHandler end
local function print_inner(...)
local ok, err = pcall(LOCAL_PrintHandler, unpack(arg))
if (not ok) then
local func = geterrorhandler()
func(err)
end
end
function print(...)
pcall(print_inner, unpack(arg))
end
SLASH_PRINT1 = "/print"
SlashCmdList["PRINT"] = print
Please rename the
print
function to some other name. As a developer, it is important for me to display the values of variables in the chat and I use the original Blizzard code for this function, but your addon overwrites it... The functionality of your implementation is the simplest and it is not able to display several variables, and also an unnecessary postscript[INFO]
is added... Please rename your function or modify it to the original Blizzard functionality. I attach the original code below: