You are viewing a potentially older version of this package. View all versions.
ckforgame-ExpandedPlayerInventory-1.0.3 icon

ExpandedPlayerInventory

Expands player inventory rows with a built-in scrollbar and mouse-wheel scrolling support.

Date uploaded 3 weeks ago
Version 1.0.3
Download link ckforgame-ExpandedPlayerInventory-1.0.3.zip
Downloads 135
Dependency string ckforgame-ExpandedPlayerInventory-1.0.3

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

README

ExpandedPlayerInventory

A standalone Valheim BepInEx mod that expands player inventory rows (up to 50 rows, default 20) with a built-in scrollbar and mouse-wheel scrolling support.

Features

  • Configurable player inventory rows (4 to 50 rows).
  • Integrated Valheim-themed scrollbar.
  • Mouse scroll wheel and Gamepad navigation support.
  • Fully standalone: can be used with or without ValheimPlus.

Configuration

Configuration file is generated at BepInEx/config/com.custom.expandedplayerinventory.cfg after first launch:

  • playerInventoryRows: Number of player inventory rows (min 4, max 50, default 20).

Compatibility with ValheimPlus

[!IMPORTANT] If you are using ValheimPlus, please ensure inventoryRows in your ValheimPlus configuration (valheim_plus.cfg) is set to 4 (the vanilla default) or leave the [Player] inventory expansion disabled.

Letting ValheimPlus expand inventory rows simultaneously will conflict with this mod's scrollbar positioning and grid layout management. Use ExpandedPlayerInventory's configuration to specify your desired rows instead.

Known Issues & Workaround

[!NOTE] First-Time Inventory Open (Empty Background):

  • Issue: When opening the inventory for the very first time after logging into a world or respawning, the item slots may occasionally not render, showing only the wooden background panel.
  • Temporary Workaround: Simply close (Tab or Esc) and reopen the inventory once. All slots and items will render and scroll normally for the remainder of your session.

Installation

  • Using Mod Manager (r2modman / Thunderstore): Click Install with Mod Manager.
  • Manual Installation:
    1. Install BepInExPack Valheim.
    2. Extract ExpandedPlayerInventory.dll into <GameDirectory>/BepInEx/plugins/.

Changelog

  • v1.0.3: Added known issues and temporary workaround documentation; improved canvas and clipping update handling during inventory opening animation.
  • v1.0.2: Fixed first-time inventory open render bug where slots were displaced off-screen and invisible until reopened.
  • v1.0.1: Initial release with standalone scrolling inventory and ValheimPlus compatibility guidance.

Credits & Special Thanks

  • ValheimPlus: Special thanks to the ValheimPlus project and its contributors for the inspiration and foundational concept of inventory scrolling and grid expansion mechanics.

License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.

CHANGELOG

Changelog

All notable changes to this project will be documented in this file.

[1.2.0] - 2026-09-23

Added

  • Scroll Position Memory:
    • The inventory now remembers its last scroll position across opens and chest interactions instead of abruptly snapping back to the top hotbar every time.
    • Added rememberScrollPosition configuration setting (default true) allowing players to toggle this feature or keep classic top-reset behavior.
  • Dynamic Resolution & UI Scale Auto-Adaptation:
    • Dynamically detects resolution, fullscreen/windowed toggles, and UI Scale adjustments in settings, automatically recalculating base offsets and viewport positioning without restarting the game.
  • Item Safety Net (DropInvalidItems & SetInventorySize Guard):
    • Added defensive guards preventing Valheim's internal Humanoid.DropInvalidItems() and Player.SetInventorySize from mistakenly ejecting or dropping items from rows 5–50 onto the ground during loading or state changes.
  • Robust Fallback Scrollbar Component:
    • Enhanced template scrollbar discovery with multi-tier fallback and programmatic generation to guarantee reliable scrolling even when other mods alter the crafting UI hierarchy.
  • Complete Session State Cleanup:
    • Enhanced session cleanup on Game.Logout, Game.Start, and InventoryGui.Awake to prevent any static state leaks between character switches or world reloads.

[1.1.0] - 2026-09-20

Added

  • Configurable Mouse Wheel Scroll Sensitivity: Added scrollSensitivity setting in ckforgame.ExpandedPlayerInventory.cfg (default 350, range 50–1500).
    • Scrolling is now ~5x faster by default, allowing effortless navigation through large inventories without excessive wheel swiping.
    • Fully adjustable via configuration file or BepInEx Configuration Manager in-game.
  • Valheim Community Standard Plugin GUID & Config: Standardized Mod GUID to ckforgame.ExpandedPlayerInventory and configuration filename to ckforgame.ExpandedPlayerInventory.cfg. Automatically migrates settings from legacy com.custom.expandedplayerinventory.cfg on first run so existing configurations are seamlessly preserved.

Fixed

  • ValheimPlus Mod Conflict & Negative Viewport Bounds: Resolved conflict where ValheimPlus resized the background frame (m_player) to the full configured row count (e.g. 20 rows / 990.5px). Stretch-anchored grids evaluated to a negative viewport height (-566.0px), causing RectMask2D to cull all inventory slots on first open:
    • Added InventoryGui_SetInventorySize_Patch (Priority.First) to clamp background frame sizing to visible rows (maximum 6).
    • Decoupled m_playerGrid and scrollbar from parent stretch anchors to fixed top anchors (anchorMin.y = 1f, anchorMax.y = 1f, pivot.y = 1f), guaranteeing positive viewport height (+424.5px) at all times.
  • Repeated 20-Row Inventory Flashing on Open: Fixed an issue where opening synchronization disabled RectMask2D on every single inventory open, briefly displaying all 20 unclipped rows across the screen for 2-3 frames:
    • Opening synchronization and delayed clipping now strictly run once on the first open of each world session.
    • Subsequent inventory opens in the same world session render instantly, smoothly, and cleanly with 6 rows and scrollbar already in place.
    • Automatically resets session state on Game.Logout, Game.Start, and InventoryGui.Awake.
  • First-Time Open Blank Background Failsafe: Added continuous runtime check in InventoryGui.Update that immediately disables RectMask2D if viewport height is non-positive or tiny, preventing graphics from being culled during canvas layout initialization.

[1.0.4] - 2026-09-19

Fixed

  • First-time inventory open bug (definitive fix): Resolved the root cause where RectMask2D.PerformClipping() was called during the Animator's scale-0 opening transition, causing all inventory slots to be culled as invisible. Clipping is now deferred to the Update loop and only performed after the panel reaches non-zero world-space size.
  • Mod compatibility (ValheimPlus, etc.): Fixed conflict where other mods setting m_scrollbar before us caused ScrollRect and ScrollRectEnsureVisible to never be created. These components are now ensured independently via EnsureScrollRect().
  • Patch execution order: Added [HarmonyPriority(Priority.Low)] on InventoryGui.Show postfix and moved all critical visual state (pivot lock, scroll position, grid update, clipping) into the deferred Update handler so it runs after all other mods' postfixes complete.
  • Layout rebuild before clipping: Added LayoutRebuilder.ForceRebuildLayoutImmediate() to ensure grid content is properly sized before clipping pass.

[1.0.3] - 2026-09-19

Documentation

  • Known Issues & Workaround: Added notice and temporary workaround instructions for first-time open empty background issue.

Changed

  • Opening Animation & Clipping Updates: Added dynamic canvas layout and clipping synchronization during the opening animation in InventoryGui.Update.
  • Pre-warming on Spawn: Pre-initializes inventory grid elements upon player spawn.

[1.0.2] - 2026-09-19

Fixed

  • First-time inventory open bug: Fixed an issue where the inventory appeared completely blank (no item slots) when opened for the first time after loading or spawning into the world.
  • Top-aligned pivot guarantee: Ensured the grid root pivot is locked to top (pivot.y = 1f), preventing Unity ScrollRect from displacing item slots off-screen.
  • Scroll synchronization: Synchronized ScrollRect normalized position and scrollbar value directly upon opening so hotbar slots are always visible.

[1.0.1] - 2026-09-19

Added

  • Integrated native Valheim-styled scrollbar for player inventory.
  • Mouse scroll-wheel support for inventory grid.
  • Gamepad/controller navigation follow support.
  • ValheimPlus compatibility guidelines.

[1.0.0] - 2026-09-19

Added

  • Initial release of ExpandedPlayerInventory.
  • Configurable player inventory rows (min 4, max 50, default 20).
  • Data-layer persistence across game sessions and world saves.