Update visum.lua

This commit is contained in:
Ale32bit 2015-12-24 16:20:12 +01:00
parent 9e6fd4f58f
commit 568666cdff

View file

@ -98,7 +98,7 @@ function box(startX,startY,endX,endY,nColour) -- Paintutils API - Made to preven
end end
end end
function buttons(buList) function buttons(buList,ignoreEvent)
if type(buList) ~= "table" then if type(buList) ~= "table" then
error("invalid arg #1 (table expected, got "..tostring(type(buList))..")", 1) error("invalid arg #1 (table expected, got "..tostring(type(buList))..")", 1)
end end
@ -107,9 +107,14 @@ function buttons(buList)
box(buList[k][2],buList[k][3],buList[k][4],buList[k][5],buList[k][6]) box(buList[k][2],buList[k][3],buList[k][4],buList[k][5],buList[k][6])
term.setCursorPos(buList[k][2],buList[k][3]) term.setCursorPos(buList[k][2],buList[k][3])
term.setTextColor(buList[k][7]) term.setTextColor(buList[k][7])
print(buList[k][8]) if buList[k][9] then
term.setCursorPos(buList[k][2],buList[k][3] + buList[k][9] - 1)
else
term.setCursorPos(buList[k][2],buList[k][3])
end
write(buList[k][8])
end end
while true do while not ignoreEvent do
e,mk,mx,my = os.pullEvent() e,mk,mx,my = os.pullEvent()
if e == "mouse_click" or e == "monitor_touch" then if e == "mouse_click" or e == "monitor_touch" then
for k, v in ipairs(buList) do for k, v in ipairs(buList) do
@ -121,8 +126,8 @@ function buttons(buList)
end end
end end
function menu() local function menu()
return nil
end end
--More functions will be added --More functions will be added