商店内不出售装备

商店内不出售装备

保持商人交易窗口整洁——你出售的白色/蓝色/金色装备不再出现在商店的购买列表中。遗物与猎魔人套装物品仍会显示,以免你误售珍品。

No Sold Equipment In Shops

让商人交易窗口保持整洁——你卖出的白/蓝/金品质装备不再出现在商店的购买列表中。

适配 The Witcher 3: Wild Hunt — Remastered (Next-Gen) · Patch 5.01

About this mod / 关于本 Mod

EN: Tired of your sold junk cluttering every merchant's inventory? This mod hides the equipment you sell — Common (white), Masterwork (blue) and Magic (gold) quality — from the merchant's trade window, so the buy list stays short and easy to scan. Only weapons and armor are affected. Food, crafting materials, books, diagrams, junk and everything else remain exactly as vanilla.

中文: 受够了卖出去的垃圾装备堆满每个商人库存?本 Mod 会将你售出的 普通(白)、精制(蓝)、魔法(金) 品质装备从商人交易窗口中隐藏,使购买列表保持精简。仅影响 武器与护甲,食物、材料、书籍、图纸等一切照旧,与原版一致。

Features / 功能特点

  • EN: Hides sold equipment of quality 1 (Common/white), 2 (Masterwork/blue) and 3 (Magic/gold) from the buy list.
  • 中文: 将 品质 1(普通/白)、2(精制/蓝)、3(魔法/金) 的已售装备从购买列表隐藏。
  • EN: Relic (orange) and Witcher Set (green) items are protected — a single misclick won't delete your precious gear.
  • 中文: 遗物(橙)与猎魔人套装(绿)自动受保护 —— 一次误点不会损失珍贵装备。
  • EN: Only weapons & armor are handled; everything else is untouched.
  • 中文: 仅处理武器与护甲,其余物品一律不动。
  • EN: The merchant's original stock is never affected — only what you sold gets filtered.
  • 中文: 商人原有库存完全不受影响,只有"你卖出的"才会被过滤。
  • EN: Built from the game's own official 5.01 scripts (minimal diff). No config menu needed.
  • 中文: 以游戏自带官方 5.01 脚本为底稿重制(改动最小化),无需配置菜单,放入即用。

Quality & Color reference / 品质与颜色对照

(取自游戏自身代码,非猜测 / taken from the game's own code)

Value 品质值 Type 类型 Color 颜色 Behavior 处理
1 Common 普通 White 白 Hidden 隐藏
2 Masterwork 精制 Blue 蓝 Hidden 隐藏
3 Magic 魔法 Gold 金 Hidden 隐藏
4 Relic 遗物 Orange 橙 Kept 保留(防误删)
5 Witcher Set 猎魔人套装 Green 绿 Kept 保留(防误删)

How it works / 工作原理

EN: This mod uses a two-layer mechanism — both layers ride on the game's own shop-list pipeline, so it stays reliable across Remastered builds.

  • Layer 1 — UI layer: game\gui\_old\components\guiShopInventoryComponent.ws — rewrites ShouldShowItem(). A snapshot of the merchant's stock is taken when the trade window is built; any weapon/armor appearing after that snapshot with quality 1–3 is filtered out. Only what you sell gets hidden.
  • Layer 2 — Data layer: game\gui\menus\inventoryMenu.ws — on a successful sale the item is physically removed from the merchant's inventory (RemoveItem), then UpdateShop() rebuilds the shop grid instantly (exactly what the game itself calls after a trade). The item is gone at once and won't reappear after closing/reopening the shop or reloading a save.

Two layers stack: if one ever fails in a different environment, the other still covers it.

中文: 本 Mod 采用 双层机制,两层都走游戏自身的商店列表流程,因此在重制版各构建上都能稳定工作。

  • 第 1 层 — 界面层: game\gui\_old\components\guiShopInventoryComponent.ws —— 重写 ShouldShowItem()。构建交易窗口时先对商人库存拍快照;之后出现的武器/护甲且品质 1–3 的都被过滤。只有你卖出的东西会被隐藏。
  • 第 2 层 — 数据层: game\gui\menus\inventoryMenu.ws —— 卖出成功后把装备从商人库存物理删除(RemoveItem),随即调用 UpdateShop() 立即重建商店网格(游戏自身买卖后就是这么做)。物品当场消失,关闭/重开商店或读档后也不会再出现。

两层叠加:即使某一层在其它环境下失效,另一层仍能兜底。

Requirements / 前置要求

  • EN: The Witcher 3: Wild Hunt — Remastered / Next-Gen, Patch 5.01. No DLC or other mods required. Not tested on 4.x (Classic) — intended for 5.01 only.
  • 中文: 《巫师3:狂猎》重制版 / 次世代版,5.01 补丁。无需 DLC 或其它 Mod。未在 4.x(经典版)测试,仅面向 5.01。

Installation / 安装

EN: 1) Extract the archive. 2) Put the whole modNoSoldEquipmentInShops folder into ...\The Witcher 3\mods\ (create the folder if it doesn't exist). 3) Launch the game.

中文: 1) 解压压缩包。2) 把整个 modNoSoldEquipmentInShops 文件夹放进 ...\The Witcher 3\mods\(没有就新建)。3) 启动游戏即生效。

Uninstallation / 卸载

EN: Delete mods\modNoSoldEquipmentInShops. Items already removed won't come back; only items sold afterwards behave normally again.

中文: 删掉 mods\modNoSoldEquipmentInShops 即可。已被移除的装备不会自动回来;卸载后新卖出的才恢复正常。

Compatibility / 兼容性

EN: Edits guiShopInventoryComponent.ws and inventoryMenu.ws. If another mod modifies the same files, run Witcher Script Merger.

中文: 修改 guiShopInventoryComponent.ws 与 inventoryMenu.ws。若其它 Mod 也改了这两个文件,请用 Witcher Script Merger 合并。

Configuration / 自定义

EN: To also hide Relic (orange) & Witcher Set (green), search MOD NoSoldEquipmentInShops in both files: change quality <= 3 → quality <= 5 (guiShopInventoryComponent.ws) and quality > 3 → quality > 5 (inventoryMenu.ws). Edit both.

中文: 想连橙 / 绿一起隐藏:两个文件里搜索 MOD NoSoldEquipmentInShops,把 quality <= 3 改为 quality <= 5(guiShopInventoryComponent.ws),把 quality > 3 改为 quality > 5(inventoryMenu.ws)。两处都要改。

Known issues / 已知问题

  • EN: Removed equipment is permanently gone and cannot be bought back. Relic & Witcher-Set items are protected by default.
  • 中文: 被移除的装备永久消失、无法买回;橙 / 绿装备默认受保护。
  • EN: No change in-game? Make sure you're on 5.01 and check for script conflicts.
  • 中文: 未见变化?请确认 5.01 补丁,并检查脚本冲突。

Changelog / 更新日志

  • v2 — Reworked to a two-layer mechanism (UI snapshot filter + remove & UpdateShop()). Fixes v1 where the shop grid wasn't refreshed and the mod appeared to do nothing. / 改为双层机制,修复 v1 未刷新商店网格、看似无效的问题。
  • v1 — Initial release. / 初版。

Credits / 致谢

EN: No third-party assets. Scripts derived from CD Projekt Red's official 5.01 scripts.

中文: 无第三方素材,脚本基于 CD Projekt Red 官方 5.01 脚本改写。