dao::tlk

The game’s own text by string reference, in the player’s language.

Declared in dao/Tlk.h.

Functions

Resolve()

std::wstring Resolve(std::wstring_view text)

Replaces the game’s tokens in a text, the same way the game’s screens do.

For example, a reply’s “\<FirstName/\>, wait!” becomes “Lyna, wait!”, and a tutorial’s key tokens become the keys the player has bound. The talk tables’ markup becomes the Flash HTML the movies show: <emp> becomes <b> and <desc> becomes <i>. Tokens the game does not know are left as they are.

dao::tlk::Resolve(dao::tlk::String(strref))

Call it on the game thread. Until a game is loaded, the hero’s name tokens are left in place.

Returns the resolved text, or the text unchanged before the game is up

String()

std::wstring String(std::uint32_t strref)

Returns the text of a string reference, as the game shows it now: the female form where the hero is female and the language has one.

Parameter  
strref the string reference, as a data table or a script holds it

Returns the text, or an empty string for an unknown reference or before the talk tables load