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

Public Member Functions

 Document (int[] idArray)
 The default Constructor. More...
 
 Document (int _ID)
 A Constructor in which the ID is explicitly set. More...
 
string GetPageText (int pageIndex, int languageNumber=0)
 Gets the text of a given page More...
 
string GetTitleText (int languageNumber=0)
 Gets the Document's title More...
 
void ClearIDs ()
 
void ShowGUI (string apiPrefix, List< InvBin > bins, float windowWidth)
 
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

int ID
 
string title
 
int titleLineID = -1
 
bool rememberLastOpenPage = false
 
bool carryOnStart = false
 
Texture2D texture
 
List< JournalPagepages = new List<JournalPage>()
 
int binID = 0
 

Protected Member Functions

int GetBinSlot (List< InvBin > bins, int _id)
 
void SidePageMenu ()
 
void PageCallback (object obj)
 
void MovePageToTop (int a1)
 
void MovePageToBottom (int a1)
 
void SwapPages (int a1, int a2)
 

Protected Attributes

int sidePage
 
int selectedPage
 
Vector2 scrollPos
 
bool showPageGUI = true
 

Properties

string Title [get]
 

Detailed Description

Stores data for a document, which can be viewed/read in a Menu

Constructor & Destructor Documentation

◆ Document() [1/2]

AC.Document.Document ( int[]  idArray)

The default Constructor.

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

◆ Document() [2/2]

AC.Document.Document ( int  _ID)

A Constructor in which the ID is explicitly set.

Parameters
_IDThe ID number to assign

Member Function Documentation

◆ CanTranslate()

bool AC.Document.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.

◆ GetNumTranslatables()

int AC.Document.GetNumTranslatables ( )

Gets the maximum number of possible translatable texts.

Returns
The maximum number of possible translatable texts.

Implements AC.ITranslatable.

◆ GetOwner()

string AC.Document.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.

◆ GetPageText()

string AC.Document.GetPageText ( int  pageIndex,
int  languageNumber = 0 
)

Gets the text of a given page

Parameters
pageIndexThe index of the page
languageNumberThe index number of the language to get the text in, where 0 = original language and >0 = translations
Returns
The page text

◆ GetTitleText()

string AC.Document.GetTitleText ( int  languageNumber = 0)

Gets the Document's title

Parameters
languageNumberThe index number of the language to get the text in, where 0 = original language and >0 = translations
Returns
The Document's title

◆ GetTranslatableString()

string AC.Document.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.Document.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.Document.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.Document.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.Document.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.

◆ SetTranslationID()

void AC.Document.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

◆ binID

int AC.Document.binID = 0

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

◆ carryOnStart

bool AC.Document.carryOnStart = false

If True, the Document will be in the Player's collection when the game begins

◆ ID

int AC.Document.ID

A unique identifier

◆ pages

List<JournalPage> AC.Document.pages = new List<JournalPage>()

A List of JournalPages that make up the contents of the Document

◆ rememberLastOpenPage

bool AC.Document.rememberLastOpenPage = false

If True, the Document will be re-opened at the same page that it was closed at

◆ texture

Texture2D AC.Document.texture

A Texture2D associated with the Document.

◆ title

string AC.Document.title

The title

◆ titleLineID

int AC.Document.titleLineID = -1

The translation ID number of the title, as generated by SpeechManager

Property Documentation

◆ Title

string AC.Document.Title
get

The Document's title. This will set the title to '(Untitled)' if empty.