From 01ac488aef95018d92ea5c07015cd6f65ec97a0b Mon Sep 17 00:00:00 2001 From: HenryDu8133 <813367384@qq.com> Date: Tue, 4 Aug 2026 11:29:45 +0800 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E8=A7=A3=E5=86=B3=E7=BB=88?= =?UTF-8?q?=E7=AB=AF=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2=E6=96=87=E5=AD=97?= =?UTF-8?q?=E9=87=8D=E5=8F=A0=E4=B8=8E=E5=81=9C=E7=AB=99=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E8=BF=9B=E7=AB=99=E9=A2=84=E5=91=8A=E8=AF=AF=E6=8A=A5=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 修复配置界面 UI 布局:当发车音乐可用列表过长时导致与后续输入提示重叠的问题,通过拆分显示并换行解决。 2. 彻底解决停站时误报进站预告:当 CC 电脑检测到当前站台已有列车停靠(`State.currentTrain ~= nil`)时,无论显示器上显示的是该站台的当前列车发车倒计时,还是被阻塞的下一班列车的到达倒计时,均强制抑制针对该站台的“进站预告”触发,直至站台被清空。 --- station_broadcast.lua | 44 ++++++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 15 deletions(-) diff --git a/station_broadcast.lua b/station_broadcast.lua index 8b725ea..4b665d6 100644 --- a/station_broadcast.lua +++ b/station_broadcast.lua @@ -1,6 +1,6 @@ -- 1. Configuration & Constants -local APP_VERSION_TEXT = "v1.0.57" +local APP_VERSION_TEXT = "v1.0.58" local CONFIG = { CLOUD_URL = "ws://stabadmin.fse-media.group", @@ -273,9 +273,11 @@ function Utils.promptSlaveIdentity() term.setCursorPos(1, 10) term.setTextColor(colors.gray) - term.write("Available beeps: " .. availStr) - term.setTextColor(colors.white) + term.write("Available beeps:") term.setCursorPos(1, 11) + term.write(availStr) + term.setTextColor(colors.white) + term.setCursorPos(1, 13) term.write("Departure beep (e.g. fc1): ") term.setCursorPos(30, 6) @@ -285,15 +287,15 @@ function Utils.promptSlaveIdentity() term.setCursorPos(31, 8) local stationPlatform = Utils.trim(read() or "") - term.setCursorPos(32, 11) + term.setCursorPos(32, 13) local departureBeep = Utils.trim(read() or "") if departureBeep == "" then departureBeep = "fc1" end if stationCode == "" or stationPlatform == "" then - term.setCursorPos(1, 12) + term.setCursorPos(1, 15) term.setTextColor(colors.red) term.write("Both station code and platform are required.") - term.setCursorPos(1, 14) + term.setCursorPos(1, 16) term.setTextColor(colors.lightGray) term.write("Press any key to retry...") os.pullEvent("key") @@ -359,9 +361,11 @@ function Utils.promptConfig() term.setCursorPos(1, 10) term.setTextColor(colors.gray) - term.write("Available beeps: " .. availStr) - term.setTextColor(colors.white) + term.write("Available beeps:") term.setCursorPos(1, 11) + term.write(availStr) + term.setTextColor(colors.white) + term.setCursorPos(1, 13) term.write("Departure beep [" .. currentBeep .. "]: ") term.setCursorPos(30, 6) @@ -373,17 +377,17 @@ function Utils.promptConfig() local platformInput = Utils.trim(read() or "") if platformInput == "" then platformInput = currentPlatform end - term.setCursorPos(32, 11) + term.setCursorPos(32, 13) local beepInput = Utils.trim(read() or "") if beepInput == "" then beepInput = currentBeep end local ok = Utils.saveStationIdentity(codeInput, platformInput, beepInput) if ok then Utils.refreshStationIdentity() - term.setCursorPos(1, 12) + term.setCursorPos(1, 15) term.setTextColor(colors.green) term.write("Configuration saved.") - term.setCursorPos(1, 14) + term.setCursorPos(1, 16) term.setTextColor(colors.lightGray) term.write("Press any key to return...") os.pullEvent("key") @@ -393,10 +397,10 @@ function Utils.promptConfig() State.inConfig = false break else - term.setCursorPos(1, 12) + term.setCursorPos(1, 15) term.setTextColor(colors.red) term.write("Failed to save configuration.") - term.setCursorPos(1, 14) + term.setCursorPos(1, 16) term.setTextColor(colors.lightGray) term.write("Press any key to retry...") os.pullEvent("key") @@ -2764,8 +2768,13 @@ function Main.loop() end local isAtStation = false + local trainPlatform = tostring(platform or State.stationPlatform or "1") + local currentPlatform = tostring(State.stationPlatform or "1") + if State.currentTrain then - if State.currentTrain.id == trainName then + if trainPlatform == currentPlatform then + isAtStation = true + elseif State.currentTrain.id == trainName then if trainName == "???" or trainName == "Unknown" or trainName == "" then if Utils.isFuzzyMatch(State.currentTrain.dest, destination) then isAtStation = true @@ -2913,8 +2922,13 @@ function Main.loop() end local isAtStation = false + local trainPlatform = tostring(platform or State.stationPlatform or "1") + local currentPlatform = tostring(State.stationPlatform or "1") + if State.currentTrain then - if State.currentTrain.id == tName then + if trainPlatform == currentPlatform then + isAtStation = true + elseif State.currentTrain.id == tName then if tName == "???" or tName == "Unknown" or tName == "" then if Utils.isFuzzyMatch(State.currentTrain.dest, dest) then isAtStation = true