Manual iris control
This commit is contained in:
28
display.lua
28
display.lua
@ -48,6 +48,26 @@ function display.drawDisconnectButton()
|
||||
term.redirect(oldterm)
|
||||
end
|
||||
|
||||
function display.drawIrisButtons()
|
||||
if not config.irisEnabled then
|
||||
return
|
||||
end
|
||||
|
||||
local oldterm = term.redirect(mon)
|
||||
|
||||
-- Open iris button (green)
|
||||
paintutils.drawFilledBox(2, 17, 9, 19, colors.green)
|
||||
mon.setCursorPos(3, 18)
|
||||
mon.write("OPEN")
|
||||
|
||||
-- Close iris button (red)
|
||||
paintutils.drawFilledBox(11, 17, 18, 19, colors.red)
|
||||
mon.setCursorPos(12, 18)
|
||||
mon.write("CLOSE")
|
||||
|
||||
term.redirect(oldterm)
|
||||
end
|
||||
|
||||
function display.drawIrisStatus()
|
||||
mon.setCursorPos(1, 19)
|
||||
mon.setBackgroundColor(colors.black)
|
||||
@ -118,6 +138,7 @@ function display.screenWrite(list, fcount, fy)
|
||||
paintutils.drawFilledBox(23, 17, 28, 19, colors.red)
|
||||
mon.setCursorPos(24, 18)
|
||||
mon.write("Back")
|
||||
display.drawIrisButtons()
|
||||
term.redirect(oldterm)
|
||||
|
||||
return fcount, fy
|
||||
@ -157,6 +178,7 @@ function display.selectionTabs()
|
||||
mon.setCursorPos(24, 18)
|
||||
mon.write("Back")
|
||||
|
||||
display.drawIrisButtons()
|
||||
display.drawIrisStatus()
|
||||
term.redirect(oldterm)
|
||||
end
|
||||
@ -194,6 +216,9 @@ function display.showIncoming(addressName, addressString, allowed, reason)
|
||||
mon.setCursorPos(1, 7)
|
||||
mon.write(addressString)
|
||||
end
|
||||
|
||||
display.drawIrisButtons()
|
||||
display.drawIrisStatus()
|
||||
end
|
||||
|
||||
function display.showEntity(entityType, entityName, allowed)
|
||||
@ -253,6 +278,7 @@ function display.showConnected(destName, destAddr)
|
||||
paintutils.drawFilledBox(20, 17, 28, 19, colors.red)
|
||||
mon.setCursorPos(21, 18)
|
||||
mon.write("CLOSE")
|
||||
display.drawIrisButtons()
|
||||
term.redirect(oldterm)
|
||||
|
||||
display.drawIrisStatus()
|
||||
@ -265,6 +291,7 @@ function display.showMainMenu()
|
||||
mon.setCursorPos(9, 1)
|
||||
mon.setBackgroundColor(colors.red)
|
||||
mon.write("press to start")
|
||||
display.drawIrisButtons()
|
||||
display.drawIrisStatus()
|
||||
end
|
||||
|
||||
@ -313,6 +340,7 @@ function display.showPasswordPrompt()
|
||||
mon.setCursorPos(18, 17)
|
||||
mon.write("OK")
|
||||
|
||||
display.drawIrisButtons()
|
||||
term.redirect(oldterm)
|
||||
display.drawIrisStatus()
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user