4 Commits
25 changed files with 359 additions and 41 deletions

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
name: 报告问题 / Report a bug
description: 哪一步出了问题?告诉我们经过就好。 / Tell us what happened.
body:
- type: markdown
attributes:
value: |
不用上传存档或完整私人日志;截图请先遮住账号、路径和进度信息。
Please leave saves and full private logs out of this public report. Hide personal details in screenshots.
- type: textarea
id: problem
attributes:
label: 做了什么,发生了什么? / What happened?
placeholder: "例如:搜索某件物品,点添加后…… / For example: I searched for an item, clicked Add, then…"
validations:
required: true
- type: input
id: editor_version
attributes:
label: 编辑器版本 / Editor version
placeholder: "例如 / e.g. v0.3.0"
- type: input
id: game_build
attributes:
label: 游戏 build(不知道可留空) / Game build (optional)
- type: textarea
id: error
attributes:
label: 报错文字或截图(可选) / Error text or screenshot (optional)
description: 去掉账号路径等个人信息即可。 / Remove account paths and other personal details.
+5
View File
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: 使用说明 / Getting started
url: https://github.com/qry6868/PBZ-Editor#readme
about: 下载、添加物品、保存和备份 / Download, add items, save and recover backups
@@ -0,0 +1,13 @@
name: 想法和建议 / Ideas and suggestions
description: 想让工具帮你完成什么? / What would you like to do?
body:
- type: textarea
id: idea
attributes:
label: 你想完成什么,或哪一步用着别扭? / What would you like to do or improve?
validations:
required: true
- type: textarea
id: current_workflow
attributes:
label: 现在是怎么做的?(可选) / How do you do it now? (optional)
+10 -4
View File
@@ -2,13 +2,17 @@
[简体中文](README.md) | English
[![Windows build](https://github.com/qry6868/PBZ-Editor/actions/workflows/build.yml/badge.svg)](https://github.com/qry6868/PBZ-Editor/actions/workflows/build.yml)
Offline Windows save editor · Free and open source (MIT) · Chinese / English
This started with one missed item: **Arrowward**.
The plan was to get it back. That grew into a small editor with item search, map filters and icons from the game. Find something, add it to your inventory, adjust its quantity or upgrade level, then save. You can recover a missed piece of gear or try another weapon without leaving the window.
**[Download for Windows](https://github.com/qry6868/PBZ-Editor/releases/tag/v0.3.0)** · [What's new](docs/releases/0.3.0.en.md)
**[Download the Windows app](https://github.com/qry6868/PBZ-Editor/releases/download/v0.3.1/PBZ-Editor-0.3.1-windows-x64.zip)** · [Release notes and checksums](https://github.com/qry6868/PBZ-Editor/releases/tag/v0.3.1)
The current release is **v0.3.0 preview** for Windows x64. Steam build **26266538** is the tested reference. After a game update, the editor checks the save and item data automatically; compatible features remain available rather than blocking an entire build number.
The current release is **v0.3.1 preview** for Windows x64. After a game update, the editor checks the save and item data automatically. Features that pass the checks remain available. Steam build **26266538** is the reference environment.
## A quick look
@@ -28,7 +32,7 @@ These are captures of the actual app using a generated demo inventory. The file
## Give it a try
1. Download `PBZ-Editor-0.3.0-windows-x64.zip`, **extract the whole archive**, and exit the game.
1. Download `PBZ-Editor-0.3.1-windows-x64.zip`, **extract the whole archive**, and exit the game to the desktop.
2. Run `PBZ-Editor.exe`. It usually finds the game and save for you. If it doesn't, choose them manually; if several accounts appear, pick your own progress.
3. Search the item library by name, or browse by category and map. Select an item and click **Add to inventory**.
4. Adjust its quantity or level on the right, then click **Save changes** in the top corner.
@@ -37,6 +41,8 @@ No Python installation or manual DLL setup needed. The first launch takes a litt
Switch between **简体中文 / English** at the top. Pending edits stay with you, and the app remembers your language next time.
If the editor says the save file changed, exit the game and choose **Reload save**. Once it opens, check the selected progress and make your changes again. Choose **Keep current edits** if you want to review your draft first.
## What you can edit
Main weapons, phantom weapons, accessories, items and materials, medicines, and full outfits: **799 editable entries** in the supported build. Names, descriptions and icons come from your installed game, as do the map associations. Where English text is missing, the original name or internal ID stays visible.
@@ -49,7 +55,7 @@ A few things to keep in mind:
- **Medicine uses still follow the game's rules.** Loading may refill them, so arbitrary counts aren't guaranteed to stay exactly as entered.
- A map association isn't necessarily the only place to get an item. Full outfits unlock in the account wardrobe.
Five sample categories passed a game load, manual save, exit and readback in v0.2.0. This release adds automatic compatibility and file-roundtrip tests; other game builds have not been tested in-game. The [validation notes](docs/validation.en.md) explain what has been tested and what remains uncertain.
Five sample categories passed a game load, manual save, exit and readback in v0.2.0. For v0.3.1, we tested conflict recovery on an isolated save from Steam build **26367565** and confirmed the updated Blackstone fragment count in the game inventory. [Validation scope and limits](docs/validation.en.md)
## What happens after a game update?
+10 -4
View File
@@ -2,13 +2,17 @@
简体中文 | [English](README.en.md)
[![Windows build](https://github.com/qry6868/PBZ-Editor/actions/workflows/build.yml/badge.svg)](https://github.com/qry6868/PBZ-Editor/actions/workflows/build.yml)
Windows 离线存档编辑器 · 免费开源(MIT) · 中文 / English
事情的起因是一件没拿到的「避箭护符」。
原本只是想把它补回来,后来索性把物品搜索、地图筛选和游戏图标都做进去了:找到想要的东西,加进背包,改好数量或等级,再保存。补一件错过的装备,或是试试别的武器,都能在一个窗口里完成。
**[下载 Windows 版](https://github.com/qry6868/PBZ-Editor/releases/tag/v0.3.0)** · [更新说明](docs/releases/0.3.0.zh-CN.md)
**[直接下载 Windows 运行包](https://github.com/qry6868/PBZ-Editor/releases/download/v0.3.1/PBZ-Editor-0.3.1-windows-x64.zip)** · [更新说明与校验和](https://github.com/qry6868/PBZ-Editor/releases/tag/v0.3.1)
目前是 **v0.3.0 预览版**,运行于 Windows x64。已验证的参考环境是 Steam build **26266538**;游戏更新后会自动检查存档和物品数据,兼容的部分可以继续编辑,不再按版本号整包拦住。
目前是 **v0.3.1 预览版**,运行于 Windows x64。游戏更新后会自动检查存档和物品数据,兼容的部分可以继续编辑。参考环境为 Steam build **26266538**。
## 看看怎么用
@@ -28,7 +32,7 @@
## 先用起来
1. 下载 `PBZ-Editor-0.3.0-windows-x64.zip`,**完整解压**,退出游戏。
1. 下载 `PBZ-Editor-0.3.1-windows-x64.zip`,**完整解压**,把游戏退出到桌面。
2. 双击 `PBZ-Editor.exe`。通常会自动找到游戏和存档;没找到就手动选一下,有多个账号时选自己的进度。
3. 在物品库搜索名称,或按类别、地图找。选中物品,点「添加到背包」。
4. 在右侧调整数量、等级,最后点右上角的「保存存档」。
@@ -37,6 +41,8 @@
顶部可以切换 **简体中文 / English**,正在改的背包会保留,下次打开也会记住语言。
如果保存时提示存档已更新,先退出游戏,再点「重新读取存档」。读取成功后,请确认上方的进度,再按最新背包重新修改。想先查看旧草稿,可以点「保留当前修改」。
## 能改什么
主武器、影之武装、饰品、道具材料、药品和完整服装,目前共有 **799 个可编辑条目**。物品名称、说明和图标都从本机游戏读取,地图筛选也来自游戏里的关联信息。英文资源缺少翻译的地方,会保留原名或内部 ID。
@@ -49,7 +55,7 @@
- **药品次数会受游戏规则影响。** 比如读档后可能被补满,不能保证你填的任意次数都原样留下。
- 地图关联不一定是唯一获取地点;完整服装会解锁账号衣柜。
v0.2.0 的五类样品通过了游戏载入、手动保存、退出后的回读检查。本版新增了自动兼容检测和文件往返测试,还没有其他游戏版本的实机验证。[测过什么、还有哪些限制](docs/validation.zh-CN.md)都单独记在这里,遇到具体物品拿不准时可以看一下。
v0.2.0 的五类样品通过了游戏载入、手动保存、退出后的回读检查。v0.3.1 使用隔离副本在 Steam build **26367565** 验证了冲突恢复,并在游戏背包确认了修改后的黑石碎片数量。[测试范围与限制](docs/validation.zh-CN.md)
## 游戏更新了怎么办
+1 -1
View File
@@ -14,7 +14,7 @@ rustup override set 1.99.1-x86_64-pc-windows-gnu
.\tools\build_release.ps1 -Zip
```
Output: the Windows ZIP, source ZIP and SHA256SUMS.txt under `dist/v0.3.0/`. The runtime includes Python, Qt and an open-source decoder. No proprietary Oodle DLL is required.
The build writes the Windows ZIP, source ZIP and `SHA256SUMS.txt` under `dist/v<version>/`. The runtime includes Python, Qt and an open-source decoder. No proprietary Oodle DLL is required.
Run source: `.\.venv\Scripts\python.exe -m pbz_editor.app`. Optional flags: `--language en-US` or `--language zh-CN`. Set `PBZ_EDITOR_DATA_DIR` for isolated test data.
+1 -1
View File
@@ -14,7 +14,7 @@ rustup override set 1.99.1-x86_64-pc-windows-gnu
.\tools\build_release.ps1 -Zip
```
输出:`dist/v0.3.0/` 下的 Windows ZIP、源码 ZIP 和 SHA256SUMS.txt。运行包内置 Python、Qt 和开放源码解码器,不需要专有 Oodle DLL。
构建会在 `dist/v<版本号>/` 下生成 Windows ZIP、源码 ZIP 和 `SHA256SUMS.txt`。运行包内置 Python、Qt 和开放源码解码器,不需要专有 Oodle DLL。
源码启动:`.\.venv\Scripts\python.exe -m pbz_editor.app`。可加 `--language en-US` 或 `--language zh-CN`。设置 `PBZ_EDITOR_DATA_DIR` 可指定独立测试数据目录。
Binary file not shown.

After

Width:  |  Height:  |  Size: 121 KiB

+20
View File
@@ -0,0 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1280" height="640" viewBox="0 0 1280 640">
<rect width="1280" height="640" fill="#f7f9fc"/>
<rect x="0" y="0" width="1280" height="8" fill="#0f6cbd"/>
<g font-family="Microsoft YaHei">
<text x="60" y="78" fill="#0f6cbd" font-size="16" font-weight="600" letter-spacing="1">OPEN SOURCE · WINDOWS x64</text>
<text x="56" y="166" fill="#17212f" font-size="66" font-weight="700">PBZ Editor</text>
<text x="60" y="234" fill="#17212f" font-size="30" font-weight="600">Get your missing gear back.</text>
<text x="60" y="285" fill="#526274" font-size="22">Phantom Blade Zero save editor</text>
<text x="60" y="362" fill="#25384c" font-size="25">Find → Adjust → Save</text>
<rect x="60" y="401" width="160" height="40" rx="6" fill="#e5f1fb"/>
<text x="73" y="428" fill="#0f6cbd" font-size="17">Chinese / English</text>
<rect x="233" y="401" width="132" height="40" rx="6" fill="#edf0f4"/>
<text x="245" y="428" fill="#41556a" font-size="17">Auto backups</text>
<text x="60" y="505" fill="#526274" font-size="18">Offline inventory editor</text>
<text x="60" y="566" fill="#526274" font-size="16">github.com/qry6868/PBZ-Editor</text>
<rect x="579" y="95" width="648" height="432" rx="9" fill="#dce3ec"/>
<rect x="575" y="89" width="648" height="432" rx="9" fill="#ffffff" stroke="#d6dfe9"/>
<image x="583" y="97" width="632" height="416" preserveAspectRatio="xMidYMid meet" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABVAA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iwIQJE4YMGaKmpjZ58uR+/fpduXIlMTHx7t27AQEBmpqa5ubmkyZNondkmTBhgqOjo5aWlr+/f1JSktQdb+ptWloah8OZMWOGvr4+IWT58uUODg4pKSlycnLV1dVpaWlubm6EkOjoaELI+fPnHRwcuFxuI522J2Vl5a1bt5aWln7//ffV1dVUIYPBsLCw2Lp165MnT2JiYqQOqTvCUoV1By0xMfHBgwebN282MTExMDBYv349VTMxMfHOnTvbtm2zsLDQ0tKaO3euiYkJNS2inXl4eJw8eXLfvn0mJiazZs0qKSkhhMyYMcPGxubdu3dsNlsgEGRmZqanp9+6dWv16tVWVlaampqzZs2iWygsLFyxYsXkyZM9PT3f292IESOcnJxUVFQ8PDzs7e2jo6Op396MjAx5efnJkydra2u33cnWy9XVtba2lvotPXfu3LBhwyQfipGSkvL48eOVK1eamJioq6Line truncated
<text x="1222" y="551" text-anchor="end" fill="#65758a" font-size="14">DEMO inventory</text>
</g></svg>

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

+20
View File
@@ -0,0 +1,20 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1280" height="640" viewBox="0 0 1280 640">
<rect width="1280" height="640" fill="#f7f9fc"/>
<rect x="0" y="0" width="1280" height="8" fill="#0f6cbd"/>
<g font-family="Microsoft YaHei">
<text x="60" y="78" fill="#0f6cbd" font-size="16" font-weight="600" letter-spacing="1">OPEN SOURCE · WINDOWS x64</text>
<text x="56" y="166" fill="#17212f" font-size="66" font-weight="700">PBZ Editor</text>
<text x="60" y="234" fill="#17212f" font-size="30" font-weight="600">错过的装备,补回来。</text>
<text x="60" y="285" fill="#526274" font-size="22">Phantom Blade Zero save editor</text>
<text x="60" y="362" fill="#25384c" font-size="25">找物品 → 调数值 → 保存</text>
<rect x="60" y="401" width="160" height="40" rx="6" fill="#e5f1fb"/>
<text x="73" y="428" fill="#0f6cbd" font-size="17">中文 / English</text>
<rect x="233" y="401" width="132" height="40" rx="6" fill="#edf0f4"/>
<text x="245" y="428" fill="#41556a" font-size="17">自动备份</text>
<text x="60" y="505" fill="#526274" font-size="18">影之刃零 · 离线物品编辑器</text>
<text x="60" y="566" fill="#526274" font-size="16">github.com/qry6868/PBZ-Editor</text>
<rect x="579" y="95" width="648" height="432" rx="9" fill="#dce3ec"/>
<rect x="575" y="89" width="648" height="432" rx="9" fill="#ffffff" stroke="#d6dfe9"/>
<image x="583" y="97" width="632" height="416" preserveAspectRatio="xMidYMid meet" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABVAAAAOECAIAAADIY40cAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAgAElEQVR4nOzdZ1wUV9sH4LMsbem9qqgBUSlSbUAsCDZiwRoIRg12TWxRsUVjr6hYEHtvURTFhiBWpIiIIggISG9LXxa2vh8mzzz7giIgivL8r18+7Jw5M3NmkLD3KfcwxGIxAQAAAAAAAIC2Raq1GwAAAAAAAAAALQ8BPwAAAAAAAEAbhIAfAAAAAAAAoA1CwA8AAAAAAADQBiHgBwAAAAAAAGiDEPADAAAAAAAAtEEI+AEAAAAAAADaIOnWbgAAAAAAAHwRbDa7oKBAIBC0dkPaCBaLpaSkpK+v39oNAWgshlgsbu02AAAAAABAC0tKSmKxWIaGhtLSGORrGVwut7S0lM1mW1hYtHZbABqlmQE/Ogvra3yHX9t4eujgBAAAAPhmsdnsqqoqIyOj1m5IG1RQUCAjI6OhodHaDfm+7biTsfteZkXN9x0TfR3t1OVdumv6TjRtxrHNCfjRWfhBjezwazNPDx2cAAAAAN+sN2/edOnS5Xv/wvlt4vP5qamp3bp1a+2GfMdMfB6zOXwRJps3GlOKwWCQ4l0Dmnpgk5P2sdlsFotlZGSE/33UwWKxDAwMdHR0SkpKPlanLT29xtwvAAAAALQKgUDQBr5wfptkZGT4fH5rt+I7tuNOBrsa0X7TCEVisUi86+77ph7Y5IC/oKDA0NCwqUf979DQ0CgoKPjY3rb39Bq+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FRVVWVl5fXzz//XOdh0gYOHDhixAh68/Lly1T/RVFRka6ubkJCQmxsrKmpqb6+/sKFC3fu3FlSUkIIYTKZ1tbWhJCampq4uLivGTm7uLi4uLiw2exXr16lpaURQhITEwsKCrS0tBISEmRkZHR1daWkpGpqao4ePUrNPnjw4AH114I6Q+/evVNSUlatWrVmzZqPrRD5EiIiIiZPnkx9ZrPZCxYsoP49s9ls6o+cvLw8nT1h3Lhxixcv1tLScnFx2bdvn4xMQ52vtFevXklml1BRUbGwsGjZuwAAAID/NX/++Sch5MqVK7t27Zo2bdr48eMJIfQwxv379+fMmRMfH08IOXr0qJqa2sSJE6nv0n/88UdOTg6Hw/Hw8PDy8pI8561bt6jv0tXV1T169Hj8+DH1fbKioqJnz550NXV1dUNDw/j4eCsrK6okLi7OyMiotaJ9QsitW7fYbPbcuXMVFRXpQg6Hs2/fPk1NTW9v7y9x0UWuHRe5dqzmCYf4xv496of+phqfPOTsdEsZJmPqsYSPVQhNZAfNs7ZopxSaWHL0cQ5VuPjiW6++Br/01ieEFFbyjj7OWT/amBCiwpLu0V5ZJBL3N9XgCUWvcqp6bYgcaaW9fbyp5DkvRed79NTbPLYLIcTz0Ku5A9v3+UGt3pW/qpzSmuIq/qwB7emS4ip+TmmNobp8nZqW7ZSdTNQJITzBv6PO7zY5SVZIyuMQQvaFZRJCguZZE0IWXngbmviBSJ72yWoKskxNRZmu+opvcqvuvy05G5l3NjJvUHdNQkgFV7DqamrT7vazfaNZ+tPS0lLine truncated
<text x="1222" y="551" text-anchor="end" fill="#65758a" font-size="14">DEMO · 演示数据</text>
</g></svg>

After

Width:  |  Height:  |  Size: 181 KiB

+4 -2
View File
@@ -1,12 +1,14 @@
PBZ Editor 0.3.0 — Start here
PBZ Editor 0.3.1 — Start here
简体中文: START-HERE.txt
1. Extract the complete archive. Keep the EXE and _internal folder together.
2. Exit the game and run PBZ-Editor.exe. No Python or administrator rights needed.
2. Exit the game to the desktop and run PBZ-Editor.exe. No Python or administrator rights needed.
3. Game and save detection is automatic. If needed, select the game root containing platform/steam/PBZ.exe.
4. Find an item → Add to backpack → Adjust values on the right → Save.
5. Switch 简体中文 / English at the top. Backups are created before saving; use Backups to view or restore them.
If the save file changed, exit the game and choose Reload save. Once it opens, make your changes again using the updated progress.
Runs on Windows x64. Steam build 26266538 is the tested reference; updates are checked automatically.
Incompatible categories become read-only. Search and category browsing work without maps. Unverifiable saves are not written.
The first launch prepares metadata and icons from your installed game. Wait for preparation to finish.
+4 -2
View File
@@ -1,12 +1,14 @@
PBZ Editor 0.3.0 — 开始使用
PBZ Editor 0.3.1 — 开始使用
English: START-HERE.en.txt
1. 完整解压运行包,保留 EXE 及 _internal 文件夹。
2. 退出游戏,双击 PBZ-Editor.exe;不需要 Python 或管理员权限。
2. 把游戏完全退出到桌面,再双击 PBZ-Editor.exe。不需要 Python 或管理员权限。
3. 自动识别游戏与存档;未找到时选择含 platform/steam/PBZ.exe 的游戏根目录。
4. 找物品 → 添加到背包 → 右侧调整数值 → 保存存档。
5. 顶部可以切换简体中文 / English。保存前自动备份,顶部“备份”可查看和恢复。
如果提示存档已更新,先退出游戏,再选“重新读取存档”。读取成功后按最新进度重新修改。
运行环境:Windows x64。参考验证版本为 Steam build 26266538,其他更新自动检查兼容性。
不兼容的类别会设为只读;地图不可用时仍可搜索和按类别查找。无法验证的存档不会写入。
首次启动从本机游戏准备清单和图标;请等待准备完成。
+2 -2
View File
@@ -2,14 +2,14 @@
[简体中文](validation.zh-CN.md)
Steam build **26266538** is the reference environment. v0.3.0 checks other updates for file compatibility without promising universal support. Tests use synthetic data and isolated copies. No player saves, private raw reports or private screenshots are published; README screenshots use generated demo inventories.
Steam build **26266538** is the reference environment. Since v0.3.0, the editor checks file compatibility after game updates. Tests use synthetic data and isolated copies. No player saves, private raw reports or private screenshots are published. README screenshots use generated demo inventories.
| Area | Evidence and boundary |
| --- | --- |
| Automated tests | Synthetic saves cover read/write boundaries, backups, external changes, untouched slots, UI behavior and language switching; they run without game resources |
| Local game resources | 844 catalog entries, 799 editable entries and 714 item icons; compared against the local baseline using installed game text and map data |
| File roundtrip | Disposable copies passed edits, export, backup, restore and independent decoder checks; unrelated JSON and untouched slots were checked |
| Game readback | Five categories passed load, manual save, exit and readback in v0.2.0; the new v0.3.0 compatibility logic has no in-game readback records from other game builds |
| Game readback | Five categories passed load, manual save, exit and readback in v0.2.0. For v0.3.1, an isolated save from Steam build **26367565** was used to verify save conflict recovery and confirm a count of 7 Blackstone fragments in the game inventory |
| Automatic compatibility | Synthetic cases cover EXE changes, key relocation/rotation, future containers, category failures and updates during checks; reference resources also receive in-memory value-change and layout-corruption checks |
| Packaged app | Locally checked fresh data, Chinese/space paths, minimal PATH, portable mode, migration, subsequent launch, backup-preserving upgrades and error handling |
| Clean computer | No second Windows PC or clean VM was available; not tested |
+2 -2
View File
@@ -2,14 +2,14 @@
[English](validation.en.md)
当前参考环境为 Steam build **26266538**。v0.3.0 自动检查其他更新的文件兼容性,不承诺所有版本通用。测试仅使用合成数据和隔离副本。公开仓库不包含玩家存档、私人原始报告或私人截图;README 的截图使用专门生成的演示背包。
当前参考环境为 Steam build **26266538**。从 v0.3.0 起,编辑器会自动检查游戏更新后的文件兼容性。测试仅使用合成数据和隔离副本。公开仓库不包含玩家存档、私人原始报告或私人截图。README 的截图使用专门生成的演示背包。
| 范围 | 结果与边界 |
| --- | --- |
| 自动测试 | 合成存档覆盖读写、边界、备份、外部变化拦截、未修改槽保护、界面与语言切换;可在无游戏资源的机器运行 |
| 本机资源 | 844 条目录、799 条可编辑、714 个物品图标;与本机基准比较,文字与地图信息来自已安装游戏 |
| 文件往返 | 本机副本通过修改、导出、备份、恢复与独立解码检查;验证未修改槽和无关 JSON 保留 |
| 游戏回读 | v0.2.0 的五类样品(道具、主武器、影之武装、饰品、药品)通过载入、手动保存、退出后回读;v0.3.0 新兼容逻辑尚无其他游戏版本的实机回读记录 |
| 游戏回读 | v0.2.0 的五类样品(道具、主武器、影之武装、饰品、药品)通过载入、手动保存、退出后回读。v0.3.1 在 Steam build **26367565** 的隔离副本上验证了存档冲突恢复,并确认修改后的黑石碎片数量在游戏背包显示为 7 个 |
| 自动兼容 | 合成样本覆盖 EXE 变化、密钥移动/轮换、未来容器只读、单类别异常和检查期间更新;真实参考资源另做内存数值变更与布局损坏检查 |
| 运行包 | 本机新数据目录、中文空格路径、精简 PATH、便携模式、旧数据迁移、再次启动、升级保留备份及错误提示已检查 |
| 干净机器 | 没有独立 Windows 电脑或干净虚拟机,尚未验证 |
+1 -1
View File
@@ -1,2 +1,2 @@
"""PBZ Editor: local inventory and save editing for Phantom Blade Zero."""
__version__ = "0.3.0"
__version__ = "0.3.1"
+7 -3
View File
@@ -27,6 +27,10 @@ class EditorError(ValueError):
"""A user-readable failure which leaves the input save unchanged."""
class SaveChangedError(EditorError):
"""The save on disk no longer matches the open snapshot."""
MAX_SLOT_BYTES = 64 * 1024 * 1024
MAX_FILE_BYTES = 256 * 1024 * 1024
CATEGORY_FIELDS = {
@@ -920,7 +924,7 @@ class SaveSession:
def _check_source(self):
self._check_game()
if not self.save_path.is_file() or sha256(self.save_path.read_bytes()) != self.source_sha256:
raise EditorError("存档已被游戏或其他程序更新。请重新打开存档,再应用修改。")
raise SaveChangedError("存档已被游戏或其他程序更新。请重新打开存档,再应用修改。")
def _check_game(self):
if self.game_signature is not None:
@@ -942,7 +946,7 @@ class SaveSession:
if temporary.read_bytes() != data:
raise EditorError("写出后的文件校验失败。")
if expected is not None and (not destination.is_file() or sha256(destination.read_bytes()) != expected):
raise EditorError("存档在写入前发生变化,已取消覆盖。")
raise SaveChangedError("存档在写入前发生变化,已取消覆盖。")
if expected is None:
# Atomic create-without-replacement: an export must not clobber
# a file another program created after the file-picker check.
@@ -981,7 +985,7 @@ class SaveSession:
def apply(self, slot: str, operations: list[dict], compression="preserve") -> dict:
if _game_processes(self.game_dir):
raise EditorError("游戏仍在运行。请退出游戏后写入,避免自动保存覆盖修改。")
raise EditorError("游戏仍在运行。请完全退出游戏到桌面,再点击保存存档。")
self._check_source()
candidate, changes = self._candidate(slot, operations, compression)
if candidate == self.source:
+7 -1
View File
@@ -204,11 +204,17 @@
"存档目录长度无效。": "Invalid save directory length.",
"当前游戏版本尚未适配。本版支持 Steam build {0},文件未修改。": "This game version is not supported. Supported Steam build: {0}. No file was changed.",
"请选择含 platform/steam/PBZ.exe 的游戏根目录。": "Select the game root containing platform/steam/PBZ.exe.",
"游戏仍在运行。请退出游戏后写入,避免自动保存覆盖修改。": "The game is running. Exit it before saving changes.",
"游戏仍在运行。请完全退出游戏到桌面,再点击保存存档。": "The game is still running. Exit to the desktop, then click Save changes again.",
"游戏在验证期间启动,已取消写入;备份已保留。": "The game started during validation. Saving was cancelled; the backup was kept.",
"游戏在验证期间启动,已取消恢复。": "The game started during validation. Restore was cancelled.",
"请先退出游戏再恢复备份。": "Exit the game before restoring a backup.",
"存档已被游戏或其他程序更新。请重新打开存档,再应用修改。": "The save was updated by the game or another program. Reopen it before applying changes.",
"存档已更新": "Save file changed",
"请先完全退出游戏。重新读取成功后,本次未保存的修改将被清除,请按最新进度重新调整。": "Exit the game completely first. Reloading will clear your unsaved edits once the latest save has opened. Make your changes again using the updated progress.",
"重新读取存档": "Reload save",
"保留当前修改": "Keep current edits",
"已读取最新存档。请确认上方进度,再重新调整背包。": "The latest save is loaded. Check the selected progress above, then edit the inventory again.",
"此存档没有可读取的进度。": "This save has no readable progress slots.",
"备份内容或目标路径与备份记录不符。": "The backup content or target path does not match its record.",
"未找到对应备份记录,无法验证恢复来源。": "The matching backup record is missing. Its restore source cannot be verified.",
"此备份之后已有新进度。默认不会覆盖;请明确选择允许放弃新进度。": "New progress was saved after this backup. Restore was refused to avoid overwriting it.",
+44 -12
View File
@@ -4,6 +4,7 @@ from PySide6.QtWidgets import QMenu
from PySide6.QtGui import QShortcut, QKeySequence, QPixmap, QPainter
from PySide6.QtCore import QSize
import threading
from .core import EditorError, SaveChangedError
from .draft import InventoryDraft, item_key
from .paths import resolve_game
from . import __version__
@@ -551,7 +552,7 @@ class EditorWindow(QMainWindow):
self.items, self.item_lookup = [], {}
self.refresh_all()
def run_task(self, title, function, done):
def run_task(self, title, function, done, on_error=None):
if self.busy:
return
self.busy = True
@@ -571,7 +572,8 @@ class EditorWindow(QMainWindow):
self.status.setText(tr('已取消准备,可点击重新准备。'))
else:
self.status.setText(tr('操作未完成;当前背包修改仍保留。'))
QMessageBox.warning(self, tr('操作未完成'), value)
if on_error is None or not on_error(value):
QMessageBox.warning(self, tr('操作未完成'), str(value))
if was_preparing:
self.welcome.show()
self.retry_button.show()
@@ -597,11 +599,11 @@ class EditorWindow(QMainWindow):
else:
continuation()
def load_save(self, path):
def load_save(self, path, *, reload_current=False):
if self.busy:
return
def start():
game = self.settings.get('game_dir')
game = self.session.game_dir if reload_current else self.settings.get('game_dir')
if not game:
self.welcome.show()
self.welcome_text.setText(tr('尚未找到游戏。选择 PBZ 安装位置后,会自动查找存档。'))
@@ -613,6 +615,8 @@ class EditorWindow(QMainWindow):
self._prepare_cancel = threading.Event()
self._pending_save = str(path)
self.retry_button.hide()
slot = self.slot_name() if reload_current else None
region = self.region_filter.currentData()
def prepare_and_load():
generated = None
if not self._custom_catalog:
@@ -621,26 +625,35 @@ class EditorWindow(QMainWindow):
if self._prepare_cancel.is_set():
raise InterruptedError(tr('已取消准备'))
self.preparation_progress.emit(tr('正在读取所选进度…'))
return generated, SaveSession.open(path, game, self.settings.get('oodle_path') or None)
session = SaveSession.open(path, game, self.settings.get('oodle_path') or None)
if not session.slots:
raise EditorError('此存档没有可读取的进度。')
return generated, session
def loaded(result):
generated, session = result
if generated:
self.load_catalog(generated)
self.accept_session(session)
if reload_current:
self.region_filter.setCurrentIndex(max(0, self.region_filter.findData(region)))
self.accept_session(session, slot)
self.run_task(tr('正在准备本机游戏数据…'), prepare_and_load, loaded)
self._resolve_changes(start)
if reload_current:
start()
else:
self._resolve_changes(start)
def accept_session(self, session):
def accept_session(self, session, reloaded_slot=None):
self.session = session
self.welcome.hide()
self.save_file_label.setText(session.save_path.name)
self.save_file_label.setToolTip(str(session.save_path))
self.settings['last_save'] = str(session.save_path)
save_settings(self.settings)
self._fill_slots(session.current_slot)
self._fill_slots(reloaded_slot or session.current_slot)
self._new_draft(self.slot_combo.currentData())
self._ensure_icons()
self.status.setText(tr('左侧添加物品,右侧调整背包;完成后点击右上角保存。'))
self.status.setText(tr('已读取最新存档。请确认上方进度,再重新调整背包。') if reloaded_slot else
tr('左侧添加物品,右侧调整背包;完成后点击右上角保存。'))
self.session_loaded.emit()
def _fill_slots(self, selected):
@@ -656,7 +669,8 @@ class EditorWindow(QMainWindow):
if name == session.current_slot:
prefix += tr('(继续游戏)')
self.slot_combo.addItem(f"{prefix} · {slot.get('date', '')}", name)
self.slot_combo.setCurrentIndex(max(0, self.slot_combo.findData(selected)))
index = self.slot_combo.findData(selected)
self.slot_combo.setCurrentIndex(index if index >= 0 else self.slot_combo.findData(session.current_slot))
self.slot_combo.blockSignals(False)
def _new_draft(self, slot):
@@ -1126,7 +1140,25 @@ class EditorWindow(QMainWindow):
self.status.setText(tr('背包已保存,已自动备份。'))
if after:
after()
self.run_task(tr('正在自动备份并保存背包…'), lambda: session.apply(slot, operations), saved)
self.run_task(tr('正在自动备份并保存背包…'), lambda: session.apply(slot, operations), saved,
on_error=self._offer_save_reload)
def _offer_save_reload(self, error):
if not isinstance(error, SaveChangedError):
return False
dialog = QMessageBox(self)
dialog.setIcon(QMessageBox.Icon.Warning)
dialog.setWindowTitle(tr('存档已更新'))
dialog.setText(translate_message(str(error)))
dialog.setInformativeText(tr('请先完全退出游戏。重新读取成功后,本次未保存的修改将被清除,请按最新进度重新调整。'))
reload_button = dialog.addButton(tr('重新读取存档'), QMessageBox.ButtonRole.AcceptRole)
keep_button = dialog.addButton(tr('保留当前修改'), QMessageBox.ButtonRole.RejectRole)
dialog.setDefaultButton(keep_button)
dialog.setEscapeButton(keep_button)
dialog.exec()
if dialog.clickedButton() is reload_button:
self.load_save(self.session.save_path, reload_current=True)
return True
def export_save(self):
if not self.draft or self.busy:
+2 -2
View File
@@ -96,7 +96,7 @@ def value_field(spin):
class WorkerSignals(QObject):
done = Signal(object)
error = Signal(str)
error = Signal(object)
progress = Signal(int, int)
@@ -111,7 +111,7 @@ class Worker(QRunnable):
result = self.function()
except Exception as error:
logging.exception("Editor operation failed")
self.signals.error.emit(str(error))
self.signals.error.emit(error)
else:
self.signals.done.emit(result)
+1 -1
View File
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
[project]
name = "pbz-editor"
version = "0.3.0"
version = "0.3.1"
description = "Offline inventory and save editor for Phantom Blade Zero"
requires-python = ">=3.11"
dependencies = ["PySide6>=6.8,<7", "cryptography>=43", "texture2ddecoder==1.0.6"]
+1 -1
View File
@@ -24,7 +24,7 @@ def test_translations_cover_ui_and_keep_format_fields():
@pytest.mark.parametrize(('source', 'target'), [
('游戏仍在运行。请退出游戏后写入,避免自动保存覆盖修改。', 'The game is running. Exit it before saving changes.'),
('游戏仍在运行。请完全退出游戏到桌面,再点击保存存档。', 'The game is still running. Exit to the desktop, then click Save changes again.'),
('未知压缩算法:9。', 'Unknown compression algorithm: 9.'),
('存档槽 ManualSave1 中的 JSON 无效。', 'Invalid JSON in save slot ManualSave1.'),
('C:/test/file.sav', 'C:/test/file.sav'),
+98 -2
View File
@@ -4,11 +4,11 @@ import os
import zlib
os.environ.setdefault('QT_QPA_PLATFORM', 'offscreen')
import pytest
from PySide6.QtCore import Qt, QCoreApplication, QEvent
from PySide6.QtCore import Qt, QCoreApplication, QEvent, QTimer
from PySide6.QtTest import QTest
from PySide6.QtWidgets import QApplication, QMessageBox
from pbz_editor import ui
from pbz_editor.core import PBZSContainer, SaveSession, EditorError
from pbz_editor.core import PBZSContainer, SaveSession, EditorError, edit_inventory
from pbz_editor.draft import InventoryDraft
ITEMS = [
@@ -283,6 +283,22 @@ def test_save_commits_mixed_backpack_once_and_preserves_other_slots(opened, monk
assert not opened.pending and not opened.undo_button.isEnabled()
assert '已自动备份' in opened.status.text() and information == []
def answer_save_conflict(monkeypatch, role):
dialogs = []
exec_dialog = ui.QMessageBox.exec
def answer(dialog):
assert dialog.windowTitle() == '存档已更新'
assert dialog.buttonRole(dialog.defaultButton()) == QMessageBox.ButtonRole.RejectRole
button = next(button for button in dialog.buttons() if dialog.buttonRole(button) == role)
dialogs.append(button.text())
QTimer.singleShot(0, button.click)
return exec_dialog(dialog)
monkeypatch.setattr(ui.QMessageBox, 'exec', answer)
return dialogs
@pytest.mark.parametrize('cause', ['running', 'external'])
def test_refused_save_preserves_draft_and_file(opened, monkeypatch, cause):
choose(opened, 'Material')
@@ -290,14 +306,94 @@ def test_refused_save_preserves_draft_and_file(opened, monkeypatch, cause):
session, original = opened.session, opened.session.source
if cause == 'running':
monkeypatch.setattr('pbz_editor.core._game_processes', lambda _: [123])
warnings = []
monkeypatch.setattr(ui.QMessageBox, 'warning', lambda _, title, message: warnings.append(message))
else:
session.save_path.write_bytes(b'external progress')
dialogs = answer_save_conflict(monkeypatch, QMessageBox.ButtonRole.RejectRole)
expected = session.save_path.read_bytes()
opened.apply_save()
wait(opened)
assert session.save_path.read_bytes() == expected and session.source == original
assert opened.pending and opened.apply_button.isEnabled()
assert not session.backup_dir.exists()
if cause == 'running':
assert len(warnings) == 1 and '完全退出游戏到桌面' in warnings[0]
else:
assert dialogs == ['保留当前修改']
def test_reload_changed_save_then_edit_blackstone_from_latest_count(window, session, tmp_path, monkeypatch):
item_id, slot = 'Item_Piece_001', 'ManualSave1'
catalog = tmp_path / 'catalog.json'
item = {'id': item_id, 'category': 'goods', 'name': '黑石碎片'}
catalog.write_text(json.dumps({'items': [item]}), encoding='utf8')
(tmp_path / 'regions.json').write_text(json.dumps({'regions': [
{'id': 'PangZhen', 'name': '庞镇地区'}], 'items': [
{**item, 'regions': ['PangZhen'], 'evidence': [{'source': 'test'}]}]}), encoding='utf8')
def save_with_count(count):
raw = session._entry(slot)['raw']
amended, _ = edit_inventory(raw, [{**item, 'action': 'set', 'quantity': count}])
return session.container.encode(session.entries, {slot: amended})
def open_copy(path, game, oodle):
return SaveSession(path, game, session.container, path.read_bytes(), session.local_dir)
session.save_path.write_bytes(save_with_count(5))
window.load_catalog(catalog)
window.accept_session(open_copy(session.save_path, session.game_dir, None))
window.slot_combo.setCurrentIndex(window.slot_combo.findData(slot))
window.region_filter.setCurrentIndex(window.region_filter.findData('PangZhen'))
assert [i['id'] for i in window.visible_items] == [item_id]
select_bag(window, 'goods', item_id)
assert window.quantity_spin.value() == 5
window.quantity_spin.setValue(6)
latest = save_with_count(7)
session.save_path.write_bytes(latest)
monkeypatch.setattr(SaveSession, 'open', staticmethod(open_copy))
monkeypatch.setattr('pbz_editor.bootstrap.prepare_data', lambda *_: catalog)
window._custom_catalog = False
dialogs = answer_save_conflict(monkeypatch, QMessageBox.ButtonRole.AcceptRole)
window.apply_save()
wait(window)
assert dialogs == ['重新读取存档']
assert window.slot_name() == slot and window.region_filter.currentData() == 'PangZhen'
assert not window.pending and session.save_path.read_bytes() == latest
assert not session.backup_dir.exists()
select_bag(window, 'goods', item_id)
assert window.quantity_spin.value() == 7
window.quantity_spin.setValue(8)
window.apply_save()
wait(window)
saved = session.container.decode(session.save_path.read_bytes())
for old, new in zip(session.container.decode(latest), saved):
if old['name'] != slot:
assert old['block'] == new['block']
else:
assert new['json']['Inventory']['InventoryInfos'][item_id]['CurrentAmount'] == 8
backup, = session.backup_dir.glob('*.sav')
assert backup.read_bytes() == latest and not window.pending
def test_failed_reload_keeps_edits(opened, monkeypatch):
select_bag(opened, 'goods', 'Material')
opened.quantity_spin.setValue(6)
session = opened.session
session.save_path.write_bytes(b'invalid replacement')
def open_copy(path, game, oodle):
return SaveSession(path, game, session.container, path.read_bytes(), session.local_dir)
monkeypatch.setattr(SaveSession, 'open', staticmethod(open_copy))
dialogs = answer_save_conflict(monkeypatch, QMessageBox.ButtonRole.AcceptRole)
opened.apply_save()
wait(opened)
assert dialogs == ['重新读取存档']
assert opened.session is session and opened.pending[0]['quantity'] == 6
assert session.save_path.read_bytes() == b'invalid replacement'
def test_new_medicine_replacement_is_visible_and_undoable(opened):
choose(opened, 'Medicine_Recover')
+75
View File
@@ -0,0 +1,75 @@
"""Render a small, editable sharing card from a public DEMO UI screenshot."""
import base64
import argparse
import os
from pathlib import Path
import sys
os.environ.setdefault('QT_QPA_PLATFORM', 'offscreen')
ROOT = Path(__file__).resolve().parents[1]
sys.path.insert(0, str(ROOT))
from PySide6.QtCore import Qt
from PySide6.QtGui import QImage, QPainter
from PySide6.QtSvg import QSvgRenderer
from PySide6.QtWidgets import QApplication
from pbz_editor.widgets import configure_application
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument('--language', choices=['zh-CN', 'en-US'], default='zh-CN')
args = parser.parse_args()
english = args.language == 'en-US'
copy = {
'headline': 'Get your missing gear back.' if english else '错过的装备,补回来。',
'steps': 'Find → Adjust → Save' if english else '找物品 → 调数值 → 保存',
'languages': 'Chinese / English' if english else '中文 / English',
'backups': 'Auto backups' if english else '自动备份',
'subtitle': 'Offline inventory editor' if english else '影之刃零 · 离线物品编辑器',
'demo': 'DEMO inventory' if english else 'DEMO · 演示数据',
}
# Deliberately no arbitrary screenshot argument: only the reviewed public
# demo screenshot may be embedded, never a current desktop or player save.
source = ROOT/f'docs/screenshots/02-edit.{args.language}.png'
picture = base64.b64encode(source.read_bytes()).decode('ascii')
svg = f'''<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="1280" height="640" viewBox="0 0 1280 640">
<rect width="1280" height="640" fill="#f7f9fc"/>
<rect x="0" y="0" width="1280" height="8" fill="#0f6cbd"/>
<g font-family="Microsoft YaHei">
<text x="60" y="78" fill="#0f6cbd" font-size="16" font-weight="600" letter-spacing="1">OPEN SOURCE · WINDOWS x64</text>
<text x="56" y="166" fill="#17212f" font-size="66" font-weight="700">PBZ Editor</text>
<text x="60" y="234" fill="#17212f" font-size="30" font-weight="600">{copy['headline']}</text>
<text x="60" y="285" fill="#526274" font-size="22">Phantom Blade Zero save editor</text>
<text x="60" y="362" fill="#25384c" font-size="25">{copy['steps']}</text>
<rect x="60" y="401" width="160" height="40" rx="6" fill="#e5f1fb"/>
<text x="73" y="428" fill="#0f6cbd" font-size="17">{copy['languages']}</text>
<rect x="233" y="401" width="132" height="40" rx="6" fill="#edf0f4"/>
<text x="245" y="428" fill="#41556a" font-size="17">{copy['backups']}</text>
<text x="60" y="505" fill="#526274" font-size="18">{copy['subtitle']}</text>
<text x="60" y="566" fill="#526274" font-size="16">github.com/qry6868/PBZ-Editor</text>
<rect x="579" y="95" width="648" height="432" rx="9" fill="#dce3ec"/>
<rect x="575" y="89" width="648" height="432" rx="9" fill="#ffffff" stroke="#d6dfe9"/>
<image x="583" y="97" width="632" height="416" preserveAspectRatio="xMidYMid meet" xlink:href="data:image/png;base64,{picture}"/>
<text x="1222" y="551" text-anchor="end" fill="#65758a" font-size="14">{copy['demo']}</text>
</g></svg>'''
output = ROOT/'docs/promotion'
output.mkdir(parents=True, exist_ok=True)
stem = 'social-preview.en-US' if english else 'social-preview'
(output/(stem+'.svg')).write_bytes(svg.encode('utf8'))
app = QApplication.instance() or QApplication([])
configure_application(app)
renderer = QSvgRenderer(svg.encode('utf8'))
assert renderer.isValid()
image = QImage(1280, 640, QImage.Format.Format_ARGB32)
image.fill(Qt.GlobalColor.white)
painter = QPainter(image)
renderer.render(painter)
painter.end()
path = output/(stem+'.png')
assert image.save(str(path), 'PNG')
assert path.stat().st_size < 1024*1024
print('Sharing card ready: 1280 x 640, below 1 MB, public DEMO data only.')
if __name__ == '__main__':
main()
+2
View File
@@ -27,6 +27,8 @@ PUBLIC_ROOTS = [
'docs/screenshots/01-browse.zh-CN.png', 'docs/screenshots/02-edit.zh-CN.png',
'docs/screenshots/03-saved.zh-CN.png', 'docs/screenshots/01-browse.en-US.png',
'docs/screenshots/02-edit.en-US.png', 'docs/screenshots/03-saved.en-US.png',
'docs/promotion/social-preview.svg', 'docs/promotion/social-preview.png',
'docs/promotion/social-preview.en-US.svg', 'docs/promotion/social-preview.en-US.png',
]