A line of text including formatting. More...
Public Member Functions | |
FormattedText (string text=null, Emphasis[] emphases=null, bool italic=false, int position=NoAssignedPosition, bool forceMenu=true, bool forceAuto=false, int pic=NoPicOverride, int picActor=NoPicOverride, int picConversant=NoPicOverride, string variableInputPrompt=null, int subtitlePanelNumber=-1, bool noSubtitle=false) | |
Initializes a new FormattedText. | |
Static Public Member Functions | |
static FormattedText | Parse (string rawText, EmphasisSetting[] emphasisSettings=null) |
Parses the text from a dialogue entry, which may contain formatting codes, and returns a FormattedText. | |
static string | ParseCode (string rawText) |
Replaces var and lua markup tags in text. | |
static FontStyle | GetFontStyle (Emphasis emphasis) |
Gets the Unity FonyStyle represented by an emphasis. | |
Static Public Attributes | |
static readonly FormattedText | empty = new FormattedText() |
Represents an empty line. | |
static readonly Emphasis[] | noEmphases = new Emphasis[0] |
Represents an empty set of emphases. | |
const int | NoAssignedPosition = -1 |
Constant: indicates that the response has no specifically-assigned position and can be placed anywhere in the player response menu. | |
const int | NoPicOverride = 0 |
Constant: indicates that there is no picture override for this pic tag. | |
Properties | |
string | text [get, set] |
Gets or sets the "clean" line of text, without formatting codes. | |
Emphasis[] | emphases [get, set] |
Gets or sets the list of emphases. | |
bool | italic [get, set] |
Gets or sets a value indicating to display the entire line in italics. | |
int | position [get, set] |
Gets or sets the response button position, for response text. | |
bool | forceMenu [get, set] |
Gets or sets a value indicating whether this response forces display of the response menu, even if there's only one response. | |
bool | forceAuto [get, set] |
If true, auto-select this entry instead of showing a response menu. | |
bool | noSubtitle [get, set] |
int | pic [get, set] |
Gets or sets the [pic=#] value. | |
int | picActor [get, set] |
Gets or sets the [pica=#] value. | |
int | picConversant [get, set] |
Gets or sets the [picc=#] value. | |
string | variableInputPrompt [get, set] |
Gets or sets the variable input prompt. | |
bool | hasVariableInputPrompt [get] |
Returns true if the formatted text includes a variable input prompt. | |
int | subtitlePanelNumber [get, set] |
The subtitle. | |
A line of text including formatting.
Chat Mapper and the dialogue system support formatting codes inside lines of dialogue. This class represents a line where the formatting codes have been extracted and stored in separate formatting variables (emphases and italic).
|
inline |
Initializes a new FormattedText.
text | The clean line of text, without formatting codes. |
emphases | Emphases. |
italic | Italic. |
position | Position. |
forceMenu | Force menu. |
forceAuto | Force automatically selecting response without presenting a menu. |
pic | The [pic] value, or 0 for unused. |
picActor | The [pica] value, or 0 for unused. |
picConversant | The [picc] value, or 0 for unused. |
noSubtitle | Don't show subtitle. |
|
inlinestatic |
Gets the Unity FonyStyle represented by an emphasis.
emphasis | Emphasis. |
|
inlinestatic |
Parses the text from a dialogue entry, which may contain formatting codes, and returns a FormattedText.
The Parse() method handles these tags:
"Hello, [varName=Actor]."
."Hello, [lua(Variable['Actor'])]."
. Lua tags are processed first, so your Lua code can return other formatting codes that will then be parsed properly.rawText | The raw text to parse. |
emphasisSettings | The emphasis settings to use (usually from DialogueManager.MasterDatabase) when parsing [em#] tags. |
|
inlinestatic |
Replaces var and lua markup tags in text.
rawText | The raw text. |
|
static |
Represents an empty line.
|
static |
Constant: indicates that the response has no specifically-assigned position and can be placed anywhere in the player response menu.
Represents an empty set of emphases.
|
static |
Constant: indicates that there is no picture override for this pic tag.
|
getset |
Gets or sets the list of emphases.
An Emphasis specifies special formatting for a substring of the text.
The emphases.
|
getset |
If true, auto-select this entry instead of showing a response menu.
|
getset |
Gets or sets a value indicating whether this response forces display of the response menu, even if there's only one response.
true
to force the response menu; otherwise, false
.
|
get |
Returns true
if the formatted text includes a variable input prompt.
true
if has variable input prompt; otherwise, false
.
|
getset |
Gets or sets a value indicating to display the entire line in italics.
true
if italic; otherwise, false
.
|
getset |
|
getset |
Gets or sets the [pic=#] value.
The pic index, where 0
means unused.
|
getset |
Gets or sets the [pica=#] value.
The pica index, where 0<c/c> means unused.
|
getset |
Gets or sets the [picc=#] value.
The picc index, where 0
means unused.
|
getset |
Gets or sets the response button position, for response text.
The position, or NoAssignedPosition if there's no [position #] tag in the text.
|
getset |
The subtitle.
|
getset |
Gets or sets the "clean" line of text, without formatting codes.
The text.
|
getset |
Gets or sets the variable input prompt.
If this is set, the value is the name of the variable to prompt for input.
The variable name.