feat: enhance billboard monitor setup with explicit configuration and auto-detection

This commit is contained in:
MayaTheShy
2026-03-26 14:23:33 -04:00
parent fe6a6df6a3
commit 29026175b7

View File

@@ -163,9 +163,8 @@ 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
return false if cfg.BILLBOARD_MONITOR and cfg.BILLBOARD_MONITOR ~= "" then
end
local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR) local mon = peripheral.wrap(cfg.BILLBOARD_MONITOR)
if mon and mon.setTextScale then if mon and mon.setTextScale then
D.billboardMon = mon D.billboardMon = mon
@@ -174,6 +173,22 @@ function D.setupBillboardMonitor()
return true return true
end end
return false return false
end
-- Auto-detect: find any monitor not already used by main/smelter
for _, name in ipairs(peripheral.getNames()) do
if peripheral.getType(name) == "monitor"
and name ~= D.monName
and name ~= D.smelterMonName then
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
return false
end end
------------------------------------------------- -------------------------------------------------