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>
This commit is contained in:
2026-09-03 07:41:19 +08:00
co-authored by Claude Opus 5
parent 00d6ba3fc4
commit b6b11d7ca1
+23 -17
View File
@@ -115,18 +115,23 @@ type ObjectList = (GameObject | {})[]; // 长度 3293,索引 = object ID - 1
| `GroupID` | int | 所属 Group(0=根 layer) | Spirit `BelongGroupID` |
| `offX`, `offY` | int | 同 Left/Top(冗余字段) | — |
#### ObjectType 映射(实测)
#### ObjectType 映射(实测 - 完整版)
| ObjectType | 含义 | 出现次数 (Notice_Layer 9 个中) | 示例 |
|---|---|---|---|
| 0 | (未观察到) | — | — |
| 1 | (未观察到) | — | — |
| **2** | **Image/Sprite** | **8/9** (Notice_Layer 中除 145 外) | id 5 (通知), id 3122 (Bgsprite), id 3121 (按钮托盘 SLICED) |
| 3 | (未观察到?) | — | — |
| **4** | **EditBox (含 Text + FontSize + FontColor)** | **1/9** | id 145 (公告内容) |
| 5 | (未观察到) | — | — |
实测 `gameabc_Object.json` 991 个非空对象 + `gameabc.min.js` 逆向:
> ⚠️ **修正之前判断**:之前我以为 ObjectType 2=Sprite, 3=ProgressBar, 4=EditBox, 5=SLICED Sprite(基于 gameabc.min.js minified 推断)—— **实测 Object 145 是 ObjectType=4(EditBox),含 Text/FontSize/FontColor 字段**,不是纯 Label!需要重新校验 Cocos 端 cc.EditBox vs cc.Label 对应关系。
| ObjectType | 含义 | ObjectList 出现次数 | 示例 | Cocos 对应 |
|---|---|---|---|---|
| 0 | (不存在) | 0 | — | — |
| 1 | (不存在) | 0 | — | — |
| **2** | **Image/Sprite** | **782/991** | id 1 (友乐背景, 1280×720 全屏), id 5 (通知, 150×70) | `cc.Sprite` (单帧) 或 `cc.Sprite` _type=1 (SLICED 9-slice) |
| 3 | (不存在静态) | 0 | — | — |
| **4** | **Text/EditBox** | **209/991** | id 65 (战绩文字内容), id 145 (公告内容) | `cc.Label` 或 `cc.EditBox` (含 Text + FontSize) |
| 5 | (运行时动态) | 0 (静态) | gameabc.min.js 中 `obj.uidata` 子对象 (按钮 controller, SizeStyle 控件) | 不需要静态迁移 (动态生成) |
| 6 | (运行时动态) | 0 (静态) | gameabc.min.js 中 `this.ObjectType = 6` (SizeStyle 控件初始化) | 不需要静态迁移 |
> 🟢 **关键发现**:ObjectList 静态数据**只有 ObjectType 2 (Sprite) 和 4 (Text/EditBox)**。Type 5/6 是 gameabc **运行时动态创建**的对象(如 button controller、SizeStyle),不需要持久化迁移。
>
> 🟢 **SelfPos=OriginPos=1** 对所有 991 object 都成立 → **所有 object 都用 top-left 锚点**(X,Y 即左上角绝对坐标,无需复杂 OriginPos 公式)。
#### 9-slice border 字段(4 字段)
| 字段 | 类型 | 含义 |
@@ -135,14 +140,15 @@ type ObjectList = (GameObject | {})[]; // 长度 3293,索引 = object ID - 1
> 🟢 **Cocos 对应**:`cc.SpriteFrame.capInsets = [L9, T9, R9, B9]`(capInsets 全 0 = SIMPLE,否则 SLICED)
#### Frame 字段(4 字段)
| 字段 | 类型 | 含义 |
|---|---|---|
| `FrameStyle` | int | 0=单帧, 1=多帧(具体待 gameabc.min.js 逆向) |
| `FrameIndex` | int | 当前显示的帧索引(0 到 FrameStyle 总帧数-1) |
| `TextFrames` | str | (空字符串或具体多帧配置?需逆向) |
#### Frame 字段(实测 - 完整版)
> 🟡 **Frame 字段语义待 gameabc.min.js 逆向确认**
| 字段 | 类型 | 全工程分布 | 含义 |
|---|---|---|---|
| `FrameStyle` | int | None: 209 (EditBox), 0: 728 (单帧 Sprite), 1: 54 (多帧 Sprite) | 0=单帧, 1=多帧动画 |
| `FrameIndex` | int | 54 个 Sprite 用 | 当前显示的帧索引 (0 到 FrameStyle 总帧数-1) |
| `TextFrames` | str | 多帧配置字符串 (待具体逆向) | (目前空字符串) |
> 🟢 **实测 FrameStyle 分布**: 单帧 Sprite 占主导 (728/991=73%), 多帧 Sprite 占 54/991=5%, EditBox/Text 无帧 (21%)。多帧 sprite 需用 atlas 多张散图 (`gameabc_Image.bmp` + `frame_all` 字段 → 拆成多 PNG,参考 playbook §关键迁移规则)。
#### 字体字段(EditBox/Text 字段,8 字段)
| 字段 | 类型 | 含义 |