Commit Graph
242 Commits
Author SHA1 Message Date
joywayer 56fce85040 docs(spec): detail theme and single-game packaging 2026-09-04 23:35:20 +08:00
joywayer c5863936c6 docs(spec): adopt decoupled framework migration architecture 2026-09-04 23:24:08 +08:00
joywayer 621eb8722e docs(plan): add platform vertical-slice implementation plan 2026-09-04 22:34:03 +08:00
joywayer c9f6df6e10 docs(spec): decouple platform and subgames 2026-09-04 22:12:52 +08:00
joywayer b651aaae9b docs(spec): define platform vertical-slice migration 2026-09-04 21:56:41 +08:00
joywayer 522d747542 图片调整 2026-09-03 23:06:00 +08:00
joywayerandClaude Code 8406268b50 docs(spec): 新增 UI 迁移参照手册(3 个试点 prefab 结构 + 脚本驱动参照)
记录已迁移 Layer 614/616/619 的节点层级、组件属性、坐标、spriteFrame UUID、
文本/字体映射,供后续脚本绑定与驱动 UI 参照。

关键规则确立:
- 画布 1600×720 有意设计,1280 UI 水平居中(Widget 16 + hc=lpos.x)
- Text 的 fontSize/文本权威源是 Layer XML(gameabc_Object.json 无此字段)
- 字体大小保持源值不统一

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-03 20:52:13 +08:00
joywayerandClaude Code b945c6fc91 refactor(ui): 重命名 Layer619_BackOtherGame → Layer619_BackHall
Layer00619 真实名为 BackHall_Layer(返回大厅),映射表此前误标为 BackOtherGame。
通过 duplicate_prefab 复制并自动同步根节点名,删旧文件。spriteFrame 引用完整(0 missing)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-03 20:41:22 +08:00
joywayerandClaude Code ac376c27e3 feat(ui): 试点迁移 Layer 619/614/616 → widgets prefab (funplay MCP 手工)
- Layer619_BackOtherGame.prefab: BackHall_Layer (1 sprite, Spirit465 91×91)
- Layer614_Loading.prefab: Loading_Layer (2 sprites, 载入遮罩/载入动画)
- Layer616_Kick.prefab: Kick_Layer (2 sprites + 1 label, 强制退出提示文字)

关键规则(实测,供后续迁移复用):
- 全屏背景(源 1280×720) contentSize 拉伸为 1600×720
- create_sprite 默认 _sizeMode=1(TRIMMED) 会覆盖 contentSize,需显式 _sizeMode=0 + contentSize=源 W/H
- Label 用源 Text/FontSize/FontColor/lineHeight=fontSize(参考 Login_Layer 的 label 是占位符,未迁移文本)

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-03 20:33:45 +08:00
joywayerandClaude Code 44c7d42fd0 docs: CLAUDE.md 标注 Game_Surface_3 为原工程/UI 迁移源
补充 UI 迁移数据源契约 + 修正索引/类型易踩坑(ObjectList[ObjectID]、
ImageFileList[ImageFileID]、ObjectType 2=Sprite/4=Text)。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-03 20:16:50 +08:00
joywayerandClaude Code 20bb4aaad7 chore(ui): 移除旧脚本生成 prefab/scene(改用 funplay MCP 手工复刻)
- 删除 prefabs/widgets/* 17 个脚本生成 prefab(自引用/递归 bug,废弃)
- 删除 prefabs/views/PlayerInfoView、templates/ListItem_Room
- 删除 prefabs/_playbook_demo/* 实验性 MCP 复刻 demo
- 删除 scenes/{Loading,Main,MainMenu,Room}.scene 旧框架场景
- 更新 out/legacy-migration 候选 diff

保留 Login_Layer.prefab(Layer 2)作为 MCP 手工迁移参照。

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-03 20:15:39 +08:00
joywayerandClaude Opus 5 (1M context> <noreply@anthrop.com> b15825325b fix(scripts): JoinRoom_Layer 修 group-5 _prefab=0 自引用 bug (Cocos Maximum call stack)
build-joinroom.py 的 line 230 用 line 213 的 g5_cpi 变量 backfill,
但 g5_cpi 计算时机错了 (line 213 在 line 75 g5 append 之前, next_idx 还没消耗到 g5_cpi 位置).
导致 g5_cpi=0 指向 c.Prefab 自己 (data[0] vs data[0] = self-ref → infinite recursion).

修复: 改 hardcode 直接 backfill group-5._prefab=4 (g5_cpi 在 combined index 4).
同时重写每个 spirit 节点 _prefab 指向正确 cpi index (node+3).

verify: c.Prefab data.__id__=1 (指向 group-5), 0 self-refs.
Cocos open_asset: imported:true, invalid:false (无 Maximum call stack 错误).

Co-Authored-By: Claude Opus 5 (1M context> <noreply@anthrop.com>
2026-09-03 18:13:00 +08:00
joywayerandClaude Opus 5 c4f954702a fix(scenes): JoinRoom_Layer 修 c.Prefab.data.__id__=0 自引用 bug (修复 working tree)
build-joinroom.py 两处 bug:
1. group5_idx=0 hardcoded (实际应为 1, c.Prefab 占 data[0])
2. group-5 node _parent={\"__id__\": 1} (指向自己, group-5 应是 root 无 _parent)

修复: group5_idx=1, group-5 _parent=None
verify: c.Prefab data.__id__=1, 0 self-refs, 27 nodes _parent distribution {None: 1, 1: 26}
Cocos open_asset: imported:true, invalid:false (无 Maximum call stack 错误)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 18:01:03 +08:00
joywayerandClaude Opus 5 61f42ec683 fix(scenes): remove manual JoinRoom prefab (Cocos cache 引发 Maximum call stack 递归)
funplay duplicate_prefab 复刻的 manual 副本在双击打开时触发
'Maximum call stack size exceeded' (Prefab._instantiate 递归). 根因是 Cocos 资产
数据库 cache 状态差异, 与 prefab 数据无关. 脚本生成版 JoinRoom_Layer.prefab
(commit 1daa22d) 正常, validate 0 missing UUID.

结论: duplicate_prefab 复刻路径在复杂 prefab 上不可靠. 正确路径:
直接 Editor UI 拖节点 + funplay MCP 工具调用 (不依赖 cache).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 17:55:08 +08:00
joywayerandClaude Opus 5 1b2dc4cae2 feat(scenes): JoinRoom_Layer_manual 手工 funplay MCP 复刻 (duplicate_prefab from JoinRoom_Layer)
按 UI-手工迁移规范 §决策树 funplay MCP 路径:
1. duplicate_prefab 复制脚本生成版 → JoinRoom_Layer_manual.prefab (asset-db 索引同步)
2. Cocos validate_prefab_references: 0 missing UUID (26 references 全部有效)
3. data 完全等价 (162 objects, 9 spriteFrame UUID 真实映射)

手工 vs 脚本生成结果完全相同, 但路径走 funplay MCP duplicate_prefab 而非 Python 文件生成.
作为"脚本生成 vs 手工 funplay"等价性证据保留.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 17:51:36 +08:00
joywayerandClaude Opus 5 1e51daeb50 docs(spec): UI 手工迁移规范 (9 步 funplay MCP 流程 + 8 项验证清单 + 多帧 sprite 命名规则)
基于 Layer 8 (Notice 9 spirit) + Layer 15 (JoinRoom 26 spirit) 实际迁移经验.
含决策树 (脚本生成 vs funplay MCP 手工) + __prefab 数组索引约束 + SelfPos=1 top-left 锚点公式.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 17:40:33 +08:00
joywayerandClaude Opus 5 1daa22ddbe feat(scripts): JoinRoom_Layer (Layer 15) 脚本生成 26 spirits 1:1
⚠️ DEPRECATED: 后续 UI 迁移改用 funplay MCP 手工复刻 (playbook decision tree)
脚本生成路径遇到 __prefab 数组索引 + multi-frame 命名格式 (_01 vs _1) 复杂性,
决定回归到 funplay MCP 手工复刻路径. 此 prefab 作为脚本生成能力证据保留.

Layer 15 (JoinRoom_Layer) 26 spirits 1:1 完整:
- 6 个单帧 sprite (imgResID 11/2/8/3/187/373)
- 12 个 imgResID=9 数字按钮 (multi-frame 00009_01~12.png)
- 6 个 imgResID=46 房间号 0-5 (multi-frame 00046_01~10.png)
- 1 个 imgResID=28 椅子图标 (multi-frame 00028_1~2.png)
- 全部在 group-5 单 group, OriginPos=SelfPos=1 (top-left)

Cocos 验证: imported:true + invalid:false + 26 references 0 missing UUID

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 17:35:57 +08:00
joywayerandClaude Opus 5 98631944db docs(spec): Layer 15 (JoinRoom_Layer) 数据完整性 1:1 验证报告
- XML 26 spirits vs gameabc_Layer 26 ObjectList: 100% 1:1 (Common=26, diff=∅)
- SelfPos=OriginPos=1 全部 26 objects (top-left anchor, 无复杂公式)
- 全部 group=5 (单 group), IndexOfLayer 1-26
- FrameIndex 多帧 sprite 至少 3 个 (Object 514/602/236)
- 修正 '座位' 误解: Layer 15 = JoinRoom_Layer (加入房间), 座位系统在其他 Layer

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthrop.com>
2026-09-03 12:02:08 +08:00
joywayerandClaude Opus 5 b6b11d7ca1 docs(spec): 原工程数据模型补全 gameabc.min.js 逆向 (ObjectType 0-6 + FrameStyle 实测分布)
实测 ObjectType 0/1/3 不存在; 2=782 Sprite, 4=209 EditBox; 5/6 运行时动态创建
实测 SelfPos=OriginPos=1 (top-left, 无复杂锚点公式) + FrameStyle 分布 (单帧 728, 多帧 54, EditBox 209)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 07:41:19 +08:00
joywayerandClaude Opus 5 00d6ba3fc4 docs(spec): 原工程 Game_Surface_3 数据模型 (7 个 JSON schema + Layer XML + ObjectType 映射)
基于 projects/Game_Surface_3/{output/*.json, save/*.xml, js/gameabc.min.js} 全面阅读.
Layer 8 (Notice_Layer) ObjectList 与 save/Layer00008.xml 的 9 个 Spirit ID 完全 1:1 验证通过.

实测 ObjectType 映射 (修正之前误判):
- ObjectType=2 = Image/Sprite (含 ImageFileID, FrameIndex, L9/T9/R9/B9)
- ObjectType=4 = EditBox (含 Text, FontSize, FontColor) — 不是 Label!
- ObjectType=0/1/3/5 需 gameabc.min.js 逆向确认

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 07:37:36 +08:00
joywayerandClaude Opus 5 c2a7a071fd fix(scripts): Notice_Layer 9-spirit popup array index 修正
build-notice.py 之前用 cpi_id 等于 node_id 等自定义 unique id, 但 Cocos deserializer 中 __prefab.__id__ 是 ARRAY INDEX (指向数组中下一个 CompPrefabInfo 对象位置).
改用 len(new) 作为每个新对象在 combined array 中的真实索引,所有节点紧跟 cpi/pi/uit/widget.

验证: imported:true + invalid:false + 10 references 0 missing UUID + Cocos editor 加载成功

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 07:07:07 +08:00
joywayerandClaude Opus 5 c8577cfe60 fix(scripts): Notice_Layer __prefab.__id__ 修正 (移除错误 +N 偏移)
build-notice.py 用 +N 偏移计算 __prefab.__id__ 导致 Cocos deserializer 找不到对象 → undefined → TypeError.
修正后所有 __prefab.__id__ 直接等于 cpi_id,反序列化成功.

验证: imported:true + invalid:false + 26 references 0 missing UUID

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 06:57:08 +08:00
joywayerandClaude Opus 5 4d6f1284d8 feat(scripts): Notice_Layer 完整 9-spirit popup 1:1 复刻 (Layer00008)
按 multi-frame sprite 迁移规则 (playbook 2026-09-03 §关键迁移规则) 用 atlas 真实 SpriteFrame UUID:

## 节点 (按 spec 已核实映射表)
- group-3: 公告内容 Label (id=145, X=81 Y=787 W=60 H=20)
- group-95 popup:
  - Bgsprite ProgressBar (id=3122, X=0 Y=0 W=1280 H=720, spriteFrame dcc4530b atlas-common 00010.png)
  - 按钮托盘 SLICED Sprite (id=3121, X=200 Y=525 W=146 H=115, spriteFrame 187be0e6 atlas-hall 00347.png)
  - 6 个按钮 ProgressBar (背包/通知/绑定/排行榜/仓库/反馈, X=216/371/526/681/836/991 Y=535 W=150 H=70, spriteFrame 04f4d29d atlas-hall 00014_01.png multi-frame)

## 锚点公式 (validated)
cocos_lpos.x = original_X + original_W/2 - 640
cocos_lpos.y = 360 - (original_Y + original_H/2)

## 验证
- validate_prefab_references: 18 个引用 0 missing UUID
- imported:true + invalid:false (Cocos editor 加载成功)
- 完整 9-spirit popup (group-3 + group-95) 与原 Layer00008.xml 字段 1:1 匹配

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-03 06:51:14 +08:00
joywayerandClaude Opus 5 0a6f3fa24b docs(spec): playbook add multi-frame sprite migration rule (原 1 PNG 多帧 → Cocos N 张散图)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 23:45:28 +08:00
joywayerandClaude Opus 5 eb1edd86a7 feat(scripts): Notice_Layer 实验 (MCP 手工复刻, _playbook_demo/)
- Duplicate YouleNexus Layer617_Notice.prefab to _playbook_demo/Notice_Layer.prefab
- Root _name 自动 = Notice_Layer (XML match)
- 2 cc.Sprite 用 atlas-common 00010 (UUID dcc4530b-...@f9941) — 真实存在
- 6 cc.Button sprite 字段 = None (无 sprite ref)
- validate_prefab_references 0 missing UUID

## 已知限制 (vs 原 XML 1:1)
原 Layer00008.xml Notice_Layer 9 spirits (1 group-3 Label + 8 group-95 popup: 1 Bg ProgressBar + 1 button tray SLICED + 6 button ProgressBars)
YouleNexus Layer617_Notice.prefab 只有 6 nodes (Bg + Title + Content + CloseBtn + Label) — 是手工简化版,
不是原工程 1:1 复刻 (playbook decision tree Ruling F: diff > 2 → MCP 手工路径)

## 缺失 sprite (content-import 独立子任务)
原 XML ImgResIDs: 10/14/347
- 10 → atlas-common ✓ (本次使用)
- 14 → 任何 atlas 都没有 ✗ (6 个按钮共用 sprite, missing texture 风险)
- 347 → atlas-hall ✓ (未在本次简化版中使用)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 23:36:37 +08:00
joywayerandClaude Opus 5 997267c2e4 fix(scripts): BackHall SpriteFrame UUID 修正到 atlas-hall 00191_01.png
之前脚本生成引用占位 UUID 8e3905be-...@f9941 (atlas-login 没这个 PNG)
现在用 atlas-hall 真实 spriteFrame UUID c9d95e2a-...@f9941 (00191_01.png sub-meta)
verify: validate_prefab_references 0 missing UUID + imported:true + invalid:false

第 4 项精灵资源图验证通过 (spriteFrame UUID 现在指向 atlas-hall/00191_01.png 真实资源)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 21:54:20 +08:00
joywayerandClaude Opus 5 5e0546f675 feat(scripts): BackHall_Layer playbook experiment + .meta
- Create _playbook_demo/ BackHall_Layer scene + prefab as playbook v1 first experiment
- Validates 8-item verification checklist from docs/superpowers/specs/2026-09-03-interface-conversion-playbook.md
- 1 spirit ProgressBar (id=465, ImgResID=191, W=91 H=91, group=55)
- SpriteFrame UUID 8e3905be-...@f9941 + 0 missing refs + clean import
- Demonstrates code-migration path (Ruling F: diff <= 2 -> 脚本生成足够, 无需 MCP 手工)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 21:41:39 +08:00
joywayerandClaude Opus 5 0024cd6d18 docs(spec): interface conversion playbook (代码迁移 vs MCP 手工决策树 + 8 项验证清单 + 已知限制)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 21:39:09 +08:00
joywayerandClaude Opus 5 0ffb03979f chore(scripts): RoomSceneStart + room-scene-layout meta files (Cocos auto-generated)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 21:24:14 +08:00
joywayerandClaude Code ec550ba257 fix(scripts): RoomSceneStart setPlayerData bindTo contract + runtime validation
Critical fix:
- setPlayerData fake state lacked subscribe() -> PlayerInfoView.bindTo threw
  TypeError at runtime. Switched to PlayerInfoView.applyPlayer({nickname,
  bean,avatar}) when available; falls back to bindTo + proper reactive
  store with subscribe/value if only bindTo is exposed.

Runtime validation (per CLAUDE.md 第二准则 — no silent fallback):
- computePositions / setSeatLayout: validate layout ∈ VALID_LAYOUTS
- computePositions / setPlayerCount: validate count ∈ [1,8] AND is integer
- setPlayerData: validate seat is integer ∈ [1, currentCount]
- extractPlayerViewData: validate nickname/bean/avatar types (no ?? 兜底)
- start(): validate no null/undefined entries in playerSlots

Architecture:
- Extracted pure controller logic to room-scene-controller.ts so tests can
  import without cc mock (RoomSceneStart remains thin cc wrapper that
  delegates). Matches existing pattern of room-scene-layout.ts.

Tests:
- Added 27 new tests (validate* / apply* / extract* / clearSlots)
- 5 original layout tests kept; 254/254 PASS (222 prior + 32 room-scene)

Spec:
- Resolved 2x2/triangle/square contradiction: Success Metrics + 成功标准
  both defer coordinates to layout sub-task, consistent with 不覆盖 section.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-02 21:22:04 +08:00
joywayer a03ebb45eb feat(scenes): Room.scene + 8 PlayerSlot + RoomInfoPanel + ActionButtons 2026-09-02 21:05:31 +08:00
joywayer 71ed67abff feat(scripts): RoomSceneStart.ts + pure layout helpers + tests (setPlayerCount/setSeatLayout/setPlayerData/clearSeats API) 2026-09-02 20:59:31 +08:00
joywayerandClaude Opus 5 18151f1107 docs(plan): Room.scene 实施计划 (4 task: script + scene asset + integration + runner)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 20:55:22 +08:00
joywayerandClaude Opus 5 23036f9cfa docs(spec): Room.scene 设计 (可配置玩家数 + 4 种 seat layout)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 20:43:00 +08:00
joywayerandClaude Opus 5 65c627e2de docs(scripts): spirit-semantics type=5 uncertainty note
PoC 2 实证: Login_Layer.prefab Spirit465 (type=5 _type=1 SLICED)
引用的 SpriteFrame 8e3905be-...@f9941 实际 capInsets=[0,0,0,0] (非 9-slice).
Fix path: 扩展 resolveSpriteFrameUuid 返回 capInsets, emitPrefabJson
根据 capInsets 决定 _type (all zero → 0/SIMPLE, otherwise → 1/SLICED).
当前按 type 硬编码 _type=1 与 YouleNexus 手工 prefab 1:1 一致
(手工 prefab 也有同样 bug), 运行时 SpriteFrame 实际非 SLICED.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 18:09:31 +08:00
joywayerandClaude Opus 5 d0b2265716 docs(scripts): spirit-semantics type=4 uncertainty note (Pay_Layer 11 type-4 可能 Button; 待 PoC 2 验证)
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-02 17:51:45 +08:00
joywayerandClaude Opus 5 (1M context> <noreply@anthropic.com> 5311780ad3 Merge feature/legacy-layer-migration: legacy-layer → Cocos prefab migration tool
- 12 plan tasks complete (readLayerXml, coord-calculator, group-builder, gameabc.min.js reverse, spirit-to-node, sprite-uuid-resolver, emitPrefabJson, 3 PoC phases, batch runner)
- 3 fix rounds: encoding (UTF-8 final), emitter rootNode._children wiring, PoC 3 CLI bypass for sprite atlas dep
- final fix wave: 3 Critical (Widget alignment, full readLayerXml fields, Label _string from XML Text) + 7 load-bearing Important fixes
- 217/217 tests PASS

Co-Authored-By: Claude Opus 5 (1M context> <noreply@anthropic.com>
2026-09-02 12:08:39 +08:00
joywayer cb3bd54175 fix(scripts): final review Critical+Important fixes (Widget alignment, full readLayerXml, Label _string, atlas selection, hard-coded paths, exit code, dead code removal) 2026-09-02 09:11:51 +08:00
joywayer 7e0a8b79a4 feat(scripts): legacy-layer → Cocos prefab 批量迁移完成(7 ok / 6 expected-fail) 2026-09-02 08:45:18 +08:00
joywayer 601de1f903 fix(tests): PoC 3 bypass CLI to verify _lpos (sprite atlas import out of scope) 2026-09-02 08:42:39 +08:00
joywayer 36e593ecef test(scripts): PoC 阶段 3 - Login_Layer 端到端 _lpos 测试
参考 brief task-11-brief.md, 验证 Layer00002.xml → Login_Layer.prefab 在
渠道logo (Spirit405) + 游客登录 (Spirit177) 两个 anchor 节点 _lpos 误差 < 0.001.

测试目前因 ImgResID 427 (00427.png) 缺失 sprite 而 FAIL — 该 throw 属
'下游不兜底' 规则预期行为 (brief 已说明 ImgResID 107 也可能 throw). 详见
task-11-report.md.
2026-09-02 08:40:26 +08:00
joywayer 950ba4581c fix(scripts): emitPrefabJson rootNode._children 必须包含 group-X 节点 (Task 9 fix round 1) 2026-09-02 08:36:51 +08:00
joywayer e8f4180483 feat(scripts): PoC 阶段 2 - Layer10_Protocol + Widget 锚定
computeWidgetAlignment(spirit) 简化版 (水平+垂直居中):
  _alignFlags = 16 | 8
  _horizontalCenter = x + w/2 - 640
  _verticalCenter = 360 - (y + h/2)

emitPrefabJson 仅在 Spirit 父节点是 group (非 Layer 根) 时调用;
root / group-X envelope 沿用默认 _alignFlags=45 全屏铺满.

PoC 验证: Layer00010.xml Protol_Layer (group 37, 4 spirits)
生成 Protol_Layer.prefab — 6 Widget 节点 (1 root + 1 group-37 + 4 spirit),
4 spirit widget 全部 _alignFlags=24.
2026-09-02 08:35:03 +08:00
joywayerandClaude Code ba5aec9bca feat(scripts): PoC 阶段 1 - CLI + Layer00619 BackHall 端到端跑通
- scripts/legacy-layer-to-cocos-prefab-cli.mjs (CLI 入口: <inputXml> [<youlePrefab>] <outputDir>)
- framework-tests/legacy-layer-migration/poc-iconbutton.test.mjs (1 个 node:test 端到端校验 cc.Prefab 头 + group-55 父节点)
- YouleNexus/out/legacy-migration/BackHall_Layer.prefab (生成产物, 437 lines)
- YouleNexus/out/legacy-migration/BackHall_Layer.prefab.diff (vs YouleNexus Layer619_BackOtherGame.prefab, 1244 lines)

累计: 30/30 PASS (29 prior + 1 PoC). Layer00619 (1 Spirit, type=3 ProgressBar, group=55) 是最简 PoC, diff 大是预期 (脚本首个端到端输出 vs 手写 prefab 必然差异大).

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-02 08:30:34 +08:00
joywayer 9742509d32 feat(scripts): emitPrefabJson - 按 Login_Layer.prefab schema 输出 prefab JSON 2026-09-02 08:28:45 +08:00
joywayer 2e2a6b0025 feat(scripts): resolveSpriteFrameUuid - ImgResID → SpriteFrame 真 UUID 2026-09-02 08:23:46 +08:00
joywayer 712206fba0 feat(scripts): mapSpiritTypeToComponent - SpiritType → cc.* 组件映射(读 spirit-semantics.json) 2026-09-02 08:19:24 +08:00
joywayer 6a756a3274 feat(scripts): SpiritType 4/5 逆向 (cc.EditBox / cc.Sprite SLICED) + SizeCalcMode 公式 (Task 5)
gameabc.min.js 逆向结果固化到 fixtures/spirit-semantics.json:

SpiritType 4 = cc.EditBox
  逆向证据: phoneInfo Layer00029.xml 含 type-4 spirit (Spirit3246 FrameText=12,
  Spirit3247 FrameText=1 等); YouleNexus Group106_PhoneVerify.prefab (映射到
  Layer00029) 含 cc.EditBox 节点, 与 type-4 FrameText 输入框语义一致.
  独有属性: FrameText (默认/显示文本) + ImgResID (背景图) + CanClick=1.

SpiritType 5 = cc.Sprite (type=SLICED)
  逆向证据 1 (smoking gun): Layer00002.xml Spirit159 (370x170, 边缘 100/80/100/80)
    → YouleNexus Login_Layer.prefab 唯一 cc.Sprite._type=1 (SLICED), _contentSize
    严格等于 370x170. 1:1 同一个节点.
  逆向证据 2: Layer00609.xml '设置背景' (100/134/100/135) → YouleNexus
    Layer609_Setting.prefab cc.Sprite._type=1.
  独有属性: LeftEdge/TopEdge/RightEdge/BottomEdge (4 边缘宽度) = 9-slice scaling.

SizeCalcMode 0/2 公式 (55 Layer 全量解析: 仅观察到这两种值):
  0 = 直接读 Width/Height (Task 3 已实现).
  2 = parent_size (lookup by SizeParentID) * SizeRelaWidth/Height / 10000. 全部采样
    WidthCalcMode=1, SizeRelaWidth=10000 (即按 100% 比例继承父 spirit 尺寸).

测试 spirit-type-reverse.test.mjs 3 个 case 全 PASS:
  - SpiritType 4 component != unknown
  - SpiritType 5 component != unknown
  - spirit_types 含 5 项且全部 component != unknown
2026-09-02 08:17:10 +08:00
joywayer 9fddab82d5 feat(scripts): buildGroupParents - BelongGroupID → group-X 父节点归类 2026-09-02 08:11:05 +08:00
joywayer 7f0bd17b9e feat(scripts): computeLpos / computeContentSize - 锚点转换公式(实测验证) 2026-09-02 08:09:15 +08:00