HKL LCD PIDS (English)
一个 JCM(Joban Client Mod)脚本化 PIDS 预设,复刻了 LPS 服务器「花越线」站台上看到的 LCD PIDS 屏幕。
中文: 用 JCM Scripted PIDS 复刻 LPS 服务器「花越线」的 LCD 显示屏;原作版式 Forest_E233,复刻 / 代码 ChihayaAnonQWQ,MIT。完整中文文档见Github。
原始版式:Forest_E233 · 复刻 / 代码:ChihayaAnonQWQ · 许可协议:MIT。
这是 LCD 风格的显示界面——浅色背景、蓝色时钟标签页、大号目的地、垂直排列的车站名称以及路线带——而非 翻牌显示器。
功能
| 视图 |
触发条件 |
内容 |
| 四行列表 · 站台 |
循环 0–2s / 4–6s |
4 列列车:服务徽章、目的地、站台圆圈、分钟数 |
| 四行列表 · 编组 |
循环 2–4s / 6–8s |
4 列列车:服务徽章、目的地、车厢数量框(4 卡 / 4 car)、分钟数 |
| 到站广播 |
循环 8–14s (CN) / 14–20s (EN) |
大号文字“本班列車將停靠在 4 號月台 / This train will arrive at Platform 4”;标题行每 2 秒在站台/编组之间切换 |
| 路线图 |
当列车到达时(Departing Now) |
时钟、服务徽章、目的地、站台 + ETA、本站之后的垂直车站名称、路线带和车站圆点 |
| 进站警告 |
下次到达 ≤ 60 s |
黄色面板、警告三角形、两条警告线、底部信息栏 |
| 车门关闭 |
发车 ≤ 10 s |
“請勿靠近車門 / Please stand back from the train doors” + 信息栏 |
| 空载 |
无到达 |
“沒有列車服務 / No Train Service” |
- 实时本地时间 + UTC 偏移量;天气图标使用 JCM 内置纹理(晴天 / 雨天 / 雷暴),通过
MinecraftClient.worldIsRaining()/worldIsThundering() 获取。
- CJK 车站名称垂直堆叠;拉丁字母名称从下到上旋转 90°。
- 适配任何 PIDS 尺寸(推荐 133×72 LCD PIDS 和 136×76 RV PIDS)。
- 基于内容签名重绘:无变化时不调用
upload()。
要求
Minecraft 1.19.4–1.21,MTR 4.x,JCM 2.2+(支持脚本化 PIDS)。
将 zip 文件安装到 resourcepacks/ 目录中,启用它,放置一个 PIDS 方块并在 PIDS 预设菜单中选择 HKR LCD PIDS。
服务名称(MTR 侧)
脚本首先读取 路线编号(回退到路线名称)。
格式为 中文|English:
各停|Local 快速|Rapid 特急|Spec.press 準急|Semi Exp.
特快|Special Rapid 通快|Com.Rapid 急行|Ex.press
你也可以在路线名称中的 || 后添加服务名称:
花越线|Hana-Koshi Line||快速|Rapid。
内置颜色:特急 D32F2F,準急 27AE60,特快 453EA5,通快 0E9E9E,
急行 E67E22,快速 215DB3,各停 3C3C3C。未知服务回退到 MTR 路线颜色。
路线图上无旅行时间
脚本 API 未暴露区间运行时间:ArrivalResponse 仅携带本站的到达/出发时间,SimplifiedRoute 仅包含车站顺序,且客户端上的 Platform.routes 为空,因此无法访问 MTR 的内部路段持续时间。因此路线图不再绘制时间气泡:它显示路线带(MTR 路线颜色)、车站圆点和垂直车站名称,加上标题的服务/目的地/站台/ETA。
HOME 参数(本站台 vs 乘车通知)
在 8–20 秒阶段,显示界面完全根据 HOME(“主站台”)选择显示 路线图 或 乘车通知:
| 首班列车的站台 |
显示内容 |
| 与 HOME 站台相同 |
路线图(下一站 → 终点站) |
| PIDS 目标列表中的另一个站台 |
乘车通知(“This train will arrive at Platform X”) |
| 终止运营 / 不在服务中 |
非服务通知(优先级最高) |
HOME=n 是 pids.getTargetPlatformIds() 的 从 1 开始的索引,而非屏幕上显示的站台编号(例如 6)。列表顺序是该 PIDS 配置的(或自动检测到的)站台 ID 的顺序。
在 PIDS GUI 的 Custom Message 字段中的任意一行设置:
| 值 |
含义 |
HOME=1 |
列表中的第一个站台是“本站台” |
HOME=2 |
第二个站台 |
HOME=0 |
使用脚本默认值 |
HOME=-1 |
无主站台:每列列车都显示乘车通知(用于测试) |
| (无) |
脚本常量 HOME_PLATFORM_INDEX(从 0 开始,默认为 0) |
脚本常量是从 0 开始 的;游戏内的 HOME=n 是从 1 开始 的。
为什么乘车通知可能永远不会出现:单站台 PIDS 仅接收该站台的到达信息,因此每次到达都匹配 HOME 并始终显示路线图。向 PIDS 目标列表中添加另一个站台,或使用 HOME=-1 预览通知。
HOME=2 并不意味着“仅显示站台 2 的通知”;它将目标列表中的第二项标记为主站台,并且通知始终显示列车实际使用的站台。
配置
所有可调参数位于 assets/jsblock/scripts/hklcd.js 顶部:
SS、ARRIVING_WARN_MS、DOOR_CLOSING_MS、VIEW_PERIOD_MS、LANG_FORCE、C_*
调色板、SERVICE_OVERRIDE(以及遗留的 TRAVEL_PROFILES 表)和 HOME_PLATFORM_INDEX(从 0 开始的脚本默认值;在游戏中使用 HOME=n 覆盖,从 1 开始)。参见上方的 HOME 参数。
验证(仅限开发)
harness/ 使用 Rhino 1.9.1 和真实的 Java AWT 离屏渲染运行真实脚本,
以及一个 JCM API 模拟。30 多个场景涵盖所有视图、日夜交替、缺失数据、长名称以及从 40×20 到 272×152 的各种尺寸。validate.py 执行静态检查,渲染每个场景并采样生成的像素。
许可协议
MIT(参见 LICENSE)。第三方说明见 NOTICE.md。
参考截图仅用于复现版式和调色板;不包含原始资源包中的任何资产。MTR、JCM 及其捆绑字体归其 respective 作者所有。
HKL LCD PIDS (English)
A JCM (Joban Client Mod) Scripted PIDS Preset that recreates the LCD PIDS screens
seen on the Hana-Koshi Line platforms of the LPS server.
中文: 用 JCM Scripted PIDS 复刻 LPS 服务器「花越线」的 LCD 显示屏;原作版式 Forest_E233,复刻 / 代码 ChihayaAnonQWQ,MIT。完整中文文档见Github。
Original layout: Forest_E233 · Recreation / code: ChihayaAnonQWQ · License: MIT.
This is the LCD-style display — light background, blue clock tab, large destination,
vertical station names and the route band — not the split-flap display.
Features
| View |
Trigger |
Content |
| Four-row list · platform |
cycle 0–2s / 4–6s |
4 trains: service badge, destination, platform circle, minutes |
| Four-row list · formation |
cycle 2–4s / 6–8s |
4 trains: service badge, destination, car-count box (4 car / 4 卡), minutes |
| Arrival announcement |
cycle 8–14s (CN) / 14–20s (EN) |
Large “本班列車將停靠在 4 號月台 / This train will arrive at Platform 4”; the header row alternates platform/formation every 2 s |
| Route map |
when the train has arrived (Departing Now) |
clock, service badge, destination, platform + ETA, vertical names of the stops after this station, route band and station dots |
| Arriving warning |
next arrival ≤ 60 s |
yellow panel, warning triangle, two warning lines, bottom info bar |
| Door closing |
departure ≤ 10 s |
“請勿靠近車門 / Please stand back from the train doors” + info bar |
| Empty |
no arrivals |
“沒有列車服務 / No Train Service” |
- Real local time + UTC offset; weather icon uses JCM's built-in textures (sunny / rainy / thunder) via
MinecraftClient.worldIsRaining()/worldIsThundering().
- CJK station names are stacked upright; Latin names are rotated 90° bottom-to-top.
- Scales to any PIDS size (133×72 LCD PIDS and 136×76 RV PIDS recommended).
- Content-signature based redraw: no
upload() while nothing changes.
Requirements
Minecraft 1.19.4–1.21, MTR 4.x, JCM 2.2+ (scripted PIDS support).
Install the zip into resourcepacks/, enable it, place a PIDS block and pick
HKR LCD PIDS in the PIDS preset menu.
Service names (MTR side)
The script reads the route number first (falling back to the route name).
Write it as 中文|English:
各停|Local 快速|Rapid 特急|Spec.press 準急|Semi Exp.
特快|Special Rapid 通快|Com.Rapid 急行|Ex.press
You can also put the service after || in the route name:
花越线|Hana-Koshi Line||快速|Rapid.
Built-in colours: 特急 D32F2F, 準急 27AE60, 特快 453EA5, 通快 0E9E9E,
急行 E67E22, 快速 215DB3, 各停 3C3C3C. Unknown services fall back to the MTR route colour.
No travel times on the route map
The scripting API exposes no inter-station running times: ArrivalResponse only carries this
station's arrival/departure, SimplifiedRoute only station order, and Platform.routes is empty
on the client, so MTR's internal segment durations are unreachable. The route map therefore no
longer draws the time bubbles: it shows the route band (MTR route colour), station dots and the
vertical station names, plus the header's service/destination/platform/ETA.
The HOME parameter (this platform vs. boarding notice)
During the 8–20 s phase the display picks either the route map or the boarding notice
based entirely on HOME (the "home platform"):
| Platform of the first train |
Shown |
| Same as the HOME platform |
Route map (next station → terminus) |
| Another platform in the PIDS target list |
Boarding notice ("This train will arrive at Platform X") |
| Terminating / not in service |
Not-in-service notice (takes priority) |
HOME=n is a 1-based index into pids.getTargetPlatformIds(), not the platform number
shown on the screen (e.g. 6). The list order is the order of the platform IDs configured
(or auto-detected) for that PIDS.
Set it in the PIDS GUI's Custom Message field, on any row:
| Value |
Meaning |
HOME=1 |
the first platform in the list is "this platform" |
HOME=2 |
the second platform |
HOME=0 |
use the script default |
HOME=-1 |
no home platform: every train shows the boarding notice (for testing) |
| (none) |
script constant HOME_PLATFORM_INDEX (0-based, default 0) |
The script constant is 0-based; the in-game HOME=n is 1-based.
Why the boarding notice may never appear: a single-platform PIDS only receives arrivals for
that platform, so every arrival matches HOME and always shows the route map. Add another
platform to the PIDS target list, or use HOME=-1 to preview the notice.
HOME=2 does not mean "only show notices for platform 2"; it marks the second entry of the
target list as home, and the notice always shows the platform the train will actually use.
Configuration
All tunables live at the top of assets/jsblock/scripts/hklcd.js:
SS, ARRIVING_WARN_MS, DOOR_CLOSING_MS, VIEW_PERIOD_MS, LANG_FORCE, the C_*
palette, SERVICE_OVERRIDE (and the legacy TRAVEL_PROFILES table), and HOME_PLATFORM_INDEX
(0-based script default; override it in-game with HOME=n, 1-based). See The HOME parameter above.
Verification (dev only)
harness/ runs the real script in Rhino 1.9.1 with real Java AWT offscreen rendering,
plus a JCM API mock. 30+ scenarios cover all views, night/day, missing data, long names and
sizes from 40×20 to 272×152. validate.py performs static checks, renders every scenario
and samples the resulting pixels.
License
MIT (see LICENSE). Third-party notes in NOTICE.md.
Reference screenshots were used only to reproduce the layout and palette; no assets from
the original resource pack are included. MTR, JCM and their bundled fonts belong to their
respective authors.
评论 0
登录后参与评分
还没有评论,来抢沙发吧