Anvil
Anvil.API.StrRef Struct Reference

A talk table (tlk) string reference. More...

Public Member Functions

 StrRef (int stringId)
 
 StrRef (uint stringId)
 
void ClearOverride ()
 Clears the current text override for this StrRef. More...
 
void ClearPlayerOverride (NwPlayer player, bool restoreGlobal=true)
 Clears the string override for the specified player, optionally restoring the global override. More...
 
void SetPlayerOverride (NwPlayer player, string? value)
 Overrides the string for the specified player only.
Overrides will not persist through re-logging. More...
 
string? ToParsedString ()
 Gets the formatted string associated with this string reference/token number.
This will parse any tokens (e.g. <CUSTOM0>) as their current set token values. More...
 
override string ToString ()
 Gets the raw string associated with this string reference/token number. More...
 

Static Public Member Functions

static StrRef FromCustomTlk (uint stringId)
 Gets a StrRef from the module's custom tlk table.
Use the index from the custom tlk. This factory method will automatically offset the id value. More...
 

Public Attributes

readonly uint Id
 Gets the index/key for this StrRef. More...
 

Properties

uint CustomId [get]
 Gets the index/key for this StrRef relative to the module's custom talk table. (-16777216) More...
 
string? Override [get, set]
 Gets or sets a string override that this StrRef should return instead of the tlk file definition. More...
 

Detailed Description

A talk table (tlk) string reference.

Member Function Documentation

◆ ClearOverride()

void Anvil.API.StrRef.ClearOverride ( )
inline

Clears the current text override for this StrRef.

◆ ClearPlayerOverride()

void Anvil.API.StrRef.ClearPlayerOverride ( NwPlayer  player,
bool  restoreGlobal = true 
)
inline

Clears the string override for the specified player, optionally restoring the global override.

Parameters
playerThe player to clear the override from.
restoreGlobalIf true, restores Override as the string value.

◆ FromCustomTlk()

static StrRef Anvil.API.StrRef.FromCustomTlk ( uint  stringId)
inlinestatic

Gets a StrRef from the module's custom tlk table.
Use the index from the custom tlk. This factory method will automatically offset the id value.

Parameters
stringIdThe custom token index.
Returns
The associated StrRef.

◆ SetPlayerOverride()

void Anvil.API.StrRef.SetPlayerOverride ( NwPlayer  player,
string?  value 
)
inline

Overrides the string for the specified player only.
Overrides will not persist through re-logging.

Parameters
playerThe player who should see the different string.
valueThe override string to show.

◆ ToParsedString()

string? Anvil.API.StrRef.ToParsedString ( )
inline

Gets the formatted string associated with this string reference/token number.
This will parse any tokens (e.g. <CUSTOM0>) as their current set token values.

Returns

◆ ToString()

override string Anvil.API.StrRef.ToString ( )
inline

Gets the raw string associated with this string reference/token number.

Returns
The associated string.

Member Data Documentation

◆ Id

readonly uint Anvil.API.StrRef.Id

Gets the index/key for this StrRef.

Property Documentation

◆ CustomId

uint Anvil.API.StrRef.CustomId
get

Gets the index/key for this StrRef relative to the module's custom talk table. (-16777216)

◆ Override

string? Anvil.API.StrRef.Override
getset

Gets or sets a string override that this StrRef should return instead of the tlk file definition.


The documentation for this struct was generated from the following file: