fixed stupid mistake x3
This commit is contained in:
15
display.lua
15
display.lua
@ -38,6 +38,14 @@ end
|
|||||||
-- DRAWING FUNCTIONS
|
-- DRAWING FUNCTIONS
|
||||||
---------------------------------------------
|
---------------------------------------------
|
||||||
|
|
||||||
|
function display.drawDisconnectButton()
|
||||||
|
local oldterm = term.redirect(mon)
|
||||||
|
paintutils.drawFilledBox(20, 17, 28, 19, colors.red)
|
||||||
|
mon.setCursorPos(21, 18)
|
||||||
|
mon.write("CLOSE")
|
||||||
|
term.redirect(oldterm)
|
||||||
|
end
|
||||||
|
|
||||||
function display.drawIrisStatus()
|
function display.drawIrisStatus()
|
||||||
mon.setCursorPos(1, 19)
|
mon.setCursorPos(1, 19)
|
||||||
mon.setBackgroundColor(colors.black)
|
mon.setBackgroundColor(colors.black)
|
||||||
@ -206,6 +214,13 @@ function display.showConnected(destName, destAddr)
|
|||||||
mon.write(" ")
|
mon.write(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- Draw disconnect button
|
||||||
|
local oldterm = term.redirect(mon)
|
||||||
|
paintutils.drawFilledBox(20, 17, 28, 19, colors.red)
|
||||||
|
mon.setCursorPos(21, 18)
|
||||||
|
mon.write("CLOSE")
|
||||||
|
term.redirect(oldterm)
|
||||||
|
|
||||||
display.drawIrisStatus()
|
display.drawIrisStatus()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -98,13 +98,16 @@ local function ParaDisconnect()
|
|||||||
local dx, dy = 0, 0
|
local dx, dy = 0, 0
|
||||||
_, _, dx, dy = os.pullEvent("monitor_touch")
|
_, _, dx, dy = os.pullEvent("monitor_touch")
|
||||||
|
|
||||||
if (dx ~= 0) and (dy ~= 0) then
|
-- Only disconnect if clicking the disconnect button (bottom-right corner)
|
||||||
|
if dy >= 17 and dy <= 19 and dx >= 20 and dx <= 28 then
|
||||||
gate.disconnectStargate()
|
gate.disconnectStargate()
|
||||||
redstone.setOutput("top", false)
|
redstone.setOutput("top", false)
|
||||||
utils.log("Manual disconnect triggered")
|
utils.log("Manual disconnect triggered")
|
||||||
end
|
|
||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
-- Return nothing to keep waiting if clicked elsewhere
|
||||||
|
return nil
|
||||||
|
end
|
||||||
|
|
||||||
local function EntityRead()
|
local function EntityRead()
|
||||||
sleep(0.1)
|
sleep(0.1)
|
||||||
@ -263,6 +266,7 @@ local function MonitorRemoteIris()
|
|||||||
mon.setCursorPos(3, 10)
|
mon.setCursorPos(3, 10)
|
||||||
mon.write("Connection unsafe")
|
mon.write("Connection unsafe")
|
||||||
display.drawIrisStatus()
|
display.drawIrisStatus()
|
||||||
|
display.drawDisconnectButton()
|
||||||
else
|
else
|
||||||
display.showConnected(destAddressname, destAddress)
|
display.showConnected(destAddressname, destAddress)
|
||||||
end
|
end
|
||||||
@ -586,6 +590,7 @@ local function handleOutgoingDial()
|
|||||||
mon.setCursorPos(3, 10)
|
mon.setCursorPos(3, 10)
|
||||||
mon.write("Connection unsafe")
|
mon.write("Connection unsafe")
|
||||||
display.drawIrisStatus()
|
display.drawIrisStatus()
|
||||||
|
display.drawDisconnectButton()
|
||||||
else
|
else
|
||||||
-- Remote iris is open or no iris present
|
-- Remote iris is open or no iris present
|
||||||
display.showConnected(destAddressname, destAddress)
|
display.showConnected(destAddressname, destAddress)
|
||||||
|
|||||||
Reference in New Issue
Block a user