MessageBox Extended |
Sun, 01 June 2014 22:05 |
Artofeel
Messages: 195 Registered: August 2013 Location: Russia
|
Senior Member |
|
|
this will show all table values (up to 4 entries)
Toggle Spoiler
function MsgTab(text,sub,trash)
local nOfLines=24
local count=0
local nFunc=0
local valueStr=""
if sub == nil or sub < 1 or sub > 4 then sub=1 end
if trash == nil then trash=false end
if type(text) == "table" then
for key,value in pairs(text) do
if type(value) ~= "function" or trash then
if type(value) == "table" and sub > 1 then
for key2,value2 in pairs(value) do
if type(value2) ~= "function" or trash then
if type(value2) == "table" and sub > 2 then
for key3,value3 in pairs(value2) do
if type(value3) ~= "function" or trash then
if type(value3) == "table" and sub > 3 then
for key4,value4 in pairs(value3) do
if type(value4) ~= "function" or trash then
valueStr = valueStr .. "\n" .. tostring(key) .. "." .. tostring(key2) .. "." .. tostring(key3) .. "." .. tostring(key4) .. " = " .. tostring(value4)
count=0
for i in string.gmatch(valueStr, "\n") do
count = count+1
if count >= nOfLines then
if string.len(valueStr) > 0 then GUI.DisplayMessageBox(tostring(valueStr)) end
valueStr = ""
end
end
else
nFunc=nFunc+1
end
end
else
valueStr = valueStr .. "\n" .. tostring(key) .. "." .. tostring(key2) .. "." .. tostring(key3) .. " = " .. tostring(value3)
end
else
nFunc=nFunc+1
end
count=0
for i in string.gmatch(valueStr, "\n") do
count = count+1
if count >= nOfLines then
if string.len(valueStr) > 0 then GUI.DisplayMessageBox(tostring(valueStr)) end
valueStr = ""
end
end
end
else
valueStr = valueStr .. "\n" .. tostring(key) .. "." .. tostring(key2) .. " = " .. tostring(value2)
end
else
nFunc=nFunc+1
end
count=0
for i in string.gmatch(valueStr, "\n") do
count = count+1
if count >= nOfLines then
if string.len(valueStr) > 0 then GUI.DisplayMessageBox(tostring(valueStr)) end
valueStr = ""
end
end
end
else
valueStr = valueStr .. "\n" .. tostring(key) .. " = " .. tostring(value)
end
else
nFunc=nFunc+1
end
count=0
for i in string.gmatch(valueStr, "\n") do
count = count+1
if count >= nOfLines then
if string.len(valueStr) > 0 then GUI.DisplayMessageBox(tostring(valueStr)) end
valueStr = ""
end
end
end
if count < nOfLines then
if string.len(valueStr) > 0 then GUI.DisplayMessageBox(tostring(valueStr)) end
end
if nFunc > 0 then GUI.DisplayMessageBox(tostring(nFunc) .. " functions omitted") end
else
GUI.DisplayMessageBox(tostring(text))
end
end
where
text is source entry
sub sets the number of output data. If it equals 1 only shows the hash table, if it is 2 shows the data from the table, if it is equal to 3 shows the data which in the table which are located in the first table, if it is equal 4...you got it? %)
trash if true show functions hash (default false)
looks quite messy but it works
as example:
same as
it also can show simple value
MsgTab(Stats.GetFat(GetLocalHero()))
local nOfLines the number of rows that will be displayed at one time, it's tuned for 1280x720 resolution
[Updated on: Sun, 01 June 2014 23:54] Report message to a moderator
|
|
|
|
|
|
Re: MessageBox Extended |
Tue, 18 November 2014 09:47 |
Artofeel
Messages: 195 Registered: August 2013 Location: Russia
|
Senior Member |
|
|
just tried to connect an external library for additional functions
and seems is not worked at all
game just crash
damn...
|
|
|