Ninja Bear Studio Plugins Help

UI Architecture

The Inventory UI system uses a layered and flexible binding strategy powered by View Models. It separates responsibilities between backend data, logic, and presentation. The system is organized into three main layers:

  • Backend: Entities and events introduced by the Inventory Domain - containers, item instances, default item data, and fragment definitions.

  • View Models: Act as intermediaries that normalize data and react to relevant backend events, so the data can be updated as needed.

  • Widgets: The actual UI elements bound to View Models, which automatically update when data changes.

The diagram below shows how item data flows from the backend to the UI, how View Models are instantiated, and how updates propagate throughout the system.

Inventory User Interface Architecture

Inventory Widget Overview

When designing your Inventory User Interface, we recommend a bottom-up approach: start with the smallest building blocks and work your way up to the full Inventory Window.

  1. Item Tooltip: Displays detailed information about an item. Extends from UNinjaInventoryItemCommonWidget or UNinjaInventoryItemWidget.

  2. Item Drag: Represents an item while it is being dragged (if drag-and-drop is supported). In many setups, you can skip this widget entirely and reuse the Item widget during dragging.

  3. Item: Represents an item within a container. Receives configuration about which Tooltip and Drag widgets to use. Also extends from UNinjaInventoryItemCommonWidget or UNinjaInventoryItemWidget.

  4. Containers: Represents each container (backpack, equipment slots, etc.). Uses a ViewModel extension that links each container to the Item ViewModel used in the Item widget. Extends from UNinjaInventoryContainerCommonWidget or UNinjaInventoryContainerWidget.

  5. Inventory Window: The main window that aggregates all containers. You are free to use any base class for this, as Ninja Inventory does not provide one.

In the next pages, you will ll find more details about:

Last modified: 21 November 2025