Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.RuntimeInventory Class Reference
Inheritance diagram for AC.RuntimeInventory:

Public Member Functions

void OnStart ()
 
void AfterLoad ()
 
void SetNull ()
 
void SelectItemByID (int _id, SelectItemMode _mode=SelectItemMode.Use)
 Selects an inventory item (InvItem) by referencing its ID number. More...
 
void ReselectLastItem ()
 Re-selects the last-selected inventory item, if available.
 
void SelectItem (InvItem item, SelectItemMode _mode=SelectItemMode.Use)
 Selects an inventory item (InvItem) More...
 
void UpdateSelectItemModeForMenu (MenuInventoryBox inventoryBox, int slotIndex)
 Updates the item selection mode according to a given item More...
 
void SetSelectItemMode (SelectItemMode _mode)
 Forces the item selection mode
Parameters
_modeThe item selection mode to set

 
bool IsGivingItem ()
 Checks if the currently-selected item is in "give" mode, as opposed to "use". More...
 
void Replace (int _addID, int _removeID, int addAmount=1)
 Replaces one inventory item carried by the player with another, retaining its position in its MenuInventoryBox element. More...
 
void Add (int _id, int amount=1, bool selectAfter=false, int playerID=-1, bool addToFront=false)
 Adds an inventory item to the player's inventory. More...
 
List< InvItemAdd (int _id, int amount, List< InvItem > itemList, bool selectAfter, bool addToFront=false)
 Adds an inventory item to a generic inventory. More...
 
void Remove (int _id, int amount=1, bool setAmount=false, int playerID=-1)
 Removes an inventory item from the player's inventory. More...
 
void Remove (InvItem _item, int amount=0)
 Removes an inventory item from the player's inventory. More...
 
void RemoveAll ()
 Removes all items from the player's inventory
 
void RemoveAllInCategory (int categoryID)
 Removes all items in a given category from the player's inventory More...
 
string GetHotspotPrefixLabel (InvItem item, string itemName, int languageNumber, bool canGive=false)
 Gets the full prefix to a Hotpsot label when an item is selected, e.g. "Use X on " / "Give X to ". More...
 
List< InvItemRemoveEmptySlots (List< InvItem > itemList)
 
string GetLabel (InvItem item, int languageNumber)
 Gets an inventory item's display name. More...
 
int GetCount (int _invID)
 Gets the amount of a particular inventory item within the player's inventory. More...
 
int GetCount (int _invID, int _playerID)
 Gets the amount of a particular inventory item within any player's inventory, if multiple Player prefabs are supported. More...
 
int GetNumberOfItemsCarried ()
 Gets the total number of inventory items currently held by the active Player. More...
 
int GetNumberOfItemsCarried (int _playerID)
 Gets the total number of inventory items currently held by a given Player, if multiple Players are supported. More...
 
int GetNumberOfItemsCarriedInCategory (int categoryID)
 Gets the total number of inventory items currently held by the active Player. More...
 
int GetNumberOfItemsCarriedInCategory (int categoryID, int _playerID)
 Gets the total number of inventory items currently held by a given Player, if multiple Players are supported. More...
 
InvItem GetCraftingItem (int _id)
 Gets an inventory item within the current Recipe being crafted. More...
 
InvItem GetItem (int _id)
 Gets an inventory item within the player's current inventory. More...
 
bool IsCarryingItem (int _id)
 Checks if an inventory item is within the player's current inventory. More...
 
void Look (InvItem item)
 Runs an inventory item's "Examine" interaction. More...
 
void Use (InvItem item)
 Runs an inventory item's "Use" interaction. More...
 
void RunInteraction (InvItem invItem, int iconID)
 Runs an inventory item's interaction, when multiple "use" interactions are defined. More...
 
void RunInteraction (int iconID, InvItem clickedItem=null)
 Runs an interaction on the "hoverItem" inventory item, when multiple "use" interactions are defined. More...
 
void ShowInteractions (InvItem item)
 Sets up all "Interaction" menus according to a specific inventory item. More...
 
void SetHoverItem (InvItem item, MenuInventoryBox menuInventoryBox)
 Sets the item currently being hovered over by the mouse cursor. More...
 
void SetHoverItem (InvItem item, MenuCrafting menuCrafting)
 Sets the item currently being hovered over by the mouse cursor. More...
 
void Combine (InvItem item1, int item2ID)
 Combines two inventory items. More...
 
void Combine (InvItem item1, InvItem item2, bool allowSelfCombining=false)
 Combines two inventory items. More...
 
bool IsItemCarried (InvItem _item)
 Checks if a particular inventory item is currently held by the player. More...
 
void RemoveRecipes ()
 
void TransferCraftingToLocal (int _recipeSlot, bool selectAfter, bool forceAll=false)
 Moves an ingredient from a crafting recipe back into the player's inventory. More...
 
void TransferLocalToCrafting (InvItem _item, int _slot)
 Moves an ingredient from the player's inventory into a crafting recipe as an ingredient. More...
 
List< InvItemMatchInteractions ()
 Gets a list of inventory items associated with the interactions of the current Hotspot or item being hovered over. More...
 
Recipe CalculateRecipe (bool autoCreateMatch)
 Works out which Recipe, if any, for which all ingredients have been correctly arranged. More...
 
void PerformCrafting (Recipe recipe, bool selectAfter)
 Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe. More...
 
void MoveItemToIndex (InvItem item, int index)
 Moves an item already in the current player's inventory to a different slot. More...
 
void AssignPlayerInventory (List< InvItem > newInventory)
 Assign's the player's current inventory in bulk More...
 
List< InvItemMoveItemToIndex (InvItem item, List< InvItem > items, int index)
 Moves an item already in an inventory to a different slot. More...
 
void SetFont (Font font, int size, Color color, TextEffects textEffects)
 Sets the font style of the "amount" numbers displayed over an inventory item in OnGUI menus More...
 
void DrawHighlighted (Rect _rect)
 Draws the currently-highlight item across a set region of the screen. More...
 
void HighlightItemOnInstant (int _id)
 Fully highlights an inventory item instantly. More...
 
void HighlightItemOffInstant ()
 
void HighlightItem (int _id, HighlightType _type)
 Highlights an inventory item. More...
 
void DrawInventoryCount (Vector2 cursorPosition, float cursorSize, int count)
 Draws a number at the cursor position. This should be called within an OnGUI function. More...
 
void ProcessInventoryBoxClick (AC.Menu _menu, MenuInventoryBox inventoryBox, int _slot, MouseState _mouseState)
 Processes the clicking of an inventory item within a MenuInventoryBox element More...
 
int GetTotalIntProperty (int ID)
 Gets the total value of all instances of an Integer inventory property (e.g. currency) within the player's inventory. More...
 
int GetTotalIntProperty (InvItem[] items, int ID)
 Gets the total value of all instances of an Integer inventory property (e.g. currency) within a set of inventory items. More...
 
float GetTotalFloatProperty (int ID)
 Gets the total value of all instances of an Float inventory property (e.g. weight) within the player's inventory. More...
 
float GetTotalFloatProperty (InvItem[] items, int ID)
 Gets the total value of all instances of an Float inventory property (e.g. weight) within a set of inventory items. More...
 
MainData SaveMainData (MainData mainData)
 Updates a MainData class with its own variables that need saving. More...
 
InvVar GetPropertyTotals (int ID)
 
InvItem [] GetItemsInCategory (int categoryID)
 Gets an array of all carried inventory items in a given category More...
 

Public Attributes

List< InvItemcraftingItems = new List<InvItem>()
 
ActionListAsset unhandledCombine
 
ActionListAsset unhandledHotspot
 
ActionListAsset unhandledGive
 
InvItem hoverItem = null
 
InvItem highlightItem = null
 
bool showHoverLabel = true
 
List< int > matchingInvInteractions = new List<int>()
 
InvItem lastClickedItem
 

Properties

InvItem SelectedItem [get]
 
List< InvItemlocalItems [get]
 
InvItem LastSelectedItem [get]
 

Detailed Description

This component is where inventory items (see InvItem) are stored at runtime. When the player aquires an item, it is transferred here (into _localItems) from the InventoryManager asset. It should be placed on the PersistentEngine prefab.

Member Function Documentation

◆ Add() [1/2]

void AC.RuntimeInventory.Add ( int  _id,
int  amount = 1,
bool  selectAfter = false,
int  playerID = -1,
bool  addToFront = false 
)

Adds an inventory item to the player's inventory.

Parameters
_idThe ID number of the inventory item (InvItem) to add
amountThe amount if the inventory item to add, if the InvItem's canCarryMultiple = True
selectAfterIf True, then the inventory item will be automatically selected
playerIDThe ID number of the Player to receive the item, if multiple Player prefabs are supported. If playerID = -1, the current player will receive the item
addToFrontIf True, the new item will be added to the front of the inventory

◆ Add() [2/2]

List<InvItem> AC.RuntimeInventory.Add ( int  _id,
int  amount,
List< InvItem itemList,
bool  selectAfter,
bool  addToFront = false 
)

Adds an inventory item to a generic inventory.

Parameters
_idThe ID number of the inventory item (InvItem) to add
amountThe amount if the inventory item to add, if the InvItem's canCarryMultiple = True
itemListThe list of inventory items to add the new item to
selectAfterIf True, then the inventory item will be automatically selected
addToFrontIf True, the new item will be added to the front of the inventory
Returns
The modified List of inventory items

◆ AfterLoad()

void AC.RuntimeInventory.AfterLoad ( )

Initialises the inventory after a scene change. This is called manually by SaveSystem so that the order is correct.

◆ AssignPlayerInventory()

void AC.RuntimeInventory.AssignPlayerInventory ( List< InvItem newInventory)

Assign's the player's current inventory in bulk

Parameters
newInventoryA list of the InvItem classes that make up the new inventory

◆ CalculateRecipe()

Recipe AC.RuntimeInventory.CalculateRecipe ( bool  autoCreateMatch)

Works out which Recipe, if any, for which all ingredients have been correctly arranged.

Parameters
autoCreateMatchIf True, then any Recipes with autoCreateMatch = False will be ignored
Returns
The Recipe, if any, for which all ingredients have been correctly arranged

◆ Combine() [1/2]

void AC.RuntimeInventory.Combine ( InvItem  item1,
int  item2ID 
)

Combines two inventory items.

Parameters
item1The first inventory item to combine
item2IDThe ID number of the second inventory item to combine

◆ Combine() [2/2]

void AC.RuntimeInventory.Combine ( InvItem  item1,
InvItem  item2,
bool  allowSelfCombining = false 
)

Combines two inventory items.

Parameters
item1The first inventory item to combine
item2IDThe second inventory item to combine
allowSelfCombiningIf True, then an item can be combined with itself

◆ DrawHighlighted()

void AC.RuntimeInventory.DrawHighlighted ( Rect  _rect)

Draws the currently-highlight item across a set region of the screen.

Parameters
_rectThe Screen-Space co-ordinates at which to draw the highlight item

◆ DrawInventoryCount()

void AC.RuntimeInventory.DrawInventoryCount ( Vector2  cursorPosition,
float  cursorSize,
int  count 
)

Draws a number at the cursor position. This should be called within an OnGUI function.

Parameters
cursorPositionThe position of the cursor
cursorSizeThe size to draw the number<param>
Parameters
countThe number to display

◆ GetCount() [1/2]

int AC.RuntimeInventory.GetCount ( int  _invID)

Gets the amount of a particular inventory item within the player's inventory.

Parameters
_invIDThe ID number of the inventory item (InvItem) in question
Returns
The amount of the inventory item within the player's inventory.

◆ GetCount() [2/2]

int AC.RuntimeInventory.GetCount ( int  _invID,
int  _playerID 
)

Gets the amount of a particular inventory item within any player's inventory, if multiple Player prefabs are supported.

Parameters
_invIDThe ID number of the inventory item (InvItem) in question
playerIDThe ID number of the Player to refer to
Returns
The amount of the inventory item within the player's inventory.

◆ GetCraftingItem()

InvItem AC.RuntimeInventory.GetCraftingItem ( int  _id)

Gets an inventory item within the current Recipe being crafted.

<param name "_id">The ID number of the inventory item

Returns
The inventory item, if it is within the current Recipe being crafted

◆ GetHotspotPrefixLabel()

string AC.RuntimeInventory.GetHotspotPrefixLabel ( InvItem  item,
string  itemName,
int  languageNumber,
bool  canGive = false 
)

Gets the full prefix to a Hotpsot label when an item is selected, e.g. "Use X on " / "Give X to ".

Parameters
itemThe inventory item that is selected
itemNameThe display name of the inventory item, in the current language
languageNumberThe index of the current language, as set in SpeechManager
canGiveIf True, the the item is assumed to be in "give" mode, as opposed to "use".
Returns
The full prefix to a Hotspot label when the item is selected

◆ GetItem()

InvItem AC.RuntimeInventory.GetItem ( int  _id)

Gets an inventory item within the player's current inventory.

Parameters
_idThe ID number of the inventory item
Returns
The inventory item, if it is held by the player

◆ GetItemsInCategory()

InvItem [] AC.RuntimeInventory.GetItemsInCategory ( int  categoryID)

Gets an array of all carried inventory items in a given category

Parameters
categoryIDThe ID number of the category in question
Returns
An array of all carried inventory items in the category

◆ GetLabel()

string AC.RuntimeInventory.GetLabel ( InvItem  item,
int  languageNumber 
)

Gets an inventory item's display name.

Parameters
itemThe inventory item to get the display name of
languageNumberThe index of the current language, as set in SpeechManager
Returns
The inventory item's display name

◆ GetNumberOfItemsCarried() [1/2]

int AC.RuntimeInventory.GetNumberOfItemsCarried ( )

Gets the total number of inventory items currently held by the active Player.

Returns
The total number of inventory items currently held by the active Player

◆ GetNumberOfItemsCarried() [2/2]

int AC.RuntimeInventory.GetNumberOfItemsCarried ( int  _playerID)

Gets the total number of inventory items currently held by a given Player, if multiple Players are supported.

Parameters
playerIDThe ID number of the Player to refer to
Returns
The total number of inventory items currently held by the given Player

◆ GetNumberOfItemsCarriedInCategory() [1/2]

int AC.RuntimeInventory.GetNumberOfItemsCarriedInCategory ( int  categoryID)

Gets the total number of inventory items currently held by the active Player.

Parameters
categoryIDIf >=0, then only items placed in the category with that ID will be counted
Returns
The total number of inventory items currently held by the active Player

◆ GetNumberOfItemsCarriedInCategory() [2/2]

int AC.RuntimeInventory.GetNumberOfItemsCarriedInCategory ( int  categoryID,
int  _playerID 
)

Gets the total number of inventory items currently held by a given Player, if multiple Players are supported.

Parameters
categoryIDIf >=0, then only items placed in the category with that ID will be counted
playerIDThe ID number of the Player to refer to
Returns
The total number of inventory items currently held by the given Player

◆ GetTotalFloatProperty() [1/2]

float AC.RuntimeInventory.GetTotalFloatProperty ( int  ID)

Gets the total value of all instances of an Float inventory property (e.g. weight) within the player's inventory.

Parameters
IDThe ID number of the Inventory Float (see InvVar) to get the total value of
Returns
The total value of all instances of the Float inventory property within the player's inventory

◆ GetTotalFloatProperty() [2/2]

float AC.RuntimeInventory.GetTotalFloatProperty ( InvItem []  items,
int  ID 
)

Gets the total value of all instances of an Float inventory property (e.g. weight) within a set of inventory items.

Parameters
itemsThe inventory items to get the total value from
IDThe ID number of the Inventory property (see InvVar) to get the total value of
Returns
The total value of all instances of the Float inventory property within the set of inventory items

◆ GetTotalIntProperty() [1/2]

int AC.RuntimeInventory.GetTotalIntProperty ( int  ID)

Gets the total value of all instances of an Integer inventory property (e.g. currency) within the player's inventory.

Parameters
IDThe ID number of the Inventory property (see InvVar) to get the total value of
Returns
The total value of all instances of the Integer inventory property within the player's inventory

◆ GetTotalIntProperty() [2/2]

int AC.RuntimeInventory.GetTotalIntProperty ( InvItem []  items,
int  ID 
)

Gets the total value of all instances of an Integer inventory property (e.g. currency) within a set of inventory items.

Parameters
itemsThe inventory items to get the total value from
IDThe ID number of the Inventory property (see InvVar) to get the total value of
Returns
The total value of all instances of the Integer inventory property within the set of inventory items

◆ HighlightItem()

void AC.RuntimeInventory.HighlightItem ( int  _id,
HighlightType  _type 
)

Highlights an inventory item.

Parameters
_idThe ID number of the inventory item (see InvItem) to highlight
_typeThe type of highlighting effect to perform (Enable, Disable, PulseOnce, PulseContinuously)

◆ HighlightItemOffInstant()

void AC.RuntimeInventory.HighlightItemOffInstant ( )

Removes all highlighting from the inventory item curently being highlighted.

◆ HighlightItemOnInstant()

void AC.RuntimeInventory.HighlightItemOnInstant ( int  _id)

Fully highlights an inventory item instantly.

Parameters
_idThe ID number of the inventory item (see InvItem) to highlight

◆ IsCarryingItem()

bool AC.RuntimeInventory.IsCarryingItem ( int  _id)

Checks if an inventory item is within the player's current inventory.

Parameters
_idThe ID number of the inventory item
Returns
True if the inventory item is within the player's current inventory

◆ IsGivingItem()

bool AC.RuntimeInventory.IsGivingItem ( )

Checks if the currently-selected item is in "give" mode, as opposed to "use".

Returns
True if the currently-selected item is in "give" mode, as opposed to "use"

◆ IsItemCarried()

bool AC.RuntimeInventory.IsItemCarried ( InvItem  _item)

Checks if a particular inventory item is currently held by the player.

Parameters
_itemThe inventory item to check for
Returns
True if the inventory item is currently held by the player

◆ Look()

void AC.RuntimeInventory.Look ( InvItem  item)

Runs an inventory item's "Examine" interaction.

Parameters
itemThe inventory item to examine

◆ MatchInteractions()

List<InvItem> AC.RuntimeInventory.MatchInteractions ( )

Gets a list of inventory items associated with the interactions of the current Hotspot or item being hovered over.

Returns
A list of inventory items associated with the interactions of the current Hotspot or item being hovered over

◆ MoveItemToIndex() [1/2]

void AC.RuntimeInventory.MoveItemToIndex ( InvItem  item,
int  index 
)

Moves an item already in the current player's inventory to a different slot.

Parameters
itemThe inventory item to move
indexThe index number of the MenuInventoryBox slot to move the item to

◆ MoveItemToIndex() [2/2]

List<InvItem> AC.RuntimeInventory.MoveItemToIndex ( InvItem  item,
List< InvItem items,
int  index 
)

Moves an item already in an inventory to a different slot.

Parameters
itemThe inventory item to move
itemsThe List of inventory items that the item is to be moved within
indexThe index number of the MenuInventoryBox slot to move the item to
Returns
The re-ordered List of inventory items

◆ OnStart()

void AC.RuntimeInventory.OnStart ( )

Transfers any relevant data from InventoryManager when the game begins or restarts.

◆ PerformCrafting()

void AC.RuntimeInventory.PerformCrafting ( Recipe  recipe,
bool  selectAfter 
)

Crafts a new inventory item, and removes the relevent ingredients, according to a Recipe.

Parameters
recipeThe Recipe to perform
selectAfterIf True, then the resulting inventory item will be selected once the crafting is complete

◆ ProcessInventoryBoxClick()

void AC.RuntimeInventory.ProcessInventoryBoxClick ( AC.Menu  _menu,
MenuInventoryBox  inventoryBox,
int  _slot,
MouseState  _mouseState 
)

Processes the clicking of an inventory item within a MenuInventoryBox element

Parameters
_menuThe Menu that contains the MenuInventoryBox element
inventoryBoxThe MenuInventoryBox element that was clicked on
_slotThe index number of the MenuInventoryBox slot that was clicked on
_mouseStateThe state of the mouse when the click occured (Normal, SingleClick, RightClick, DoubleClick, HeldDown, LetGo)

◆ Remove() [1/2]

void AC.RuntimeInventory.Remove ( int  _id,
int  amount = 1,
bool  setAmount = false,
int  playerID = -1 
)

Removes an inventory item from the player's inventory.

Parameters
_idThe ID number of the inventory item (InvItem) to remove
amountThe amount if the inventory item to remove, if the InvItem's canCarryMultiple = True
setAmountIf False, then all instances of the inventory item will be removed, even if the InvItem's canCarryMultiple = True
playerIDThe ID number of the Player to lose the item, if multiple Player prefabs are supported. If playerID = -1, the current player will lose the item

◆ Remove() [2/2]

void AC.RuntimeInventory.Remove ( InvItem  _item,
int  amount = 0 
)

Removes an inventory item from the player's inventory.

Parameters
_itemThe inventory item (InvItem) to remove
amountIf >0, then only that quantity will be removed, if the item's canCarryMultiple property is True

◆ RemoveAllInCategory()

void AC.RuntimeInventory.RemoveAllInCategory ( int  categoryID)

Removes all items in a given category from the player's inventory

Parameters
categoryIDThe ID number of the category

◆ RemoveRecipes()

void AC.RuntimeInventory.RemoveRecipes ( )

Resets any active recipe, and clears all MenuCrafting elements.

◆ Replace()

void AC.RuntimeInventory.Replace ( int  _addID,
int  _removeID,
int  addAmount = 1 
)

Replaces one inventory item carried by the player with another, retaining its position in its MenuInventoryBox element.

Parameters
_addIDThe ID number of the inventory item (InvItem) to add
_removeIDThe ID number of the inventory item (InvItem) to remove
addAmountThe amount if the new inventory item to add, if the InvItem's canCarryMultiple = True

◆ RunInteraction() [1/2]

void AC.RuntimeInventory.RunInteraction ( InvItem  invItem,
int  iconID 
)

Runs an inventory item's interaction, when multiple "use" interactions are defined.

Parameters
invItemThe relevant inventory item
iconIDThe ID number of the interaction's icon, defined in CursorManager

◆ RunInteraction() [2/2]

void AC.RuntimeInventory.RunInteraction ( int  iconID,
InvItem  clickedItem = null 
)

Runs an interaction on the "hoverItem" inventory item, when multiple "use" interactions are defined.

Parameters
iconIDThe ID number of the interaction's icon, defined in CursorManager
clickedItemIf assigned, hoverItem will be become this before the interaction is run

◆ SaveMainData()

MainData AC.RuntimeInventory.SaveMainData ( MainData  mainData)

Updates a MainData class with its own variables that need saving.

Parameters
mainDataThe original MainData class
Returns
The updated MainData class

◆ SelectItem()

void AC.RuntimeInventory.SelectItem ( InvItem  item,
SelectItemMode  _mode = SelectItemMode.Use 
)

Selects an inventory item (InvItem)

Parameters
_idThe inventory item to selet
_modeWhat mode the item is selected in (Use, Give)

◆ SelectItemByID()

void AC.RuntimeInventory.SelectItemByID ( int  _id,
SelectItemMode  _mode = SelectItemMode.Use 
)

Selects an inventory item (InvItem) by referencing its ID number.

Parameters
_idThe inventory item's ID number
_modeWhat mode the item is selected in (Use, Give)

◆ SetFont()

void AC.RuntimeInventory.SetFont ( Font  font,
int  size,
Color  color,
TextEffects  textEffects 
)

Sets the font style of the "amount" numbers displayed over an inventory item in OnGUI menus

Parameters
fontThe font to use<param>
Parameters
sizeThe font's size
colorThe colour to set the font
textEffectsWhat text effect to apply (Outline, Shadow, OutlineAndShadow)

◆ SetHoverItem() [1/2]

void AC.RuntimeInventory.SetHoverItem ( InvItem  item,
MenuInventoryBox  menuInventoryBox 
)

Sets the item currently being hovered over by the mouse cursor.

Parameters
itemThe item to set
menuInventoryBoxThe MenuInventoryBox that the item is displayed within

◆ SetHoverItem() [2/2]

void AC.RuntimeInventory.SetHoverItem ( InvItem  item,
MenuCrafting  menuCrafting 
)

Sets the item currently being hovered over by the mouse cursor.

Parameters
itemThe item to set
menuCraftingThe MenuInventoryBox that the item is displayed within

◆ SetNull()

void AC.RuntimeInventory.SetNull ( )

De-selects the active inventory item.

◆ ShowInteractions()

void AC.RuntimeInventory.ShowInteractions ( InvItem  item)

Sets up all "Interaction" menus according to a specific inventory item.

Parameters
itemThe relevant inventory item

◆ TransferCraftingToLocal()

void AC.RuntimeInventory.TransferCraftingToLocal ( int  _recipeSlot,
bool  selectAfter,
bool  forceAll = false 
)

Moves an ingredient from a crafting recipe back into the player's inventory.

Parameters
_recipeSlotThe index number of the MenuCrafting slot that the ingredient was placed in
selectAfterIf True, the inventory item will be selected once the transfer is complete
forceAllIf True, then all instances of the item will be transferred regardless of the value of its own CanSelectSingle method

◆ TransferLocalToCrafting()

void AC.RuntimeInventory.TransferLocalToCrafting ( InvItem  _item,
int  _slot 
)

Moves an ingredient from the player's inventory into a crafting recipe as an ingredient.

Parameters
_itemThe inventory item to transfer
_slotThe index number of the MenuCrafting slot to place the item in

◆ UpdateSelectItemModeForMenu()

void AC.RuntimeInventory.UpdateSelectItemModeForMenu ( MenuInventoryBox  inventoryBox,
int  slotIndex 
)

Updates the item selection mode according to a given item

Parameters
inventoryBoxThe menu element containing the item
slotIndexThe slot index within the element that the item appears at

◆ Use()

void AC.RuntimeInventory.Use ( InvItem  item)

Runs an inventory item's "Use" interaction.

Parameters
itemThe inventory item to use

Member Data Documentation

◆ craftingItems

List<InvItem> AC.RuntimeInventory.craftingItems = new List<InvItem>()

A List of inventory items (InvItem) being used in the current Recipe being crafted

◆ highlightItem

InvItem AC.RuntimeInventory.highlightItem = null

The inventory item that is currently being highlighted within an MenuInventoryBox element

◆ hoverItem

InvItem AC.RuntimeInventory.hoverItem = null

The inventory item that is currently being hovered over by the cursor

◆ lastClickedItem

InvItem AC.RuntimeInventory.lastClickedItem

The last inventory item that the player clicked on, in any MenuInventoryBox element type

◆ matchingInvInteractions

List<int> AC.RuntimeInventory.matchingInvInteractions = new List<int>()

A List of index numbers within a Button's invButtons List that represent inventory interactions currently available to the player

◆ showHoverLabel

bool AC.RuntimeInventory.showHoverLabel = true

If True, then the Hotspot label will show the name of the inventory item that the mouse is hovering over

◆ unhandledCombine

ActionListAsset AC.RuntimeInventory.unhandledCombine

The default ActionListAsset to run if an inventory combination is unhandled

◆ unhandledGive

ActionListAsset AC.RuntimeInventory.unhandledGive

The default ActionListAsset to run if giving an inventory item to an NPC is unhandled

◆ unhandledHotspot

ActionListAsset AC.RuntimeInventory.unhandledHotspot

The default ActionListAsset to run if using an inventory item on a Hotspot is unhandled

Property Documentation

◆ LastSelectedItem

InvItem AC.RuntimeInventory.LastSelectedItem
get

The last inventory item to be selected. This will return the currently-selected item if one exists

◆ localItems

List<InvItem> AC.RuntimeInventory.localItems
get

A List of inventory items (InvItem) carried by the player

◆ SelectedItem

InvItem AC.RuntimeInventory.SelectedItem
get

The inventory item that is currently selected