Skip to main content

Class ItemPayload

An SeString Payload representing an interactable item link.

Assembly: Dalamud.dll
Declaration
public class ItemPayload : Payload

Inheritance: System.Object -> Dalamud.Game.Text.SeStringHandling.Payload

Properties

Type

Gets the type of this payload.

Declaration
public override PayloadType Type { get; }

DisplayName

Gets or sets the displayed name for this item link. Note that incoming links only sometimes have names embedded, often the name is only present in a following text payload.

Declaration
public string? DisplayName { get; set; }

ItemId

Gets the actual item ID of this payload.

Declaration
[JsonIgnore]
public uint ItemId { get; }

RawItemId

Gets the raw, unadjusted item ID of this payload.

Declaration
[JsonIgnore]
public uint RawItemId { get; }

Item

Gets the underlying Lumina data represented by this payload. This is either a Item or EventItem Lumina.Excel.RowRef%601.

Declaration
[JsonIgnore]
public RowRef Item { get; }

IsHQ

Gets a value indicating whether this item link is for a high-quality version of the item.

Declaration
[JsonProperty]
public bool IsHQ { get; }

Kind

Gets or sets the kind of item represented by this payload.

Declaration
[JsonProperty]
public ItemKind Kind { get; set; }

Methods

FromRaw(uint, string?)

Initializes a new instance of the Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload class. Creates a payload representing an interactable item link for the specified item.

Declaration
public static ItemPayload FromRaw(uint rawItemId, string? displayNameOverride = null)
Returns

Dalamud.Game.Text.SeStringHandling.Payloads.ItemPayload: The created item payload.

Parameters
TypeNameDescription
System.UInt32rawItemIdThe raw, unadjusted id of the item.
System.StringdisplayNameOverrideAn optional name to include in the item link. Typically this should
        be left as null, or set to the normal item name.  Actual overrides are better done with the subsequent
TextPayload that is a part of a full item link in chat. |

ToString()

Declaration
public override string ToString()
Returns

System.String

EncodeImpl()

Encodes the internal state of this payload into a byte[] suitable for sending to in-game handlers such as the chat log.

Declaration
protected override byte[] EncodeImpl()
Returns

System.Byte[]: Encoded binary payload data suitable for use with in-game handlers.

DecodeImpl(BinaryReader, long)

Decodes a byte stream from the game into a payload object.

Declaration
protected override void DecodeImpl(BinaryReader reader, long endOfStream)
Parameters
TypeNameDescription
System.IO.BinaryReaderreaderA BinaryReader containing at least all the data for this payload.
System.Int64endOfStreamThe location holding the end of the data for this payload.