Class SeStringBuilder
Helper class to build SeStrings using a builder pattern.
Assembly: Dalamud.dll
View Source
public class SeStringBuilder
Properties
BuiltString
Gets the built SeString.
View Source
public SeString BuiltString { get; init; }
Methods
Append(SeString)
Append another SeString to the builder.
View Source
public SeStringBuilder Append(SeString toAppend)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.Text.SeStringHandling.SeString | toAppend | The SeString to append. |
Append(string)
Append raw text to the builder.
View Source
public SeStringBuilder Append(string text)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The raw text. |
Append(IEnumerable<Payload>)
Append payloads to the builder.
View Source
public SeStringBuilder Append(IEnumerable<Payload> payloads)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<Dalamud.Game.Text.SeStringHandling.Payload> | payloads | A list of payloads. |
AddText(string)
Append raw text to the builder.
View Source
public SeStringBuilder AddText(string text)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The raw text. |
AddUiForeground(ushort)
Start colored text in the current builder.
View Source
public SeStringBuilder AddUiForeground(ushort colorKey)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | colorKey | The text color. |
AddUiForegroundOff()
Turn off a previous colored text.
View Source
public SeStringBuilder AddUiForegroundOff()
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.### AddUiForeground(string, ushort) Add colored text to the current builder.
View Source
public SeStringBuilder AddUiForeground(string text, ushort colorKey)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The raw text. |
System.UInt16 | colorKey | The text color. |
AddUiGlow(ushort)
Start an UiGlow in the current builder.
View Source
public SeStringBuilder AddUiGlow(ushort colorKey)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt16 | colorKey | The glow color. |
AddUiGlowOff()
Turn off a previous UiGlow.
View Source
public SeStringBuilder AddUiGlowOff()
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.### AddUiGlow(string, ushort) Add glowing text to the current builder.
View Source
public SeStringBuilder AddUiGlow(string text, ushort colorKey)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The raw text. |
System.UInt16 | colorKey | The glow color. |
AddIcon(BitmapFontIcon)
Add an icon to the builder.
View Source
public SeStringBuilder AddIcon(BitmapFontIcon icon)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.Text.SeStringHandling.BitmapFontIcon | icon | The icon to add. |
AddItemLink(uint, bool, string?)
Add an item link to the builder.
View Source
public SeStringBuilder AddItemLink(uint itemId, bool isHq, string? itemNameOverride = null)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | itemId | The item ID. |
System.Boolean | isHq | Whether or not the item is high quality. |
System.String | itemNameOverride | Override for the item's name. |
AddItemLink(uint, ItemKind, string?)
Add an item link to the builder.
View Source
public SeStringBuilder AddItemLink(uint itemId, ItemPayload.ItemKind kind = ItemKind.Normal, string? itemNameOverride = null)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | itemId | The item ID. |
Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload.ItemKind | kind | Kind of item to encode. |
System.String | itemNameOverride | Override for the item's name. |
AddItemLinkRaw(uint)
Add an item link to the builder.
View Source
public SeStringBuilder AddItemLinkRaw(uint rawItemId)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | rawItemId | The raw item ID. |
AddItalics(string)
Add italicized raw text to the builder.
View Source
public SeStringBuilder AddItalics(string text)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.String | text | The raw text. |
AddItalicsOn()
Turn italics on.
View Source
public SeStringBuilder AddItalicsOn()
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.### AddItalicsOff() Turn italics off.
View Source
public SeStringBuilder AddItalicsOff()
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.### AddMapLink(uint, uint, int, int) Add a map link payload to the builder.
View Source
public SeStringBuilder AddMapLink(uint territoryTypeId, uint mapId, int rawX, int rawY)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | territoryTypeId | The id of the TerritoryType entry for this link. |
System.UInt32 | mapId | The id of the Map entry for this link. |
System.Int32 | rawX | The internal raw x-coordinate for this link. |
System.Int32 | rawY | The internal raw y-coordinate for this link. |
AddMapLink(uint, uint, float, float, float)
Add a map link payload to the builder.
View Source
public SeStringBuilder AddMapLink(uint territoryTypeId, uint mapId, float niceXCoord, float niceYCoord, float fudgeFactor = 0.05)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | territoryTypeId | The id of the TerritoryType entry for this link. |
System.UInt32 | mapId | The id of the Map entry for this link. |
System.Single | niceXCoord | The human-readable x-coordinate for this link. |
System.Single | niceYCoord | The human-readable y-coordinate for this link. |
System.Single | fudgeFactor | An optional offset to account for rounding and truncation errors; it is best to leave this untouched in most cases. |
AddQuestLink(uint)
Add a quest link to the builder.
View Source
public SeStringBuilder AddQuestLink(uint questId)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | questId | The quest ID. |
AddStatusLink(uint)
Add a status effect link to the builder.
View Source
public SeStringBuilder AddStatusLink(uint statusId)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | statusId | The status effect ID. |
AddPartyFinderSearchConditionsLink()
Add a link to the party finder search conditions to the builder.
View Source
public SeStringBuilder AddPartyFinderSearchConditionsLink()
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.### AddPartyFinderLink(uint, bool) Add a party finder listing link to the builder.
View Source
public SeStringBuilder AddPartyFinderLink(uint id, bool isCrossWorld = false)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | id | The listing ID of the party finder listing. |
System.Boolean | isCrossWorld | Whether the listing is limited to the recruiting world. |
Add(Payload)
Add a payload to the builder.
View Source
public SeStringBuilder Add(Payload payload)
Returns
Dalamud.Game.Text.SeStringHandling.SeStringBuilder: The current builder.
Parameters
Type | Name | Description |
---|---|---|
Dalamud.Game.Text.SeStringHandling.Payload | payload | The payload to add. |
Build()
Return the built string.
View Source
public SeString Build()
Returns
Dalamud.Game.Text.SeStringHandling.SeString: The built string.### Encode() Encode the built string to bytes.
View Source
public byte[] Encode()
Returns
System.Byte[]
: The built string, encoded to UTF-8 bytes.### ToString()
Return the text representation of this string.
View Source
public override string ToString()
Returns
System.String
: The text representation of this string.## Extension Methods
- Dalamud.Game.Text.SeStringHandling.SeStringBuilder.Dalamud.Utility.SeStringExtensions.AppendMacroString(System.ReadOnlySpan{System.Byte})
- Dalamud.Game.Text.SeStringHandling.SeStringBuilder.Dalamud.Utility.SeStringExtensions.AppendMacroString(System.ReadOnlySpan{System.Char})