From 3e3e995d55177e1bdbb4e5ead796ad70b58ef350 Mon Sep 17 00:00:00 2001 From: Soar Qin Date: Sun, 20 Sep 2026 03:44:27 +0800 Subject: [PATCH] feat(livestreamassist): add Chinese live dashboard with game icons - Add a URL-driven Chinese overlay page rendering item rate tables, tech levels, current research, and Dyson sphere power for streams. - Add the offline GameIcons layer and generate_icons.py, which extracts every item and tech icon from a local DSP install into js/generated/dsp-icons.js. - Reuse the proto extraction in generate_text.py and cover the new page with test_dashboard.js. --- AGENTS.md | 2 +- LiveStreamAssist/README.md | 3 +- LiveStreamAssist/examples/live-dashboard.html | 327 ++++++++++++++++++ LiveStreamAssist/js/README.md | 34 +- LiveStreamAssist/js/generated/dsp-icons.js | 2 + LiveStreamAssist/js/livestream-assist.js | 21 ++ LiveStreamAssist/js/scripts/generate_icons.py | 133 +++++++ LiveStreamAssist/js/scripts/generate_text.py | 30 +- LiveStreamAssist/js/scripts/pack_js.py | 1 + LiveStreamAssist/js/scripts/test_dashboard.js | 226 ++++++++++++ LiveStreamAssist/js/scripts/test_text.js | 2 +- LiveStreamAssist/js/src/icons.js | 21 ++ 12 files changed, 787 insertions(+), 15 deletions(-) create mode 100644 LiveStreamAssist/examples/live-dashboard.html create mode 100644 LiveStreamAssist/js/generated/dsp-icons.js create mode 100644 LiveStreamAssist/js/scripts/generate_icons.py create mode 100644 LiveStreamAssist/js/scripts/test_dashboard.js create mode 100644 LiveStreamAssist/js/src/icons.js diff --git a/AGENTS.md b/AGENTS.md index 7e65ca7..a0c26b6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -13,7 +13,7 @@ - Projects target `net472` or `netstandard2.1` with SDK-style `.csproj` files. Compile-time game references live in `AssemblyFromGame/`. - `DustbinPreloader` and `LabOptPreloader` are Mono.Cecil preloaders; their main mods consume the injected fields without reflection. - LiveStreamAssist: [WebSocket architecture, transport migration, and validation](LiveStreamAssist/docs/WebSocketDesign.md). Overlay JS client: [LiveStreamAssist/js/README.md](LiveStreamAssist/js/README.md). -- LiveStreamAssist JS clients keep `Client` as the JSON-RPC transport, `GameQuery` as the overlay data layer, and `GameText` offline from generated locale/proto dictionaries. Do not have `GameText` call the WebSocket API. Edit `js/src/` and rebuild the bundle with `python LiveStreamAssist/js/scripts/pack_js.py`; refresh `js/generated/dsp-text.js` with `python LiveStreamAssist/js/scripts/generate_text.py` from a local DSP install. Run the JS and Python checks documented in `LiveStreamAssist/js/README.md`. +- LiveStreamAssist JS clients keep `Client` as the JSON-RPC transport, `GameQuery` as the overlay data layer, and `GameText`/`GameIcons` offline from generated locale/proto dictionaries and extracted game icons. Do not have the offline layers call the WebSocket API. Edit `js/src/` and rebuild the bundle with `python LiveStreamAssist/js/scripts/pack_js.py`; refresh `js/generated/dsp-text.js` and `js/generated/dsp-icons.js` with `python LiveStreamAssist/js/scripts/generate_text.py` and `generate_icons.py` from a local DSP install. Run the JS and Python checks documented in `LiveStreamAssist/js/README.md`. ## Build diff --git a/LiveStreamAssist/README.md b/LiveStreamAssist/README.md index 5b31487..ac1c090 100644 --- a/LiveStreamAssist/README.md +++ b/LiveStreamAssist/README.md @@ -30,8 +30,9 @@ Open the overlay examples in a browser or OBS Browser Source. Default URL is `ws - [examples/research-overlay.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/research-overlay.html) shows the current research name, level, and hash progress. - [examples/stats-overlay.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/stats-overlay.html) also shows item production/consumption per minute and Dyson sphere generation. +- [examples/live-dashboard.html](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/examples/live-dashboard.html) is a Chinese live-stream panel driven by URL parameters: selected item rates in a game-style table, tech levels, current research, and Dyson sphere generation. -The overlays use the [JS client](js/README.md): `Client` for JSON-RPC, `GameQuery` for those reads, and `GameText` for localized names and DSP KMG formatting. Keep the `examples/` and `js/` directories side by side when copying an overlay. `GameText` does not call the WebSocket API; regenerate `js/generated/dsp-text.js` from the repository root with `python LiveStreamAssist/js/scripts/generate_text.py`. +The overlays use the [JS client](js/README.md): `Client` for JSON-RPC, `GameQuery` for those reads, and `GameText`/`GameIcons` for offline localized names, DSP KMG formatting, and extracted game icons. Keep the `examples/` and `js/` directories side by side when copying an overlay. The offline data never calls the WebSocket API; regenerate `js/generated/dsp-text.js` and `js/generated/dsp-icons.js` from the repository root with `python LiveStreamAssist/js/scripts/generate_text.py` and `python LiveStreamAssist/js/scripts/generate_icons.py`. - [WebSocket API reference](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/docs/WebSocketApi.md) - [WebSocket design and transport migration plan](https://github.com/soarqin/DSP_Mods/blob/master/LiveStreamAssist/docs/WebSocketDesign.md) diff --git a/LiveStreamAssist/examples/live-dashboard.html b/LiveStreamAssist/examples/live-dashboard.html new file mode 100644 index 0000000..a288892 --- /dev/null +++ b/LiveStreamAssist/examples/live-dashboard.html @@ -0,0 +1,327 @@ + + + + + 直播数据面板 + + + +
+
连接中…
+ + + + + + diff --git a/LiveStreamAssist/js/README.md b/LiveStreamAssist/js/README.md index 51d30c7..63fdd4c 100644 --- a/LiveStreamAssist/js/README.md +++ b/LiveStreamAssist/js/README.md @@ -2,22 +2,25 @@ Browser helper for the [WebSocket API](../docs/WebSocketApi.md). It is intended for OBS Browser Sources and local overlay pages with BigInt and `Promise.allSettled` support. There is no npm build; load the packed script as a classic `