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
  • GRID GENERATOR
  • Getters | GridGenerator.cs
  • Functions | GridGenerator.cs
  1. CONTENT
  2. 03. Content
  3. 03.4 INVENTORY

GridGenerator

GridGenerator Handles Generation, Population and Management of all grids in Inventory Pro Manager Add-On, including Inventory + Chests.


GRID GENERATOR

Main

  • inventoryGridData: Stores Initial Slot Data Information & Customization about the Player Inventory.

References

  • inventoryManager: Reference to the InventoryProManager (parent of GridGenerator)

  • hotbarParent: Transform that stores all Hotbar Inventory Slots.

  • buttonParent: Transform that stores all Inventory Slots from the Inventory.

  • chestParent: Transform that stores all Chest Inventory Slots. Chests Grid are created dynamically.

Styling & Customization

  • hotbarPadding: Hotbar Spacing from the Inventory

  • gapX: Horizontal Gap/Spacing between Inventory Slots

  • gapY: Vertical Gap/Spacing between Inventory Slots


Getters | GridGenerator.cs

HotbarParent

ChestParent

InventorySlots

HotbarSlots

ChestSlots

CachedChest

Reference to the current open chest.

_InventoryGridData_SO

Rows

Columns

GapX

GapY

HotbarPadding

Functions | GridGenerator.cs

ClearSlotArea(InventorySlot slot)

Clears the entire Area ( From the anchor as the pivot / Origin ) that a slot occupies based on its item size

GatherBulletsInInventory()

Returns all bullets found in the Inventory

ReduceBulletsInInventory(int amount)

Reduce the specified amount of bullets from the Inventory.

AddItemToInventory(Item_SO item_SO, int amount)

Adds the Given Item to the Inventory. Returns (bool success, int amount): success is true if the entire amount of the item has been successfully added to the Inventory. If success is true, amount equals 0. If success is false, amount will return the amount of Items that were not added to the Inventory

AddWeaponToInventory(Weapon_SO weapon_SO, int bulletsLeftInmagazine, int totalBullets)

Adds the Given Weapon to the Inventory. Returns true if the weapon has been successfully added to the Inventory.

HasEnoughIngredients(Recipe_SO recipe, int craftAmount)

Returns whether the Player has enough ingredients in the Inventory to afford crafting the given recipe and the given amount.

PayIngredients(Recipe_SO recipe, int craftAmount)

Remove all Items (Ingredients) required by the recipe from the Inventory

IsSlotWithinBounds(int row, int col, Vector2Int itemSize, InventorySlot[,] inventorySlots)

Returns true if the slot fits within the given Inventory bounds.

IsChestFull()

Returns whether the current chest is full or not.

IsInventoryFull()

Returns whether the Player Inventory is full or not.

GetRowAndColumnOutOfIndex(int index)

Converts an index into a tuple representing the corresponding row and column in a grid.

PreviousInventoryProManagerNextInventorySlot

Last updated 27 days ago