Inventory Pro Add-On Documentation
  • Welcome to Inventory Pro Add-On for FPS Engine!
  • BEFORE WE START
    • Early Considerations
    • Add-On Compatibility
    • List of Tutorials
  • GETTING STARTED
    • 01. Basic Set-Up
    • 02. Roadmap
  • CONTENT
    • 03. Content
      • 03.1 CRAFTING
        • Recipe_SO
          • Ingredient
        • CraftingButton
        • CraftingProcess
        • CraftingUI
        • CraftingBench
        • IngredientUIIcon
      • 03.2 FAV MENU
        • FavItemSlot
        • FavItemsMenu
          • FavItemReference
      • 03.3 INTERACTABLES
        • InventoryItemPickeable
      • 03.4 INVENTORY
        • InventoryGridData_SO
        • InventoryProManager
        • GridGenerator
        • InventorySlot
        • SlotData
        • InventoryProManagerInputActions
      • 03.5 ITEMS
        • AppleItem_SO
        • EnergyDrinkItem_SO
      • 03.6 OTHERS
        • 03.6.1 TRADE HUB
          • TradeButton
          • TradeUI
          • TradeHub
        • Chest
        • ExamineItem
      • 03.7 SHOP
        • PurchasableItem
        • Shop
          • ShopItemData
        • ShopUI
        • ShopButton
      • 03.8 UI TOOLKIT
        • ContextMenu
        • HighlightInteractions
        • Padding
        • TooltipManager
    • 04. Shared Content for Add-Ons
  • HOW TO USE & GUIDES
    • Uninstalling the Add-On: Fixing Errors
    • Creating, Updating & Deleting Recipes
    • Inventory Designer: Creating, Updating & Deleting Inventory Grid Data
    • Working with Crafting Benches
    • Working with Chests
    • Working with Shops
    • Working with Purchasable Items
    • Working with Item Examination
    • Favorite Pinned Items Menu Considerations
    • Inventory, Hotbar & Chests Considerations
    • Tetris Inventory Considerations
    • Weapons & Ammo from the Inventory
    • Custom Item_SOs
    • Adding a New Inventory
  • FAQ
    • FAQ
  • SUPPORT
    • Support
Powered by GitBook
On this page
  • INVENTORY PRO MANAGER
  • Getters | InventoryProManager.cs
  • Functions | InventoryProManager.cs
  1. CONTENT
  2. 03. Content
  3. 03.4 INVENTORY

InventoryProManager

PreviousInventoryGridData_SONextGridGenerator

Last updated 27 days ago

The InventoryProManager is the most essential part of the Inventory System. It manages Inventory Slots, Highlighted Slots, Fav Menus, Grid Generation, Inventory Visibility & much more!

It is highly recommended to begin developing your project from the provided BlankScene, but if you decide to create a new scene from scratch, you´ll need to assign the player to the InteractManager reference from InventoryProManager ( References Tab )


INVENTORY PRO MANAGER

Main

  • inventoryStyle: Defines the style of the Inventory & its behaviour. Grid Slots take 1 space from the Inventory (1x1 Slots only) while Tetris slots can take different sizes ( 2x1, 2x2, 3x1, 3x2, etc... )

  • gridGenerator: Reference to , child of the InventoryProManager.

  • slotRightClickEvent: Defines the behaviour when right clicking on an Inventory Slot.

    • None: Nothing Happens. Right click behaviour is disabled.

    • Drop: The Item will be dropped

    • ContextMenu: Context Menu appears, allowing multiple options ( Recommended )

  • contextMenu: If slotRightClickEvent is set to ContextMenu, this object will be enabled when right clicking on slots, allowing actions and additional functionality.

  • contextMenuOffset: To avoid displaying the ContextMenu exactly where the Mouse is placed, we can add a position offset (horizontal, vertical)

  • useFavouritesRadialMenu: If true, the Player will be able to pin favorite Items in a Radial Menu for Quick Access & usage

  • favItemsMenu: Reference to the , child of InventoryProManager.

  • storeWeaponsIfHotbarFull: If true & the hotbhar is full of weapons: Weapon will be stored in the Inventory. false & the hotbar is full of weapons: Weapon will be swapped in the hotbar for the current weapon.

References

  • interactManager: Player´s InteractManager Reference.

  • tooltipManager: Reference to the Tooltipo Manager.

  • weaponGenericPickeable: Used to Spawn Weapon Pickeables when dropped out of the Inventory.

  • attachmentGenericPickeable: Used to Spawn Attachment Pickeables when dropped out of the Inventory.

  • bulletsGenericPickeable: Used to Spawn Bullets Pickeables when dropped out of the Inventory.

  • itemGenericPickeable: Used to Spawn items Pickeables when dropped out of the Inventory.

  • closeButton: Reference to the Button that closes the Inventory on press. This action is automatically assigned.

  • trashButton: Reference to the Area that deletes Items from the Inventory on drop. This action is automatically assigned.

  • gamepadSpecificUI: UI that appears when using a Gamepad with the Inventory

  • highlightSlotColor: When highlighted, slots will take on a tint of this color.

  • availableSlotColor: When available while dragging a slot, slots will take on a tint of this color.

  • occupiedSlotColor: When occupied while dragging a slot, slots will take on a tint of this color.

  • examinationUI: UI that appears when examining an item. Check ExamineItem.cs for more information.

  • examinationText: Text to display examined name.

Sounds

  • highlightItemSFX: SFX played when hovering an Inventory Slot.

  • rotateItemSFX: SFX Played when rotating the dragged slot ( Only for Tetris Inventory Style )

  • placeItemSFX: SFX Played when placing an Item on the grid.

Navigation & Inputs

  • invInputActions: Contains a Collection of Inputs that can be customized and adjusted specifically for the Inventory System.

Events

  • events


Getters | InventoryProManager.cs

_InteractManager

WeaponGenericPickeable

AttachmentGenericPickeable

BulletsGenericPickeable

ItemGenericPickeable

_InventoryStyle

UseFavouritesRadialMenu

StoreWeaponsIfHotbarFull

AvailableSlotColor

OccupiedSlotColor

_TooltipManager

_GridGenerator

_FavItemsMenu

InventorySlots

ChestSlots

HotbarSlots

TrashButton

ContextMenuClickSFX

_SlotRightClickEvent

IsInventoryOpen

IsFavRadialMenuOpen

Functions | InventoryProManager.cs

HighlightSlot(InventorySlot slot)

Highlights/Selects a slot & enables Visual Indicators.

  • events: InventorySlot to highlight

OpenInventory()

Opens the Inventory & Enables UI

CloseInventory()

Closes the Inventory & Disables UI

DropOutsideInventory(InventorySlot slot)

Removes an Item from the Inventory and Instantiates a Pickeable

  • slot: Slot to remove.

CalculateTotalBullets(bool overrideCurrentBullets)

Re-calculates the available bullets in the inventory that can be used by weapons with limited magazines

  • slot: Overrides current Weapon Magazine with available bullets.

SplitOutsideInventory(InventorySlot slot)

Used by ContextMenu, separates half of the amounf of the passed slot, and drops it outside the Inventory.

  • slot: Slot to split.

Deleteitem(InventorySlot slot)

Deletes an item from the Inventory / Hotbar / Chest

  • slot: Slot to delete.

RotateItem(int rot)

For Tetris Inventories only, rotates an item. 0 & 180 degress are considered as oriented. 90 & 270 are considered not oriented.

  • rot: Rotation of the Slot in multiples of 90 from 0 to 360 ( 360 will be reset to 0 by default )

IsOriented()

Returns whether the currented rotation is oriented or not

SetExaminationUIVisibility(bool visible, string text)

Enables or Disables the Examination UI

  • visible: This boolean controls the visibility state of the Examination UI

  • text: Name of the examined Item

ResetHighlightedSlotsArea(Color defaultBackgroundColor, bool clearCurrentReferences)

Resets highlighted area ( Whether available or occupied ) to the default background color.

  • defaultBackgroundColor: Color to assign to the InventorySlots Background

  • clearCurrentReferences: If true, clears the highlighted slots list.

ReassignSlots(InventorySlot slot)

Helper function to reassign the slots for an item occupying multiple slots. Used by Tetris Inventories.

  • slot: Slot to reassign.

IsValidPosition(InventorySlot targetSlot, Vector2Int itemSize)

In a Tetris Inventory, when trying to occupy some slots from the anchor, we first need to check if the Item fits in the target slot, based on the item size, to avoid Grid overflow errors.

  • targetSlot: Inventory Slot at which the anchor slot will be placed

  • itemSize: Item Size of the Item to place at targetSlot

IsSlotOccupied(InventorySlot anchor)

Returns whether a slot is occupied or not. An item is occupied if it has a valid Anchor or Item assigned.

  • anchor: Ensure to pass the Anchor of the Slot you want to check if it´s occupied.

SetSlotsColors(Color color)

Overrides the background color of all slots inside highlightedSlotArea

  • color: Color to tint the background of the slots

contextMenuClickSFX: SFX Played when clicking on Buttons.

GridGenerator
FavItemsMenu
ContextMenu