Class TextManager
Text manager singleton class.
Namespace: DaggerfallWorkshop.Game
Assembly: Assembly-CSharp.dll
Syntax
public class TextManager : MonoBehaviour
Fields
| Improve this Doc View SourcedefaultInternalBOKCollectionName
Declaration
public static string defaultInternalBOKCollectionName
Field Value
Type | Description |
---|---|
String |
defaultInternalFlatsCollectionName
Declaration
public static string defaultInternalFlatsCollectionName
Field Value
Type | Description |
---|---|
String |
defaultInternalRSCCollectionName
Declaration
public static string defaultInternalRSCCollectionName
Field Value
Type | Description |
---|---|
String |
defaultInternalStringsCollectionName
Declaration
public static string defaultInternalStringsCollectionName
Field Value
Type | Description |
---|---|
String |
runtimeBOKStrings
Declaration
public string runtimeBOKStrings
Field Value
Type | Description |
---|---|
String |
runtimeFlatStrings
Declaration
public string runtimeFlatStrings
Field Value
Type | Description |
---|---|
String |
runtimeInternalStrings
Declaration
public string runtimeInternalStrings
Field Value
Type | Description |
---|---|
String |
runtimeRSCStrings
Declaration
public string runtimeRSCStrings
Field Value
Type | Description |
---|---|
String |
tableCopyOverwriteTargetStringTables
Declaration
public bool tableCopyOverwriteTargetStringTables
Field Value
Type | Description |
---|---|
Boolean |
tableCopyTargetBOKStrings
Declaration
public string tableCopyTargetBOKStrings
Field Value
Type | Description |
---|---|
String |
tableCopyTargetFlatStrings
Declaration
public string tableCopyTargetFlatStrings
Field Value
Type | Description |
---|---|
String |
tableCopyTargetInternalStrings
Declaration
public string tableCopyTargetInternalStrings
Field Value
Type | Description |
---|---|
String |
tableCopyTargetRSCStrings
Declaration
public string tableCopyTargetRSCStrings
Field Value
Type | Description |
---|---|
String |
Properties
| Improve this Doc View SourceHasInstance
Declaration
public static bool HasInstance { get; }
Property Value
Type | Description |
---|---|
Boolean |
Instance
Declaration
public static TextManager Instance { get; }
Property Value
Type | Description |
---|---|
TextManager |
RuntimeInternalStrings
Gets or sets name of StringTable collection to use in place of Internal_Strings.
Declaration
public string RuntimeInternalStrings { get; set; }
Property Value
Type | Description |
---|---|
String |
RuntimeRSCStrings
Gets or sets name of StringTable collection to use in place of Internal_RSC.
Declaration
public string RuntimeRSCStrings { get; set; }
Property Value
Type | Description |
---|---|
String |
Methods
| Improve this Doc View SourceEnumerateTextDatabases()
Enumerate all available text databases.
Declaration
protected void EnumerateTextDatabases()
FindSingleton(out TextManager)
Declaration
public static bool FindSingleton(out TextManager singletonOut)
Parameters
Type | Name | Description |
---|---|---|
TextManager | singletonOut |
Returns
Type | Description |
---|---|
Boolean |
GetLocalizedEnemyName(Int32)
Gets display name of an enemy from their ID.
Declaration
public string GetLocalizedEnemyName(int enemyID)
Parameters
Type | Name | Description |
---|---|---|
Int32 | enemyID | ID of enemy. Valid IDs are 0-42 and 128-146, or values registered in Daggerfallentity.CustomCareerTemplates |
Returns
Type | Description |
---|---|
String | Name of enemy from localization if found, or exception if not found. |
GetLocalizedFont(DaggerfallFont.FontName)
Gets a registered DaggerfallFont replacement for current locale.
Declaration
public DaggerfallFont GetLocalizedFont(DaggerfallFont.FontName fontName)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallFont.FontName | fontName |
Returns
Type | Description |
---|---|
DaggerfallFont |
GetLocalizedFont(Locale, DaggerfallFont.FontName)
Gets a registered Daggerfall replacement for specified name and locale.
Declaration
public DaggerfallFont GetLocalizedFont(Locale locale, DaggerfallFont.FontName fontName)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Localization.Locale | locale | Locale of font. |
DaggerfallFont.FontName | fontName | Name of font, which must be one of the 5 Daggerfall fonts. |
Returns
Type | Description |
---|---|
DaggerfallFont | DaggerfallFont object if registered, otherwise null. |
GetLocalizedText(String, TextCollections, Boolean)
Gets text value from localized text collection. If text not found for live collection then will try to fallback to internal text. If text still not found will return an error string.
Declaration
public string GetLocalizedText(string key, TextCollections collection = TextCollections.Internal, bool exception = false)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key of text in table. |
TextCollections | collection | Enum value to lookup collection name in TextManager. |
Boolean | exception | True to throw detailed exception if text not found. False to just return error string. |
Returns
Type | Description |
---|---|
String | Text if found, then fallback if found, then exception or error string if nothing found. |
GetLocalizedTextList(String, TextCollections, Boolean)
Gets an array of text where each line is considered an item in array. Entry will be read from table and split by newline '\n' character into array.
Declaration
public string[] GetLocalizedTextList(string key, TextCollections collection = TextCollections.Internal, bool exception = true)
Parameters
Type | Name | Description |
---|---|---|
String | key | Key of text in table. |
TextCollections | collection | Enum value to lookup collection name in TextManager. |
Boolean | exception | True to throw exception if text not found. False to just return null. |
Returns
Type | Description |
---|---|
String[] | Text array if found, otherwise returns null or throws exception. |
GetLocalizedTextListFromKeyArray(String[], TextCollections, Boolean)
Gets array of text from discrete items using a key array.
Declaration
public string[] GetLocalizedTextListFromKeyArray(string[] keyArray, TextCollections collection = TextCollections.Internal, bool exception = true)
Parameters
Type | Name | Description |
---|---|---|
String[] | keyArray | Array of keys to resolve back to text in list. |
TextCollections | collection | Enum value to lookup collection name in TextManager. |
Boolean | exception | True to throw exception if text not found. False to just return null. |
Returns
Type | Description |
---|---|
String[] | Text array if all keys found, otherwise returns null or throws exception. |
GetText(String, String)
Gets text value from database.
Declaration
public string GetText(string databaseName, string key)
Parameters
Type | Name | Description |
---|---|---|
String | databaseName | Name of text database. |
String | key | Key of text in database. |
Returns
Type | Description |
---|---|
String | Text if found, otherwise return an error string instead. |
HasDatabase(String)
Checks if text database table was found enumerated StreamingAssets/Text folder.
Declaration
public bool HasDatabase(string databaseName)
Parameters
Type | Name | Description |
---|---|---|
String | databaseName | Name of database. |
Returns
Type | Description |
---|---|
Boolean | True if database was enumerated. |
HasLocalizedFont(DaggerfallFont.FontName)
Check if font of specified name is available in current locale.
Declaration
public bool HasLocalizedFont(DaggerfallFont.FontName fontName)
Parameters
Type | Name | Description |
---|---|---|
DaggerfallFont.FontName | fontName | Name of font, which must be one of the 5 Daggerfall fonts. |
Returns
Type | Description |
---|---|
Boolean | True if font of this name has been registered in current locale. |
HasLocalizedFont(Locale, DaggerfallFont.FontName)
Check if font of specified name and locale have been registered.
Declaration
public bool HasLocalizedFont(Locale locale, DaggerfallFont.FontName fontName)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Localization.Locale | locale | Locale of font. |
DaggerfallFont.FontName | fontName | Name of font, which must be one of the 5 Daggerfall fonts. |
Returns
Type | Description |
---|---|
Boolean | True if font of this name and locale has been registered. |
HasText(String, String)
Checks if both text database and text key exists.
Declaration
public bool HasText(string databaseName, string key)
Parameters
Type | Name | Description |
---|---|---|
String | databaseName | Name of database. |
String | key | Key of text in database. |
Returns
Type | Description |
---|---|
Boolean | True if both database and text key enumerated. |
RegisterLocalizedFont(Locale, DaggerfallFont.FontName, DaggerfallFont)
Register a DaggerfallFont replacement to be used for specified locale. If this font name and locale replacement has already been registered, it will be replaced by this font. Note: Localized fonts can only be SDF capable. SDF font setting will be forced on by registering any custom font.
Declaration
public void RegisterLocalizedFont(Locale locale, DaggerfallFont.FontName fontName, DaggerfallFont font)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Localization.Locale | locale | Locale of font. |
DaggerfallFont.FontName | fontName | Name of font, which must be one of the 5 Daggerfall fonts. |
DaggerfallFont | font | DaggerfallFont object to use for this font name and locale. |