BackpackCapacity
A refork of PI's BackpackCapacity, fixed for PEAK 1.0. Configurable backpack capacity (default 8 slots, min 1, max 100), adjustable in airport.
By Aolion
CHANGELOG
v1.0.2
添加:房主同步背包容量
v1.0.3
修复:增加、减少容量时的bug
v1.0.4
修复:同步时的bug
v1.0.4-fix1 (community patch)
Fixed for PEAK 1.0 final release:
- ItemSlot.prefab / ItemSlot.data are now properties (not public fields) in 1.0; direct field access in DeserializeValue/RefreshVisuals patches was throwing MissingFieldException at runtime, corrupting backpack state (inaccessible backpack, duplicate spawned on equip). Now routed through ItemSlot.SetItem() / get_prefab() / get_data() like vanilla 1.0 does.
- BackpackWheel.InitWheel gained a new
slotCountparameter in 1.0 that vanilla now uses to decide how many wheel slices actually get populated with item data (extra slots beyond the base default were being hidden/deactivated even though the mod had expanded capacity). InitWheelPrefix now overrides this value to match the configured capacity.
Original mod and all core design/functionality by PI (https://thunderstore.io/c/peak/p/PI/). This release is a binary-level compatibility patch only.
v1.0.6-fix2 (community patch)
Fixed a session-persistence bug: OnDestroy() was unconditionally calling harmony.UnpatchSelf(), and Awake() never called DontDestroyOnLoad(). If anything caused this plugin's GameObject to be torn down mid-session (e.g. a scene/map transition), every patch this mod applies silently vanished for the rest of the run - breaking wheel-based quick access (e.g. via EasyBackpack) while leaving the ground-drop storage UI unaffected, since that path doesn't depend on these patches. Awake() now marks the plugin's GameObject persistent, and OnDestroy() no longer strips the patches.
v1.0.7-fix3 (community patch)
- Default capacity config value changed from 6 to 8.
- Wheel slice spacing increased (radius grows 36 units per slot beyond the base 4, up from 26) to reduce icon crowding/overlap at higher capacities.
Note: the default-capacity change only affects a fresh config file. If you've already run this mod, your capacity is saved in BepInEx/config/com.github.hu1hu.BackpackCapacity.cfg - either delete that file to regenerate with the new default, or just use the in-game U/I keybind to set it to 8 directly.
v1.0.8-fix4 (community patch)
Fixed the wheel-expansion logic bleeding into non-backpack items. InitWheelPrefix now checks the backpackType passed to BackpackWheel.InitWheel and only applies the configured capacity to a real Backpack or Fannypack. Jetpack (and Rocketpack) wheels - like the "add fuel" wheel - are left completely untouched, so they no longer show a full set of empty capacity-sized slices around the single real fuel slice.
v1.0.9-fix5 (community patch)
Fannypack now gets its own capacity instead of being treated the same as Backpack: it's given half of the configured capacity (rounded down, minimum 1). E.g. Capacity=16 -> Fannypack gets 8 slots; Capacity=12 -> Fannypack gets 6. Backpack still gets the full configured value. Jetpack and Rocketpack remain untouched (their wheels use the item slot system differently and don't render cleanly with extra slices - see 1.0.8 notes).
v1.0.10-fix6 (community patch)
Jetpack now gets its own slice of the configured capacity too: 1/3 of the configured value (rounded down, minimum 1). E.g. Capacity=12 -> Jetpack gets 4 slots. Backpack still gets full capacity, Fannypack still gets half. Rocketpack remains excluded entirely, as requested.
v1.0.10 polish
Fixed the embedded BepInPlugin version string, which was still hardcoded to "1.0.4" from the original mod despite all the fixes above - BepInEx's load log and any version-checking tools were reporting the wrong version. Now correctly reports 1.0.10.
v1.0.12 (fixes camera/movement lock when interacting with Rocketpack)
Fixed a serious bug: interacting with a Rocketpack could fail to open its wheel and permanently lock camera look and movement, with the only workaround being to open a real Backpack's wheel first. Root cause: BackpackWheel is a single shared UI component reused for every back item type. Our Rocketpack exclusion (added in 1.0.8) skipped resizing the wheel's slice array entirely, but Backpack.Interact() always calls OpenBackpackWheel/InitWheel regardless of type - if the shared slice array hadn't yet been grown by opening a real backpack first, vanilla's own InitWheel would index past the end of it and throw mid-frame, right after the game had already locked player input for the (never-rendered) wheel UI, leaving no way to recover except the lucky workaround. InitWheelPrefix now always ensures the shared slice array is large enough for whatever the current item's own itemSlots.Length is, even for Rocketpack/unrecognized types, without changing that item's actual capacity or slotCount.