[P1][T20] 物品名本地化:namestr → string.tbl 三层链(patch → expansion → base) #108
Labels
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: troytt/diablo2-web#108
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
问题
没有这个 issue,界面上显示的全是
caphaxr33这种四字母 code。母 issue 没有单列这一项,但它是「打死怪掉出带词缀的稀有装备」这条验收的必要条件 —— 玩家得能看懂掉的是什么。所以优先级定 P1。
金标准数据
项目里已有的解析代码(可直接复用)
src/formats/tbl.tsdecodeTbl(data, encoding)(L65-128)DecodedTbl,同时是数组(按 index)和带.dict: Map<string,string>(按 key)src/formats/tbl.tslookupTblFast(data, key, encoding)(L130-195)src/formats/tbl.tstblHash()(L15-25)src/game/tables.tstextSourceOf/resolveTextsrc/game/level-names-zh.tslookupTbl()(L378-386)MPQ 里的 .tbl 清单
data\local\lng\eng\string.tbldata\local\LNG\ENG\expansionstring.tbldata\local\LNG\ENG\patchstring.tbldata\local\LNG\CHI\string.tbldata\local\LNG\CHI\patchstring.tbl查询优先级(原版顺序):
patchstring.tbl→expansionstring.tbl→string.tbl,先命中先返回。各表的 tbl key
Armor/Weapons/Misc.txtnamestrcap→ ENGCap/ CHI帽子UniqueItems.txtindexThe Gnasher→ CHI牙齒SetItems.txtindexCiverb's Ward→ CHI希弗柏的防護Sets.txtnameRunes.txtName(不是Rune Name)Runeword26→ ENGDoomMagicPrefix/Suffix.txtName直接就是显示文本,不查 tblRarePrefix/RareSuffix.txtname直接是文本ItemStatCost.txtdescstrpos/descstrneg/descstr2/dgrpstrpos/dgrpstrnegModStr1aENG 实测覆盖率(三层链)
hpompohpfmpfrpsrpl+ 2,均为未使用的占位药水)可直接复用的查询骨架
实现要求
陷阱
验收标准
cap→帽子、tow→塔盾、axe→斧r33/Windforce/Annihilus各一条测试index:The Gnasher→ ENGThe Gnasher/ CHI牙齒index:Civerb's Ward→ CHI希弗柏的防護Name:Runeword26→Doomnpm run typecheck0 errornpx vitest run全绿npx tsx scripts/verify-items.ts新增断言通过溯源
data\global\excel\下的Armor.txt/Weapons.txt/Misc.txt/UniqueItems.txt/SetItems.txt/Sets.txt/Runes.txt(本机/usr/local/google/home/taodao/d2-data,挂载序 d2data → d2exp → Patch_D2,Patch_D2 优先).tbl清单与编码为本机实测已完成 namestr -> string.tbl 三层链查询(patch -> expansion -> base),中文 UTF-8 解码与 LoD 缺失时自动 fallback 到 ENG,覆盖全量 Armor/Weapons/Misc/Unique/Set/Runewords,合并入 main (commit
399aed7)。