feat: enhance billboard monitor setup with explicit configuration and auto-detection
This commit is contained in:
@@ -163,15 +163,30 @@ function D.setupSmelterMonitor()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function D.setupBillboardMonitor()
|
function D.setupBillboardMonitor()
|
||||||
if not cfg.BILLBOARD_MONITOR or cfg.BILLBOARD_MONITOR == "" then
|
-- If explicitly configured, use that name
|
||||||
|
if cfg.BILLBOARD_MONITOR and cfg.BILLBOARD_MONITOR ~= "" then
|
||||||
|
local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR)
|
||||||
|
if mon and mon.setTextScale then
|
||||||
|
D.billboardMon = mon
|
||||||
|
D.billboardMonName = cfg.BILLBOARD_MONITOR
|
||||||
|
D.billboardMon.setTextScale(0.5)
|
||||||
|
return true
|
||||||
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR)
|
-- Auto-detect: find any monitor not already used by main/smelter
|
||||||
if mon and mon.setTextScale then
|
for _, name in ipairs(peripheral.getNames()) do
|
||||||
D.billboardMon = mon
|
if peripheral.getType(name) == "monitor"
|
||||||
D.billboardMonName = cfg.BILLBOARD_MONITOR
|
and name ~= D.monName
|
||||||
D.billboardMon.setTextScale(0.5)
|
and name ~= D.smelterMonName then
|
||||||
return true
|
local mon = peripheral.wrap(name)
|
||||||
|
if mon and mon.setTextScale then
|
||||||
|
D.billboardMon = mon
|
||||||
|
D.billboardMonName = name
|
||||||
|
D.billboardMon.setTextScale(0.5)
|
||||||
|
return true
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user