Show / Hide Table of Contents

Class TextManager

Text manager singleton class.

Inheritance
Object
Object
Component
Behaviour
MonoBehaviour
TextManager
Namespace: DaggerfallWorkshop.Game
Assembly: Assembly-CSharp.dll
Syntax
public class TextManager : MonoBehaviour

Fields

| Improve this Doc View Source

defaultInternalBOKCollectionName

Declaration
public static string defaultInternalBOKCollectionName
Field Value
Type Description
String
| Improve this Doc View Source

defaultInternalFlatsCollectionName

Declaration
public static string defaultInternalFlatsCollectionName
Field Value
Type Description
String
| Improve this Doc View Source

defaultInternalRSCCollectionName

Declaration
public static string defaultInternalRSCCollectionName
Field Value
Type Description
String
| Improve this Doc View Source

defaultInternalStringsCollectionName

Declaration
public static string defaultInternalStringsCollectionName
Field Value
Type Description
String
| Improve this Doc View Source

runtimeBOKStrings

Declaration
public string runtimeBOKStrings
Field Value
Type Description
String
| Improve this Doc View Source

runtimeFlatStrings

Declaration
public string runtimeFlatStrings
Field Value
Type Description
String
| Improve this Doc View Source

runtimeInternalStrings

Declaration
public string runtimeInternalStrings
Field Value
Type Description
String
| Improve this Doc View Source

runtimeRSCStrings

Declaration
public string runtimeRSCStrings
Field Value
Type Description
String
| Improve this Doc View Source

tableCopyOverwriteTargetStringTables

Declaration
public bool tableCopyOverwriteTargetStringTables
Field Value
Type Description
Boolean
| Improve this Doc View Source

tableCopyTargetBOKStrings

Declaration
public string tableCopyTargetBOKStrings
Field Value
Type Description
String
| Improve this Doc View Source

tableCopyTargetFlatStrings

Declaration
public string tableCopyTargetFlatStrings
Field Value
Type Description
String
| Improve this Doc View Source

tableCopyTargetInternalStrings

Declaration
public string tableCopyTargetInternalStrings
Field Value
Type Description
String
| Improve this Doc View Source

tableCopyTargetRSCStrings

Declaration
public string tableCopyTargetRSCStrings
Field Value
Type Description
String

Properties

| Improve this Doc View Source

HasInstance

Declaration
public static bool HasInstance { get; }
Property Value
Type Description
Boolean
| Improve this Doc View Source

Instance

Declaration
public static TextManager Instance { get; }
Property Value
Type Description
TextManager
| Improve this Doc View Source

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
| Improve this Doc View Source

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 Source

EnumerateTextDatabases()

Enumerate all available text databases.

Declaration
protected void EnumerateTextDatabases()
| Improve this Doc View Source

FindSingleton(out TextManager)

Declaration
public static bool FindSingleton(out TextManager singletonOut)
Parameters
Type Name Description
TextManager singletonOut
Returns
Type Description
Boolean
| Improve this Doc View Source

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.

| Improve this Doc View Source

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
| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

Extension Methods

MBExtensions.Invoke(MonoBehaviour, Action, Single)
MBExtensions.Invoke<T>(MonoBehaviour, Action<T>, T, Single)
MBExtensions.Invoke<T1, T2>(MonoBehaviour, Action<T1, T2>, T1, T2, Single)
MBExtensions.Invoke<T1, T2, T3>(MonoBehaviour, Action<T1, T2, T3>, T1, T2, T3, Single)
MBExtensions.Invoke<T1, T2, T3, T4>(MonoBehaviour, Action<T1, T2, T3, T4>, T1, T2, T3, T4, Single)
  • Improve this Doc
  • View Source
In This Article
  • Fields
    • defaultInternalBOKCollectionName
    • defaultInternalFlatsCollectionName
    • defaultInternalRSCCollectionName
    • defaultInternalStringsCollectionName
    • runtimeBOKStrings
    • runtimeFlatStrings
    • runtimeInternalStrings
    • runtimeRSCStrings
    • tableCopyOverwriteTargetStringTables
    • tableCopyTargetBOKStrings
    • tableCopyTargetFlatStrings
    • tableCopyTargetInternalStrings
    • tableCopyTargetRSCStrings
  • Properties
    • HasInstance
    • Instance
    • RuntimeInternalStrings
    • RuntimeRSCStrings
  • Methods
    • EnumerateTextDatabases()
    • FindSingleton(out TextManager)
    • GetLocalizedEnemyName(Int32)
    • GetLocalizedFont(DaggerfallFont.FontName)
    • GetLocalizedFont(Locale, DaggerfallFont.FontName)
    • GetLocalizedText(String, TextCollections, Boolean)
    • GetLocalizedTextList(String, TextCollections, Boolean)
    • GetLocalizedTextListFromKeyArray(String[], TextCollections, Boolean)
    • GetText(String, String)
    • HasDatabase(String)
    • HasLocalizedFont(DaggerfallFont.FontName)
    • HasLocalizedFont(Locale, DaggerfallFont.FontName)
    • HasText(String, String)
    • RegisterLocalizedFont(Locale, DaggerfallFont.FontName, DaggerfallFont)
  • Extension Methods
Back to top Generated by DocFX