feat(ticketmachine): 升级版本并优化站点与线路名称获取逻辑

更新package.json、gate.lua、ticketmachine.lua的版本号,新增en、enName字段的兼容以完善名称展示逻辑
This commit is contained in:
2026-07-10 10:36:18 +08:00
parent 761fd61deb
commit fa2457ce7f
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -1,6 +1,6 @@
local CURRENT_STATION_CODE = 'Ticket-Machine'
local API_BASE = 'http://ticket.fse-media.group/api'
local VERSION = 'v1.5.10'
local VERSION = 'v1.5.11'
-- ###########################
-- Core HTTP & JSON Utilities
@@ -1092,7 +1092,7 @@ local function stationDisplay(code)
if #code == 0 then return '' end
if code == 'SINGLE_SEGMENT' then return 'Any 1 Segment' end
local st = stationByCode[code]
if st then return tostring(st.en_name or st.name or code) .. ' ' .. code end
if st then return tostring(st.en_name or st.en or st.enName or st.name or code) .. ' ' .. code end
return code
end
@@ -1201,7 +1201,7 @@ local function buildSingleSegments()
end
for cost, _ in pairs(lineFares) do
table.insert(segments, {
lineName = line.name or line['线路名称'] or 'Unknown',
lineName = line.en_name or line.enName or line.en or line.name or line['线路名称'] or 'Unknown',
color = line.color or line['颜色'],
cost = cost
})
@@ -1275,7 +1275,7 @@ local function showSingleSegmentSelection()
end
local function showHome()
state.stationName = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.name)) or 'Station'
state.stationName = (CFG.current_station and (CFG.current_station.en_name or CFG.current_station.en or CFG.current_station.enName or CFG.current_station.name)) or 'Station'
state.stationCode = (CFG.current_station and CFG.current_station.code) or CURRENT_STATION_CODE
drawHeader('FSE Ticket Machine', 'Select Mode', true)
Buttons = {}