.
This commit is contained in:
parent
ba1bc6fc45
commit
7fd0314ce8
@ -41,6 +41,10 @@ end
|
|||||||
function Snake()
|
function Snake()
|
||||||
shell.run("worm")
|
shell.run("worm")
|
||||||
end
|
end
|
||||||
|
function LightsBack()
|
||||||
|
inLightsMenu = false
|
||||||
|
selectedItem = 1
|
||||||
|
end
|
||||||
function Reboot()
|
function Reboot()
|
||||||
print("Rebooting...")
|
print("Rebooting...")
|
||||||
sleep(1)
|
sleep(1)
|
||||||
@ -65,7 +69,8 @@ mainMenu = {
|
|||||||
lightsMenu={
|
lightsMenu={
|
||||||
[1]= { text="Lights On", handler=LightsOn},
|
[1]= { text="Lights On", handler=LightsOn},
|
||||||
[2]= { text="Alarm On", handler=AlarmOn},
|
[2]= { text="Alarm On", handler=AlarmOn},
|
||||||
[3]= { text="All Off", handler=Off}
|
[3]= { text="All Off", handler=Off},
|
||||||
|
[4]= { text="Back", handler=LightsBack}
|
||||||
}
|
}
|
||||||
|
|
||||||
--[[Printing Methods]]--
|
--[[Printing Methods]]--
|
||||||
@ -86,10 +91,14 @@ function onKeyPressed( key, menu )
|
|||||||
elseif key == keys.up then
|
elseif key == keys.up then
|
||||||
if selectedItem > 1 then
|
if selectedItem > 1 then
|
||||||
selectedItem = selectedItem - 1
|
selectedItem = selectedItem - 1
|
||||||
|
else
|
||||||
|
selectedItem = #menu
|
||||||
end
|
end
|
||||||
elseif key == keys.down then
|
elseif key == keys.down then
|
||||||
if selectedItem < #menu then
|
if selectedItem < #menu then
|
||||||
selectedItem = selectedItem + 1
|
selectedItem = selectedItem + 1
|
||||||
|
else
|
||||||
|
selectedItem = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user