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

Public Member Functions

 InvVar (int[] idArray)
 
 InvVar ()
 
 InvVar (InvVar assetVar)
 
void TransferValues (InvVar invVar)
 Updates the 'value' variables specific to an inventory item based on another InvVar instance. More...
 
string GetDisplayValue (int languageNumber=0)
 Gets the property's value as a string. More...
 
override string GetTranslatableString (int index)
 
override int GetTranslationID (int index)
 Gets the translation ID of a given text index. More...
 
override bool HasExistingTranslation (int index)
 Checks if a given text index has already been assigned a unique translation ID. More...
 
override void SetTranslationID (int index, int _lineID)
 Sets the translation ID of a given text index More...
 
override AC_TextType GetTranslationType (int index)
 Gets the translation type of a given text index. More...
 
override bool CanTranslate (int index)
 Checks if a given text index can and should be translated. More...
 
- Public Member Functions inherited from AC.GVar
 GVar (int[] idArray)
 
 GVar (GVar assetVar)
 
int AssignUniqueID (int[] idArray)
 Sets the internal ID to a unique number based on an array of previously-used values More...
 
void Download (VariableLocation _location=VariableLocation.Global, Variables _variables=null)
 Sets its value to that of its linked variable (if appropriate). More...
 
void Upload (VariableLocation _location=VariableLocation.Global, Variables _variables=null)
 Sets the value of its linked variable to its value (if appropriate). More...
 
void BackupValue ()
 
void RestoreBackupValue ()
 
void SetStringValue (string newValue, int newLineID=-1)
 Sets the value if its type is String. More...
 
void SetFloatValue (float newValue, SetVarMethod setVarMethod=SetVarMethod.SetValue)
 Sets the value if its type is Float. More...
 
void SetVector3Value (Vector3 newValue)
 Sets the value if its type is Vector3. More...
 
void SetValue (int newValue, SetVarMethod setVarMethod=SetVarMethod.SetValue)
 Sets the value if its type is Integer, Boolean or PopUp. More...
 
void CreateRuntimeTranslations ()
 Transfers translation data from RuntimeLanguages to the variable itself. This allows it to be transferred to other variables with the 'Variable: Copy' Action.
 
string [] GetTranslations ()
 Gets the variable's translations, if they exist. More...
 
void CopyFromVariable (GVar oldVar, VariableLocation oldLocation)
 Copies the value of another variable onto itself. More...
 
string GetValue (int languageNumber=0)
 Returns the variable's value. More...
 
string GetPopUpsString ()
 Gets all possible PopUp values as a single string, where the values are separated by a ']' character. More...
 
bool HasTranslations ()
 Checks if the Variable is translatable. More...
 
bool IsGlobalVariable ()
 Checks if this Variable is defined under the Variable Manager's list of Global Variables More...
 
int GetNumTranslatables ()
 Gets the maximum number of possible translatable texts. 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...
 
string [] GenerateEditorPopUpLabels ()
 

Public Attributes

bool limitToCategories = false
 
List< int > categoryIDs = new List<int>()
 
- Public Attributes inherited from AC.GVar
string label
 
int id
 
VariableType type
 
int val
 
float floatVal
 
string textVal
 
string [] popUps
 
Vector3 vector3Val
 
VarLink link = VarLink.None
 
string pmVar
 
bool updateLinkOnStart = false
 
bool canTranslate = true
 
int textValLineID = -1
 
int popUpsLineID = -1
 
string description = ""
 
bool showInFilter
 

Additional Inherited Members

- Properties inherited from AC.GVar
int IntegerValue [get, set]
 
bool BooleanValue [get, set]
 
float FloatValue [get, set]
 
string TextValue [get, set]
 
Vector3 Vector3Value [get, set]
 

Detailed Description

A data class for inventory properties. Properties are created in the Inventory Manager asset file, and stored in each instance of InvItem class. Inventory items held by the player during gameplay are stored in the localItems List within RuntimeInventory.

Constructor & Destructor Documentation

◆ InvVar() [1/3]

AC.InvVar.InvVar ( int []  idArray)

The main Constructor. An array of ID numbers is required, to ensure its own ID is unique.

◆ InvVar() [2/3]

AC.InvVar.InvVar ( )

A blank Constructor.

◆ InvVar() [3/3]

AC.InvVar.InvVar ( InvVar  assetVar)

A Constructor that copies all values from another variable. This way ensures that no connection remains to the asset file.

Member Function Documentation

◆ CanTranslate()

override bool AC.InvVar.CanTranslate ( int  index)
virtual

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

Reimplemented from AC.GVar.

◆ GetDisplayValue()

string AC.InvVar.GetDisplayValue ( int  languageNumber = 0)

Gets the property's value as a string.

Parameters
languageNumberThe index number of the game's current language (0 = original)
Returns
The property's value as a string

◆ GetTranslatableString()

override string AC.InvVar.GetTranslatableString ( int  index)
virtual

ITranslatable implementation

Reimplemented from AC.GVar.

◆ GetTranslationID()

override int AC.InvVar.GetTranslationID ( int  index)
virtual

Gets the translation ID of a given text index.

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

Reimplemented from AC.GVar.

◆ GetTranslationType()

override AC_TextType AC.InvVar.GetTranslationType ( int  index)
virtual

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.

Reimplemented from AC.GVar.

◆ HasExistingTranslation()

override bool AC.InvVar.HasExistingTranslation ( int  index)
virtual

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

Reimplemented from AC.GVar.

◆ SetTranslationID()

override void AC.InvVar.SetTranslationID ( int  index,
int  lineID 
)
virtual

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

Reimplemented from AC.GVar.

◆ TransferValues()

void AC.InvVar.TransferValues ( InvVar  invVar)

Updates the 'value' variables specific to an inventory item based on another InvVar instance.

Parameters
invVarThe other InvVar to copy 'value' variables from

Member Data Documentation

◆ categoryIDs

List<int> AC.InvVar.categoryIDs = new List<int>()

A List of category IDs that the property belongs to, if limitToCategories = True. Categories are stored within InventoryManager's bins variable

◆ limitToCategories

bool AC.InvVar.limitToCategories = false

If True, then the property will be limited to inventory items within certain categories