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

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...
 
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 RunDefaultInteraction ()
 Runs the item's default 'Use' interactions. This is the first defined 'Standard Interaction' in the item's properties.
 
void RunExamineInteraction ()
 Runs the item's 'Examine' interaction, if one is defined.
 
void 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.
 
void CombineWithItem (int otherItemID)
 Combines the item with another. More...
 
void CombineWithItem (InvItem otherItem)
 Combines the item with another. More...
 
void Select ()
 Selects the item.
 
void ShowInteractionMenus ()
 Shows any Menus with appearType = AppearType.OnInteraction, connected to a the InvItem.
 
string GetFullLabel (int languageNumber=0)
 Gets the items's display name, with prefix. More...
 
int GetNextInteraction (int i, int numInvInteractions)
 Gets the index number of the next relevant use/combine interaction. More...
 
int GetPreviousInteraction (int i, int numInvInteractions)
 Gets the index number of the previous relevant use/combine interaction. More...
 
bool CanBeAnimated ()
 Checks if the item's assigned textures are enough for animated effects to be possible. More...
 
bool HasCursorIcon ()
 If True, the inventory item has a graphic that can be used by the cursor when selected. More...
 
InvVar GetProperty (int ID)
 Gets a property of the inventory item. More...
 
bool CanSelectSingle (int _count=-1)
 Checks if only one instance of the item can be selected, as opposed to all
 
int GetFirstStandardIcon ()
 Gets the ID of the icon that represents the first-available Standard interaction. More...
 
string GetTranslatableString (int index)
 
int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
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 ()
 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 ()
 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...
 
AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. 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
 
int carryOnStartID
 
List< InvVarvars = new List<InvVar>()
 
bool canCarryMultiple
 
int count
 
bool useSeparateSlots
 
bool selectSingle
 
Texture tex
 
Texture activeTex
 
Texture selectedTex
 
GameObject linkedPrefab
 
CursorIcon cursorIcon = new CursorIcon ()
 
int lineID = -1
 
int useIconID = 0
 
int binID
 
int recipeSlot = -1
 
int lastInteractionIndex = 0
 
bool overrideUseSyntax = false
 
HotspotPrefix hotspotPrefix1 = new HotspotPrefix ("Use")
 
HotspotPrefix hotspotPrefix2 = new HotspotPrefix ("on")
 
ActionListAsset useActionList
 
ActionListAsset lookActionList
 
List< InvInteractioninteractions = new List<InvInteraction>()
 
List< ActionListAssetcombineActionList = new List<ActionListAsset>()
 
List< int > combineID = new List<int>()
 
ActionListAsset unhandledActionList
 
ActionListAsset unhandledCombineActionList
 
bool showInFilter
 

Detailed Description

A container class for an Inventory item. Items are defined in InventoryManager, and downloaded to the RuntimeInventory component during gameplay.

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

◆ CanBeAnimated()

bool AC.InvItem.CanBeAnimated ( )

Checks if the item's assigned textures are enough for animated effects to be possible.

Returns
True if the item's assigned textures are enough for animated effects to be possible.

◆ 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

◆ 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.

◆ GetFirstStandardIcon()

int AC.InvItem.GetFirstStandardIcon ( )

Gets the ID of the icon that represents the first-available Standard interaction.

Returns
The ID of the icon that represents the first-available Standard interaction. If no appropriate interaction is found, -1 is returned

◆ GetFullLabel()

string AC.InvItem.GetFullLabel ( int  languageNumber = 0)

Gets the items's display name, with prefix.

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

◆ 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

◆ GetNextInteraction()

int AC.InvItem.GetNextInteraction ( int  i,
int  numInvInteractions 
)

Gets the index number of the next relevant use/combine interaction.

Parameters
iThe index number to start from
numInvInteractionsThe number of relevant "combine" interactions

◆ 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 ( )

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.

Returns
The name of the translatable text's owner.

Implements AC.ITranslatable.

◆ GetPreviousInteraction()

int AC.InvItem.GetPreviousInteraction ( int  i,
int  numInvInteractions 
)

Gets the index number of the previous relevant use/combine interaction.

Parameters
iThe index number to start from
numInvInteractionsThe number of relevant "combine" interactions

◆ GetProperty()

InvVar AC.InvItem.GetProperty ( int  ID)

Gets a property of the inventory item.

Parameters
IDThe ID number of the property to get
Returns
The property of the inventory item

◆ GetTranslatableString()

string AC.InvItem.GetTranslatableString ( int  index)

ITranslatable implementation

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.

◆ HasCursorIcon()

bool AC.InvItem.HasCursorIcon ( )

If True, the inventory item has a graphic that can be used by the cursor when selected.

Returns
True if the inventory item has a graphic that can be used by the cursor when selected.

◆ 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 ( )

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.

Returns
True if the translatable text's owner is a Player.

Implements AC.ITranslatable.

◆ 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.

◆ 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.

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

◆ 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

◆ carryOnStartID

int AC.InvItem.carryOnStartID

The ID number of the Player prefab that carries 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)

◆ combineActionList

List<ActionListAsset> AC.InvItem.combineActionList = new List<ActionListAsset>()

A List of all "Combine" InvInteraction objects associated with the item

◆ combineID

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

A List of InvItem ID numbers associated with the InvInteraction objects in combineActionList

◆ 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" InvInteraction objects associated with the item

◆ label

string AC.InvItem.label

The item's Editor name

◆ lastInteractionIndex

int AC.InvItem.lastInteractionIndex = 0

An identifier number of the last Use/Inventory interaction associated with the item

◆ 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

◆ overrideUseSyntax

bool AC.InvItem.overrideUseSyntax = false

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

◆ recipeSlot

int AC.InvItem.recipeSlot = -1

The index number of the MenuCrafting slot that the item is placed in, when used as a Recipe ingredient

◆ selectedTex

Texture AC.InvItem.selectedTex

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

◆ selectSingle

bool AC.InvItem.selectSingle

If True, and canCarryMultiple = True and useSeparateSlots = False, then only one item will be selectable at a time

◆ 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

◆ 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

◆ useSeparateSlots

bool AC.InvItem.useSeparateSlots

If True, and canCarryMultiple = True, then multiple instances of the same item will be listed in separate MenuInventoryBox slots

◆ vars

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

The item's properties