Page 1 of 1

Lua random behaviour??

Posted: Tue Feb 20, 2018 10:01 am
by Anakin
Hey there i have three different codes, with three different results. But i don't understand them.

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
Layout.showcount = 40
Layout.x = Layout.x - 100
end

return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
Layout.showcount = 40
end
return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

code:
Hidden/Spoiler:
[code]
if ListManager_fnInitList then
print("YEEESSS")

local screenW, screenH = ScriptCB_GetScreenInfo()
FullHD_BackUpFunction = ListManager_fnInitList

ListManager_fnInitList = function(Dest, Layout,...)

print("Layout showcount", Layout.showcount)

if Layout.showcount == 22 then
Layout.width = Layout.width * screenW/800
end

return FullHD_BackUpFunction(Dest, Layout, unpack(arg))
end
else
print("NOOOOO")
end
[/code]
Result:
Hidden/Spoiler:
Image

Maybe someone can explain to me this behaviour, because i don't understand it. Why does the width not work together with the showcount??