40250 classic: increment 50 (Phase 1 W3) — §8.3 in-game help window
Implement the in-game Help window as a 1:1 migration of uihelp.py's HelpWindow (single-page: ENABLE_HELP_MULTIPAGE = 0 -> LoadDialogSinglePage). - project/ui/help_ui.gd (new): loads the real helpwindow.py uiscript via UiScript -> UiBuild; _relabel() resolves the <HELP_*>/<CLOSE> placeholders (produced when UiManager has no locale callback) from the project Locale table (en) with verbatim English fallbacks, covering the original script's two duplicate help_02 rows (right/middle camera). open/close/toggle/is_open; close_button -> close; ESC handled by the UiManager window stack. - project/ui/system_menu_ui.gd: help_button changed from the placeholder toast to close() + open_help(); adds const HelpUI, an injectable help_ui member, _ensure_help() (lazy build, reuses the menu's ui/client/assets_root), open_help(), toggle_help(); setup() gains an optional 6th arg (old 5-arg callers unaffected). - project/game_scene.gd: single elif in _unhandled_input — KEY_H without ctrl/meta -> system_menu_ui.toggle_help() (Ctrl+H stays free for /user_horse_ride). - project/help_ui_test.gd (new): headless SceneTree test — helpwindow.py load, 19 verbatim help rows + taskbar labels bound and non-placeholder, close_button text, rows() helper, close/open/toggle, ESC stack top, SystemMenuUI.open_help() lazy build. Tests: help_ui_test, system_menu_ui_test, gamescene_test, ui_test all PASS (plus system_option_ui_test, char_status_ui_test). No build/ in this worktree so C++ ctest not run (no C++ change). Real-server and visual (.sub textures) not verified. Docs: CLIENT-GAP.md W3 row + increment 50 bullet; CLIENT-GAP-FIX.md §8.3 status/改动/测试/验收 + C.5 batch record. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014yvAPqPivoY7vmBbzgqK4W
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
f32064c74a
commit
d7711ba5f0
+74
-9
@@ -2393,18 +2393,53 @@ BOOL bMainFlareEnable; std::string strMainFlareTextureFileName; float fMainFla
|
||||
|
||||
### 8.3 帮助窗口未实现
|
||||
|
||||
**参考**:`POC/assets/root/uihelp.py`(136 行)+ uiscript `helpwindow.py`。
|
||||
入口:`game.py:459 __PressHKey()` —— 非 Ctrl 时 `self.interface.OpenHelpWindow()`
|
||||
**状态**:🟡 开发中(首版落地,真服 / 视觉未验收)—— 批次 2026-09-02 / W3。
|
||||
|
||||
**参考**:`assets/root/uihelp.py`(`HelpWindow`,单页版 `ENABLE_HELP_MULTIPAGE = 0` →
|
||||
`LoadDialogSinglePage()` 装 `UIScript/HelpWindow.py`)+ uiscript
|
||||
`assets/uiscript/uiscript/helpwindow.py`(19 条 `help_XX` 浮动文本 + `taskbar_help_*`
|
||||
贴纸标签 + `close_button`,文本取自 `uiScriptLocale.HELP_*`)。
|
||||
入口:`game.py __PressHKey()` —— 非 Ctrl 时 `self.interface.OpenHelpWindow()`
|
||||
(Ctrl+H 是 `/user_horse_ride`)。
|
||||
|
||||
**当前**:`POC/project/ui/system_menu_ui.gd:91` 只显示占位提示。
|
||||
> 注:本仓 `uihelp.py` 并非“136 行含键位/说明行”的版本;帮助行文本实际在
|
||||
> `helpwindow.py` uiscript 里以 `uiScriptLocale.HELP_*` 引用,逐字值在
|
||||
> `locale/locale/<lang>/locale_interface.txt`。故“逐字对齐 `uihelp.py`”按“逐字对齐
|
||||
> `helpwindow.py` + `uiScriptLocale.HELP_*`(英文表)”落实。
|
||||
|
||||
**修改**
|
||||
**当前**:`system_menu_ui.gd` 的 `help_button` 已由占位提示改为打开 `help_ui.gd`。
|
||||
|
||||
1. 新建 `POC/project/ui/help_ui.gd`,按样板装 `helpwindow.py` uiscript,
|
||||
内容绑定逐字对齐 `uihelp.py`。
|
||||
2. 挂 `H` 键(非 Ctrl)与 ESC 菜单的 `help_button`,替换 `system_menu_ui.gd:91` 的占位。
|
||||
3. 配 `help_ui_test.gd`。
|
||||
**改动**
|
||||
|
||||
- 新增 `project/ui/help_ui.gd`:`ui.open_script("helpwindow.py")`(UiScript → UiBuild)
|
||||
非模态开窗;`_relabel()` 把 `helpwindow.py` 解析出的 `<HELP_*>` / `<CLOSE>` 占位
|
||||
(`UiManager` 未接 locale 回调时产生)用本工程 `Locale`(`en`)表 + 逐字英文兜底补回,
|
||||
覆盖原脚本重名的两个 `help_02`(右键 / 中键相机说明);`open/close/toggle/is_open`、
|
||||
`close_button` → `close`、ESC 由 `UiManager` 窗口栈统一关顶层。
|
||||
- `project/ui/system_menu_ui.gd`:`help_button` → `close()` + `open_help()`;新增
|
||||
`const HelpUI`、可注入的 `help_ui` 成员、`_ensure_help()`(懒建,复用菜单的
|
||||
`ui/client/assets_root`)、`open_help()`、`toggle_help()`;`setup()` 追加可选第 6 参
|
||||
`help_win`(旧 5 参调用不受影响)。
|
||||
- `project/game_scene.gd`:`_unhandled_input` 加**单条** `elif` —— `KEY_H` 且
|
||||
`not ctrl_pressed and not meta_pressed` → `system_menu_ui.toggle_help()`;`Ctrl+H`
|
||||
未占用,仍留给 `/user_horse_ride`。
|
||||
- 接口 / 数据结构变化:仅 `SystemMenuUI.setup()` 追加可选尾参;无网络 / EntityStore 改动。
|
||||
|
||||
**测试**
|
||||
|
||||
- 新增 `project/help_ui_test.gd`(headless SceneTree):helpwindow.py 装载、19 条帮助行
|
||||
逐字绑定且非 `<KEY>` 占位、任务栏标签、`close_button` 文本 = `Close`、`rows()` 便捷器、
|
||||
`close_button` 关窗、`open/toggle`、ESC 栈顶、`SystemMenuUI.open_help()` 懒建并打开。
|
||||
- `godot --headless --path project --script res://help_ui_test.gd` → `PASS`(exit 0)。
|
||||
- 回归:`system_menu_ui_test`、`gamescene_test`、`ui_test` 全 `PASS`;附加
|
||||
`system_option_ui_test`、`char_status_ui_test` 亦 `PASS`。
|
||||
- skip:本 worktree 无 `build/`,未跑 C++ `ctest`(本条无 C++ 改动)。
|
||||
|
||||
**验收**
|
||||
|
||||
- 真服 / 双账号 / Mac App:未验证(§8.3 为纯本地 UI,无服务端依赖)。
|
||||
- 视觉:`helpwindow.py` 的 `.sub` / `help_stick.tga` 贴图未逐像素比对;字体描边
|
||||
(`"outline": 1`)按 `ui.py` 默认,未单独标定。
|
||||
|
||||
---
|
||||
|
||||
@@ -2924,7 +2959,7 @@ var _pw := "123456789"
|
||||
| W0 公共基础 / 集成 | 🟡 开发中 | DirectEnter、Classic Warp endpoint、`world_reset`、场景重建首版;增量 49 接口冻结批次(`Entity` 字段 + `mut_spawn_full/mut_ownership/mut_map_bgm/drain_dirty` + `bgm_changed` 信号 + `bgm_director.gd` + §8.6 键位入口)已提交,C++ `ctest` 16/16 + 9 项 GDScript 回归通过 | 接收 Phase 1 W1/W2/W3/W4 批次并执行 G1 |
|
||||
| W1 协议 / 账号会话 | 🟡 开发中 | 角色槽地址透传、发送结果、unknown / unhandled 错误链路、断线回 LOGIN;`m_pending_actor` 暂存表成员就位 | §1.5 真实版本包、§1.10 定长文本编码、§2.2 两包合并逻辑 |
|
||||
| W2 实体 / 世界 / 战斗 | 🟡 开发中 | 地图实体 / 掉落清理、地图重建首版、实体测试和场景测试;`drain_dirty` / `mut_spawn_full` 骨架可用 | §2.1 两层模型 + 可见性、§2.3 `mut_spawn→mut_spawn_full`、§2.4 点数数组尾部、§2.5 应用顺序 + affect_flags |
|
||||
| W3 玩法 UI / 输入 | 🟡 已有首版 | 多数窗口、背包 / 任务 / 社交、键位和输入已有回归;§8.6 数字键 / F1–F4 / Ctrl+数字入口已收敛 | §8.3 帮助窗;§8.6 剩余逐行键位、LSHIFT 翻页、表情包 |
|
||||
| W3 玩法 UI / 输入 | 🟡 已有首版 | 多数窗口、背包 / 任务 / 社交、键位和输入已有回归;§8.6 数字键 / F1–F4 / Ctrl+数字入口已收敛;§8.3 帮助窗(`help_ui.gd` = `helpwindow.py` + `uiScriptLocale.HELP_*` 逐字,`H` / ESC 菜单 `help_button` 入口,`help_ui_test` 绿)已落地 | §8.6 剩余逐行键位、LSHIFT 翻页、表情包;帮助窗视觉 / `.sub` 贴图与真服未验收 |
|
||||
| W4 渲染 / 资产 / 音频 | 🟡 已有首版 | GR2 / `.msa` / `.mse`、地图 / 水体 / 天气 / BGM 部分链路已有;`bgm_director.gd` 消费点就位 | §9.1 地图 BGM 曲目解析 + 音量、§9.2 后台恢复曲目、§9.3 生命周期单一属主 |
|
||||
| W5 打包 / 发布 / 验收 | ⬜ 未开始 | 已有 Godot 导出配置和构建入口 | 自包含资源包、Intel / Apple Silicon、签名和 Mac App 验收 |
|
||||
|
||||
@@ -2971,3 +3006,33 @@ var _pw := "123456789"
|
||||
下一批次:Phase 1 —— W1(§1.5/§1.10/§2.2)、W2(§2.1/§2.3/§2.4/§2.5)、W3(§8.3)、
|
||||
W4(§9.1/§9.2/§9.3) 在各自 worktree 并行;Phase 2 由 W0 执行 G1 集成与文档合并
|
||||
```
|
||||
|
||||
```text
|
||||
批次:2026-09-02 / W3 / §8.3(帮助窗)
|
||||
状态:🟡 开发中(首版落地;真服 / 视觉未验收)
|
||||
参考:assets/root/uihelp.py(HelpWindow.LoadDialogSinglePage);
|
||||
assets/uiscript/uiscript/helpwindow.py(help_01..help_19 + taskbar_help_* + close_button);
|
||||
assets/locale/locale/en/locale_interface.txt(HELP_* / CLOSE 逐字);
|
||||
game.py __PressHKey(H 非 Ctrl → interface.OpenHelpWindow(),Ctrl+H = /user_horse_ride)
|
||||
改动:
|
||||
project/ui/help_ui.gd(新)—— ui.open_script("helpwindow.py") 非模态;_relabel() 用
|
||||
Locale(en) + 英文兜底把 <HELP_*>/<CLOSE> 占位补回(含重名的两个 help_02);
|
||||
open/close/toggle/is_open、close_button→close、ESC 走 UiManager 窗口栈、rows() 便捷器
|
||||
project/ui/system_menu_ui.gd —— help_button 由占位提示改为 close()+open_help();
|
||||
+const HelpUI、+help_ui 成员、+_ensure_help()/open_help()/toggle_help();
|
||||
setup() 追加可选第 6 参 help_win(旧 5 参调用不受影响)
|
||||
project/game_scene.gd —— _unhandled_input 加单条 elif:KEY_H 且非 ctrl/meta →
|
||||
system_menu_ui.toggle_help()(Ctrl+H 未占用)
|
||||
接口变化:仅 SystemMenuUI.setup() 追加可选尾参;无 net / EntityStore 改动
|
||||
测试:godot --headless --path project --script res://help_ui_test.gd → PASS(exit 0);
|
||||
system_menu_ui_test / gamescene_test / ui_test 全 PASS;附加 system_option_ui_test /
|
||||
char_status_ui_test 亦 PASS
|
||||
skip:本 worktree 无 build/,未跑 C++ ctest(本批次无 C++ 改动)
|
||||
验收:真服 / 双账号 / Mac App 未验证(§8.3 纯本地 UI,无服务端依赖);
|
||||
helpwindow.py 的 .sub / help_stick.tga 贴图与字体描边未逐像素比对
|
||||
风险与依赖:依赖 W0 冻结的 UiManager/UiScript/UiBuild 与 Locale;未改共享文件,
|
||||
game_scene.gd 仅加 1 条 elif(W3 许可范围)。1:1 偏差:本仓 uihelp.py 非“136 行含
|
||||
键位行”版本,逐字源实际为 helpwindow.py + uiScriptLocale.HELP_*(已在 §8.3 注明);
|
||||
帮助窗按非模态实现(原版 Lock()),ESC/关闭行为等价
|
||||
下一批次:Phase 2 由 W0 执行 G1 集成;§8.6 剩余逐行键位与表情包仍在 W3 范围
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user