Concepts
User Interface
The high-level inventory user interface.
The inventory system's visual presentation is highly customizable and provides developers with a lot of flexibility. As we all know, with great power comes great complexity. Luckily, most of that complexity is abstracted away by a façade. Much of the configuration is provided by resources.
The Inventory System Façade
The GGInventorySystemFacade class offers high-level methods to open and present inventory user interfaces to the player.
This façade is registered as an autoload/singleton and accessible as the GGInventorySystem.
It lets players access inventories in two ways:
- Inventory Browsing: Calling
GGInventorySystem.open_inventory()opens a single inventory. This is most often used for the player to view and manage their own inventory. In lots of games this is mapped to theIorTABkey. - Inventory Transfer: Calling
GGInventorySystem.open_transfer()opens two inventories -- the player's own, and the inventory of another entity to exchange items. It is typically invoked when the player interacts with another object that has an inventory, for example when looting something.
The Dialog Strategy
You may want your user interface to have a very specific look and feel.
How the inventory presents the respective dialogs to the player is determined by its GGInventorySystemDialogStrategy.
Two separate implementations are provided:
GGInventorySystemDialogStrategyDefaultprovides the default modal implementation.GGInventorySystemDialogStrategyUIKitprovides an implementation that leverages the UIKit Addon.
The dialog strategies contain additional configuration, such as how to configure and style the GGInventoryUI using GGInventoryUIConfiguration.
They also handle interfacing with permissions via the GGEntityAccessManager using the GGDialogContextHelper.