mirror of
https://github.com/goatcorp/Dalamud.git
synced 2026-02-19 14:27:45 +01:00
Merge branch 'master' of https://github.com/goatcorp/Dalamud
This commit is contained in:
commit
7da3a6ed67
14 changed files with 110 additions and 2 deletions
|
|
@ -51,7 +51,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Lumina instance to use for any necessary data lookups.
|
/// The Lumina instance to use for any necessary data lookups.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected DataManager DataResolver;
|
public DataManager DataResolver;
|
||||||
|
|
||||||
// private for now, since subclasses shouldn't interact with this
|
// private for now, since subclasses shouldn't interact with this
|
||||||
// To force-invalidate it, Dirty can be set to true
|
// To force-invalidate it, Dirty can be set to true
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
using Dalamud.Data.TransientSheet;
|
using Dalamud.Data.TransientSheet;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -34,7 +35,10 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint group;
|
private uint group;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint key;
|
private uint key;
|
||||||
|
|
||||||
internal AutoTranslatePayload() { }
|
internal AutoTranslatePayload() { }
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
using Lumina.Excel.GeneratedSheets;
|
using Lumina.Excel.GeneratedSheets;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -22,6 +23,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public Item Item
|
public Item Item
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -57,8 +59,10 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether or not this item link is for a high-quality version of the item.
|
/// Whether or not this item link is for a high-quality version of the item.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonProperty]
|
||||||
public bool IsHQ { get; private set; } = false;
|
public bool IsHQ { get; private set; } = false;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint itemId;
|
private uint itemId;
|
||||||
|
|
||||||
internal ItemPayload() { }
|
internal ItemPayload() { }
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -20,6 +21,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public Map Map
|
public Map Map
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -36,6 +38,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public TerritoryType TerritoryType
|
public TerritoryType TerritoryType
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -70,6 +73,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The readable y-coordinate position for this map link. This value is approximate and unrounded.
|
/// The readable y-coordinate position for this map link. This value is approximate and unrounded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public float YCoord
|
public float YCoord
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -82,6 +86,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// The printable map coordinates for this link. This value tries to match the in-game printable text as closely as possible
|
/// The printable map coordinates for this link. This value tries to match the in-game printable text as closely as possible
|
||||||
/// but is an approximation and may be slightly off for some positions.
|
/// but is an approximation and may be slightly off for some positions.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string CoordinateString
|
public string CoordinateString
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -102,6 +107,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The region name for this map link. This corresponds to the upper zone name found in the actual in-game map UI. eg, "La Noscea"
|
/// The region name for this map link. This corresponds to the upper zone name found in the actual in-game map UI. eg, "La Noscea"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string PlaceNameRegion
|
public string PlaceNameRegion
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -115,6 +121,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The place name for this map link. This corresponds to the lower zone name found in the actual in-game map UI. eg, "Limsa Lominsa Upper Decks"
|
/// The place name for this map link. This corresponds to the lower zone name found in the actual in-game map UI. eg, "Limsa Lominsa Upper Decks"
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string PlaceName
|
public string PlaceName
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -129,7 +136,10 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string DataString => $"m:{TerritoryType.RowId},{Map.RowId},{RawX},{RawY}";
|
public string DataString => $"m:{TerritoryType.RowId},{Map.RowId},{RawX},{RawY}";
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint territoryTypeId;
|
private uint territoryTypeId;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint mapId;
|
private uint mapId;
|
||||||
// there is no Z; it's purely in the text payload where applicable
|
// there is no Z; it's purely in the text payload where applicable
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -14,10 +15,12 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
public override PayloadType Type => PayloadType.Player;
|
public override PayloadType Type => PayloadType.Player;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private string playerName;
|
private string playerName;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The player's displayed name. This does not contain the server name.
|
/// The player's displayed name. This does not contain the server name.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string PlayerName
|
public string PlayerName
|
||||||
{
|
{
|
||||||
get { return this.playerName; }
|
get { return this.playerName; }
|
||||||
|
|
@ -35,6 +38,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public World World
|
public World World
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -48,8 +52,10 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// A text representation of this player link matching how it might appear in-game.
|
/// A text representation of this player link matching how it might appear in-game.
|
||||||
/// The world name will always be present.
|
/// The world name will always be present.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string DisplayedName => $"{PlayerName}{(char)SeIconChar.CrossWorld}{World.Name}";
|
public string DisplayedName => $"{PlayerName}{(char)SeIconChar.CrossWorld}{World.Name}";
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint serverId;
|
private uint serverId;
|
||||||
|
|
||||||
internal PlayerPayload() { }
|
internal PlayerPayload() { }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
@ -20,6 +21,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
|
|
||||||
public override PayloadType Type => PayloadType.Unknown;
|
public override PayloadType Type => PayloadType.Unknown;
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private byte[] data;
|
private byte[] data;
|
||||||
// this is a bit different from the underlying data
|
// this is a bit different from the underlying data
|
||||||
// We need to store just the chunk data for decode to behave nicely, but when reading data out
|
// We need to store just the chunk data for decode to behave nicely, but when reading data out
|
||||||
|
|
@ -28,6 +30,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// The entire payload byte sequence for this payload.
|
/// The entire payload byte sequence for this payload.
|
||||||
/// The returned data is a clone and modifications will not be persisted.
|
/// The returned data is a clone and modifications will not be persisted.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public byte[] Data
|
public byte[] Data
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -38,8 +41,10 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private byte chunkType;
|
private byte chunkType;
|
||||||
|
|
||||||
|
[JsonConstructor]
|
||||||
internal RawPayload(byte chunkType)
|
internal RawPayload(byte chunkType)
|
||||||
{
|
{
|
||||||
this.chunkType = chunkType;
|
this.chunkType = chunkType;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -20,6 +21,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public Status Status
|
public Status Status
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -29,6 +31,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private uint statusId;
|
private uint statusId;
|
||||||
|
|
||||||
internal StatusPayload() { }
|
internal StatusPayload() { }
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
@ -13,11 +14,13 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
public override PayloadType Type => PayloadType.RawText;
|
public override PayloadType Type => PayloadType.RawText;
|
||||||
|
|
||||||
// allow modifying the text of existing payloads on the fly
|
// allow modifying the text of existing payloads on the fly
|
||||||
|
[JsonProperty]
|
||||||
private string text;
|
private string text;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The text contained in this payload.
|
/// The text contained in this payload.
|
||||||
/// This may contain SE's special unicode characters.
|
/// This may contain SE's special unicode characters.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public string Text
|
public string Text
|
||||||
{
|
{
|
||||||
get { return this.text; }
|
get { return this.text; }
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -31,6 +32,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public UIColor UIColor
|
public UIColor UIColor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -43,6 +45,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color key used as a lookup in the UIColor table for this foreground color.
|
/// The color key used as a lookup in the UIColor table for this foreground color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public ushort ColorKey
|
public ushort ColorKey
|
||||||
{
|
{
|
||||||
get { return this.colorKey; }
|
get { return this.colorKey; }
|
||||||
|
|
@ -57,6 +60,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Red/Green/Blue values for this foreground color, encoded as a typical hex color.
|
/// The Red/Green/Blue values for this foreground color, encoded as a typical hex color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public uint RGB
|
public uint RGB
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -65,6 +69,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private ushort colorKey;
|
private ushort colorKey;
|
||||||
|
|
||||||
internal UIForegroundPayload() { }
|
internal UIForegroundPayload() { }
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Dalamud.Data;
|
using Dalamud.Data;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
{
|
{
|
||||||
|
|
@ -31,6 +32,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// Value is evaluated lazily and cached.
|
/// Value is evaluated lazily and cached.
|
||||||
/// </remarks>
|
/// </remarks>
|
||||||
|
[JsonIgnore]
|
||||||
public UIColor UIColor
|
public UIColor UIColor
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -43,6 +45,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The color key used as a lookup in the UIColor table for this glow color.
|
/// The color key used as a lookup in the UIColor table for this glow color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public ushort ColorKey
|
public ushort ColorKey
|
||||||
{
|
{
|
||||||
get { return this.colorKey; }
|
get { return this.colorKey; }
|
||||||
|
|
@ -57,6 +60,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The Red/Green/Blue values for this glow color, encoded as a typical hex color.
|
/// The Red/Green/Blue values for this glow color, encoded as a typical hex color.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[JsonIgnore]
|
||||||
public uint RGB
|
public uint RGB
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|
@ -65,6 +69,7 @@ namespace Dalamud.Game.Chat.SeStringHandling.Payloads
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[JsonProperty]
|
||||||
private ushort colorKey;
|
private ushort colorKey;
|
||||||
|
|
||||||
internal UIGlowPayload() { }
|
internal UIGlowPayload() { }
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,9 @@ using System.Collections.Generic;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
using Dalamud.Data;
|
||||||
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
using Dalamud.Game.Chat.SeStringHandling.Payloads;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace Dalamud.Game.Chat.SeStringHandling
|
namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
{
|
{
|
||||||
|
|
@ -38,6 +40,7 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
/// Creates a new SeString from an ordered list of payloads.
|
/// Creates a new SeString from an ordered list of payloads.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="payloads">The Payload objects to make up this string.</param>
|
/// <param name="payloads">The Payload objects to make up this string.</param>
|
||||||
|
[JsonConstructor]
|
||||||
public SeString(List<Payload> payloads)
|
public SeString(List<Payload> payloads)
|
||||||
{
|
{
|
||||||
Payloads = payloads;
|
Payloads = payloads;
|
||||||
|
|
@ -100,5 +103,42 @@ namespace Dalamud.Game.Chat.SeStringHandling
|
||||||
|
|
||||||
return messageBytes.ToArray();
|
return messageBytes.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Serializes the SeString to json
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>An json representation of this object</returns>
|
||||||
|
public string ToJson()
|
||||||
|
{
|
||||||
|
return JsonConvert.SerializeObject(this, Formatting.Indented, new JsonSerializerSettings()
|
||||||
|
{
|
||||||
|
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
|
||||||
|
ReferenceLoopHandling = ReferenceLoopHandling.Ignore,
|
||||||
|
TypeNameHandling = TypeNameHandling.Auto
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Creates a SeString from a json. (For testing - not recommended for production use.)
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="json">A serialized SeString produced by ToJson() <see cref="ToJson"/></param>
|
||||||
|
/// <param name="dataManager">An initialized instance of DataManager for Lumina queries.</param>
|
||||||
|
/// <returns>A SeString initialized with values from the json</returns>
|
||||||
|
public static SeString FromJson(string json, DataManager dataManager)
|
||||||
|
{
|
||||||
|
var s = JsonConvert.DeserializeObject<SeString>(json, new JsonSerializerSettings
|
||||||
|
{
|
||||||
|
PreserveReferencesHandling = PreserveReferencesHandling.Objects,
|
||||||
|
TypeNameHandling = TypeNameHandling.Auto,
|
||||||
|
ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor
|
||||||
|
});
|
||||||
|
|
||||||
|
foreach(var payload in s.Payloads)
|
||||||
|
{
|
||||||
|
payload.DataResolver = dataManager;
|
||||||
|
}
|
||||||
|
|
||||||
|
return s;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ namespace Dalamud.Game.ClientState.Actors {
|
||||||
return actorStruct.ObjectKind switch {
|
return actorStruct.ObjectKind switch {
|
||||||
ObjectKind.Player => new PlayerCharacter(offset, actorStruct, this.dalamud),
|
ObjectKind.Player => new PlayerCharacter(offset, actorStruct, this.dalamud),
|
||||||
ObjectKind.BattleNpc => new BattleNpc(offset, actorStruct, this.dalamud),
|
ObjectKind.BattleNpc => new BattleNpc(offset, actorStruct, this.dalamud),
|
||||||
|
ObjectKind.EventObj => new EventObj(offset, actorStruct, this.dalamud),
|
||||||
_ => new Actor(offset, actorStruct, this.dalamud)
|
_ => new Actor(offset, actorStruct, this.dalamud)
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
21
Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs
Normal file
21
Dalamud/Game/ClientState/Actors/Types/NonPlayer/EventObj.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace Dalamud.Game.ClientState.Actors.Types.NonPlayer {
|
||||||
|
/// <summary>
|
||||||
|
/// This class represents an EventObj.
|
||||||
|
/// </summary>
|
||||||
|
public class EventObj : Actor {
|
||||||
|
/// <summary>
|
||||||
|
/// Set up a new EventObj with the provided memory representation.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="actorStruct">The memory representation of the base actor.</param>
|
||||||
|
/// <param name="dalamud">A dalamud reference needed to access game data in Resolvers.</param>
|
||||||
|
/// <param name="address">The address of this actor in memory.</param>
|
||||||
|
public EventObj(IntPtr address, Structs.Actor actorStruct, Dalamud dalamud) : base(address, actorStruct, dalamud) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The data ID of the NPC linking to their respective game data.
|
||||||
|
/// </summary>
|
||||||
|
public int DataId => this.actorStruct.DataId;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -57,7 +57,8 @@ namespace Dalamud.Plugin
|
||||||
ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar);
|
ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoResize | ImGuiWindowFlags.NoScrollbar);
|
||||||
|
|
||||||
ImGui.Text(Loc.Localize("InstallerHint", "This window allows you install and remove in-game plugins.\nThey are made by third-party developers."));
|
ImGui.Text(Loc.Localize("InstallerHint", "This window allows you install and remove in-game plugins.\nThey are made by third-party developers."));
|
||||||
ImGui.SameLine();
|
ImGui.SameLine(ImGui.GetWindowWidth() - 250);
|
||||||
|
ImGui.SetNextItemWidth(240);
|
||||||
ImGui.InputTextWithHint("###XPlPluginInstaller_Search", Loc.Localize("InstallerSearch", "Search"), ref this.searchText, 100);
|
ImGui.InputTextWithHint("###XPlPluginInstaller_Search", Loc.Localize("InstallerSearch", "Search"), ref this.searchText, 100);
|
||||||
ImGui.Separator();
|
ImGui.Separator();
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue