Adventure Creator  1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
AC.InvItem Class Reference
Inheritance diagram for AC.InvItem:
AC.ITranslatable AC.IItemReferencer

Public Member Functions

 InvItem (int[] idArray)
 The default Constructor. More...
 
 InvItem (int _id)
 A Constructor in which the id is explicitly set. More...
 
 InvItem (InvItem assetItem)
 A Constructor that sets all its values by copying another InvItem. More...
 
void ShowGUI (string apiPrefix)
 
void RebuildProperties ()
 
bool ReferencesAsset (ActionListAsset actionListAsset)
 
int GetNumItemReferences (int _itemID)
 
int UpdateItemReferences (int oldItemID, int newItemID)
 
void Upgrade ()
 
bool DoesHaveInventoryInteraction (InvItem invItem)
 Checks if the item has an InvInteraction combine interaction for a specific InvItem. More...
 
string GetLabel (int languageNumber)
 Gets the item's display name. More...
 
void RunUseInteraction (int iconID=-1)
 Runs one of the item's 'Use' interactions. More...
 
void RunExamineInteraction ()
 
void CombineWithSelf ()
 
void CombineWithItem (int otherItemID)
 Combines the item with another. More...
 
void CombineWithItem (InvItem otherItem)
 Combines the item with another. More...
 
void Select ()
 
void ShowInteractionMenus ()
 
void ShowInteractionMenu (Menu menu, bool includeInventoryItems)
 Turns on a specific Menu, linking any Interaction icons in it to the Inventory item. The Menu doesn't need to have an appearType of AppearType.OnInteraction. More...
 
InvVar GetProperty (int ID)
 Gets a property of the inventory item. More...
 
override string ToString ()
 
string GetTranslatableString (int index)
 Gets the text to be translated, given its index. More...
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. More...
 
void UpdateTranslatableString (int index, string updatedText)
 
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts. More...
 
bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index More...
 
string GetOwner (int index)
 Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More...
 
bool OwnerIsPlayer (int index)
 Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More...
 
bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 

Public Attributes

string label
 
int id
 
string altLabel
 
bool carryOnStart
 
bool carryOnStartNotDefault
 
List< int > carryOnStartIDs = new List<int>()
 
List< InvVarvars = new List<InvVar>()
 
bool canCarryMultiple
 
int count
 
bool canBeLowerCase = false
 
int maxCount = 999
 
ItemStackingMode itemStackingMode = ItemStackingMode.All
 
Texture tex
 
Texture activeTex
 
Texture selectedTex
 
GameObject linkedPrefab
 
CursorIcon cursorIcon = new CursorIcon ()
 
int lineID = -1
 
int useIconID = 0
 
int binID
 
bool overrideUseSyntax = false
 
HotspotPrefix hotspotPrefix1 = new HotspotPrefix ("Use")
 
HotspotPrefix hotspotPrefix2 = new HotspotPrefix ("on")
 
ActionListAsset useActionList
 
ActionListAsset lookActionList
 
List< InvInteractioninteractions = new List<InvInteraction>()
 
List< InvCombineInteractioncombineInteractions = new List<InvCombineInteraction>()
 
ActionListAsset unhandledActionList
 
ActionListAsset unhandledGiveActionList
 
ActionListAsset unhandledCombineActionList
 
bool showInFilter
 

Properties

string EditorLabel [get]
 

Detailed Description

A data class for an Inventory item. Items are stored in InventoryManager, and referenced in InvInstance classes when added to the Player's inventory at runtime.

Constructor & Destructor Documentation

◆ InvItem() [1/3]

AC.InvItem.InvItem ( int[]  idArray)

The default Constructor.

Parameters
idArrayAn array of already-used ID numbers, so that a unique ID number can be assigned

◆ InvItem() [2/3]

AC.InvItem.InvItem ( int  _id)

A Constructor in which the id is explicitly set.

Parameters
_idThe ID number to assign

◆ InvItem() [3/3]

AC.InvItem.InvItem ( InvItem  assetItem)

A Constructor that sets all its values by copying another InvItem.

Parameters
assetItemThe InvItem to copy

Member Function Documentation

◆ CanTranslate()

bool AC.InvItem.CanTranslate ( int  index)

Checks if a given text index can and should be translated.

Parameters
indexThe index of the translatable text
Returns
True if the text can and should be translated

Implements AC.ITranslatable.

◆ CombineWithItem() [1/2]

void AC.InvItem.CombineWithItem ( int  otherItemID)

Combines the item with another.

Parameters
otherItemIDThe ID number of the inventory item to combine with

◆ CombineWithItem() [2/2]

void AC.InvItem.CombineWithItem ( InvItem  otherItem)

Combines the item with another.

Parameters
otherItemThe inventory item to combine with

◆ CombineWithSelf()

void AC.InvItem.CombineWithSelf ( )

Combines the item with itself. This is normally only available when combining items via Hotspot-based InventoryBox elements, but this allows it to be enforced.

◆ DoesHaveInventoryInteraction()

bool AC.InvItem.DoesHaveInventoryInteraction ( InvItem  invItem)

Checks if the item has an InvInteraction combine interaction for a specific InvItem.

Parameters
invItemThe InvITem to check for
Returns
True if the item has an InvInteraction combine interaction for the InvItem.

◆ GetLabel()

string AC.InvItem.GetLabel ( int  languageNumber)

Gets the item's display name.

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

◆ GetNumTranslatables()

int AC.InvItem.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.InvItem.GetOwner ( int  index)

Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.

Parameters
indexThe index of the translatable text
Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetProperty()

InvVar AC.InvItem.GetProperty ( int  ID)

Gets a property of the inventory item.

Parameters
IDThe ID number of the property to get
multiplyByItemCountIf True, then the property's integer/float value will be multipled by the item's count
Returns
The property of the inventory item

◆ GetTranslatableString()

string AC.InvItem.GetTranslatableString ( int  index)

Gets the text to be translated, given its index.

Parameters
indexThe index of the translatable text
Returns
The text to be translated

Implements AC.ITranslatable.

◆ GetTranslationID()

int AC.InvItem.GetTranslationID ( int  index)

Gets the translation ID of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation ID of the text

Implements AC.ITranslatable.

◆ GetTranslationType()

AC_TextType AC.InvItem.GetTranslationType ( int  index)

Gets the translation type of a given text index.

Parameters
indexThe index of the translatable text
Returns
The translation type of a given text index.

Implements AC.ITranslatable.

◆ HasExistingTranslation()

bool AC.InvItem.HasExistingTranslation ( int  index)

Checks if a given text index has already been assigned a unique translation ID.

Parameters
indexThe index of the translatable text
Returns
True if the text has been assigned a unique translation ID

Implements AC.ITranslatable.

◆ OwnerIsPlayer()

bool AC.InvItem.OwnerIsPlayer ( int  index)

Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.

Parameters
indexThe index of the translatable text
Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ RunExamineInteraction()

void AC.InvItem.RunExamineInteraction ( )

Runs the item's 'Examine' interaction, if one is defined.

◆ RunUseInteraction()

void AC.InvItem.RunUseInteraction ( int  iconID = -1)

Runs one of the item's 'Use' interactions.

Parameters
iconIDThe ID number of the CursorIcon associated with the use interaction. If no number is supplied, the default use interaction will be run.

◆ Select()

void AC.InvItem.Select ( )

Selects the item.

◆ SetTranslationID()

void AC.InvItem.SetTranslationID ( int  index,
int  lineID 
)

Sets the translation ID of a given text index

Parameters
indexThe index of the translatable text
lineIDThe new translation ID to assign the translatable text

Implements AC.ITranslatable.

◆ ShowInteractionMenu()

void AC.InvItem.ShowInteractionMenu ( Menu  menu,
bool  includeInventoryItems 
)

Turns on a specific Menu, linking any Interaction icons in it to the Inventory item. The Menu doesn't need to have an appearType of AppearType.OnInteraction.

Parameters
menuThe Menu to turn on
includeInventoryItemsIf True, and supported, then other inventory items associcated with the item's interactions will be included as well

◆ ShowInteractionMenus()

void AC.InvItem.ShowInteractionMenus ( )

Shows any Menus with appearType = AppearType.OnInteraction, connected to a the InvItem.

◆ Upgrade()

void AC.InvItem.Upgrade ( )

Upgrades the item from a previous version of AC

Member Data Documentation

◆ activeTex

Texture AC.InvItem.activeTex

The item's 'highlighted' graphic

◆ altLabel

string AC.InvItem.altLabel

The item's in-game name, if not label

◆ binID

int AC.InvItem.binID

The ID number of the item's InvBin category, as defined in InventoryManager

◆ canBeLowerCase

bool AC.InvItem.canBeLowerCase = false

If True, the item's label will be lower-cased when placed in the middle of a Hotspot label if it is not at the start.

◆ canCarryMultiple

bool AC.InvItem.canCarryMultiple

If True, then multiple instances of the item can be carried at once

◆ carryOnStart

bool AC.InvItem.carryOnStart

If True, the Player carries the item when the game begins

◆ carryOnStartIDs

List<int> AC.InvItem.carryOnStartIDs = new List<int>()

The ID numbers of the Player prefabs that carry the item when the game begins, if carryOnStartNotDefault = True

◆ carryOnStartNotDefault

bool AC.InvItem.carryOnStartNotDefault

If True, then a Player prefab that is not the default carries the item when the game begins (if playerSwitching = PlayerSwitching.Allow in SettingsManager)

◆ combineInteractions

List<InvCombineInteraction> AC.InvItem.combineInteractions = new List<InvCombineInteraction>()

A list of all "Combine" interactions associated witht the item

◆ count

int AC.InvItem.count

The number of instances being carried, if canCarryMultiple = True

◆ cursorIcon

CursorIcon AC.InvItem.cursorIcon = new CursorIcon ()

A CursorIcon instance that, if assigned, will be used in place of the 'tex' Texture when the item is selected on the cursor

◆ hotspotPrefix1

HotspotPrefix AC.InvItem.hotspotPrefix1 = new HotspotPrefix ("Use")

The "Use" in "Use X on Y", if overrideUseSyntax = True

◆ hotspotPrefix2

HotspotPrefix AC.InvItem.hotspotPrefix2 = new HotspotPrefix ("on")

The "on" on "Use X on Y", if overrideUseSyntax = True

◆ id

int AC.InvItem.id

A unique identifier

◆ interactions

List<InvInteraction> AC.InvItem.interactions = new List<InvInteraction>()

A List of all "Use" interactions associated with the item

◆ itemStackingMode

ItemStackingMode AC.InvItem.itemStackingMode = ItemStackingMode.All

How to select items when multiple are in a given slot

◆ label

string AC.InvItem.label

The item's Editor name

◆ lineID

int AC.InvItem.lineID = -1

The translation ID number of the item's name, as generated by SpeechManager

◆ linkedPrefab

GameObject AC.InvItem.linkedPrefab

A GameObject that can be associated with the item, for the creation of e.g. 3D inventory items (through scripting only)

◆ lookActionList

ActionListAsset AC.InvItem.lookActionList

The ActionListAsset to run when the item is examined, if multiple interactions are disallowed

◆ maxCount

int AC.InvItem.maxCount = 999

The maximum amount that can be held in a single slot

◆ overrideUseSyntax

bool AC.InvItem.overrideUseSyntax = false

If True, then the item has its own "Use X on Y" syntax when selected

◆ selectedTex

Texture AC.InvItem.selectedTex

The item's 'selected' graphic (if SettingsManager's selectInventoryDisplay = SelectInventoryDisplay.ShowSelectedGraphic)

◆ tex

Texture AC.InvItem.tex

The item's main graphic

◆ unhandledActionList

ActionListAsset AC.InvItem.unhandledActionList

The ActionListAsset to run when using the item on a Hotspot is unhandled

◆ unhandledCombineActionList

ActionListAsset AC.InvItem.unhandledCombineActionList

The ActionListAsset to run when using the item on another InvItem is unhandled

◆ unhandledGiveActionList

ActionListAsset AC.InvItem.unhandledGiveActionList

The ActionListAsset to run when giving the item to an NPC is unhandled

◆ useActionList

ActionListAsset AC.InvItem.useActionList

The ActionListAsset to run when the item is used, if multiple interactions are disallowed

◆ useIconID

int AC.InvItem.useIconID = 0

The ID number of the CursorIcon (in CursorManager's cursorIcons List) to show when hovering over the item if appropriate

◆ vars

List<InvVar> AC.InvItem.vars = new List<InvVar>()

The item's properties