PRINT CONDITIONS -- will display a list of all conditions & their values
PRINT VALUES -- will display a list of all values & their values
--[[
*********************************************************************************
INVENTORY
*********************************************************************************]]--
local inventory_States = {
[1] = function () end,
[2] = function ()
local inventory = getObject("Interfaces[inventory]")
local p = inventory:getPoint(VInterfaceOffset)
if p.y<=640 then
getObject("Values[inventory_state]"):setValue(VValueInt, 1)
else
p.y= p.y-2
inventory:setValue(VInterfaceOffset,p)
end
end,
[3] = function ()
local inventory = getObject("Interfaces[inventory]")
local p = inventory:getPoint(VInterfaceOffset)
if p.y>=696 then
getObject("Values[inventory_state]"):setValue(VValueInt, 1)
else
p.y= p.y+2
inventory:setValue(VInterfaceOffset,p)
end
end
}
function updateInventory()
local inventory_state = getObject("Values[inventory_state]"):getInt(VValueInt)
inventory_States[inventory_state]()
end
--[[
*********************************************************************************
HANDLERS
*********************************************************************************]]--
function updateInterfaces()
updateInventory()
end
function onMainLoop()
updateInterfaces() -- updates all Interface Positions
end
registerEventHandler("mainLoop", "onMainLoop")