Added hazard gate prompt
This commit is contained in:
10
display.lua
10
display.lua
@ -16,6 +16,7 @@ local localGateAddress
|
||||
local buttonXY = {}
|
||||
local computerAddresses = {}
|
||||
local computerNames = {}
|
||||
local hazardReasons = {}
|
||||
local x, y = 0, 0
|
||||
|
||||
function display.init(monitor, cfg, addr, utilsModule, localAddr)
|
||||
@ -27,13 +28,14 @@ function display.init(monitor, cfg, addr, utilsModule, localAddr)
|
||||
end
|
||||
|
||||
function display.getButtonData()
|
||||
return buttonXY, computerAddresses, computerNames
|
||||
return buttonXY, computerAddresses, computerNames, hazardReasons
|
||||
end
|
||||
|
||||
function display.clearButtonData()
|
||||
buttonXY = {}
|
||||
computerAddresses = {}
|
||||
computerNames = {}
|
||||
hazardReasons = {}
|
||||
end
|
||||
|
||||
---------------------------------------------
|
||||
@ -116,6 +118,12 @@ function display.screenWrite(list, fcount, fy)
|
||||
table.insert(buttonXY, { x1, x2, fy })
|
||||
table.insert(computerNames, list[i][1])
|
||||
table.insert(computerAddresses, list[i][2])
|
||||
-- Store hazard reason if present (third element in hazard gates)
|
||||
if list[i][3] then
|
||||
table.insert(hazardReasons, list[i][3])
|
||||
else
|
||||
table.insert(hazardReasons, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user