mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
fix a million warnings
This commit is contained in:
parent
b752d958f7
commit
b425bb3e49
26 changed files with 1027 additions and 1019 deletions
|
|
@ -3,53 +3,6 @@ using FFXIVClientStructs.FFXIV.Client.Game.UI;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Aetherytes;
|
||||
|
||||
/// <summary>
|
||||
/// Class representing an aetheryte entry available to the game.
|
||||
/// </summary>
|
||||
internal sealed class AetheryteEntry : IAetheryteEntry
|
||||
{
|
||||
private readonly TeleportInfo data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AetheryteEntry"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Data read from the Aetheryte List.</param>
|
||||
internal AetheryteEntry(TeleportInfo data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint AetheryteId => this.data.AetheryteId;
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint TerritoryId => this.data.TerritoryId;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte SubIndex => this.data.SubIndex;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte Ward => this.data.Ward;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte Plot => this.data.Plot;
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint GilCost => this.data.GilCost;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsFavourite => this.data.IsFavourite != 0;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsSharedHouse => this.data.IsSharedHouse;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsApartment => this.data.IsApartment;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.Aetheryte> AetheryteData => new(this.AetheryteId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing an aetheryte entry available to the game.
|
||||
/// </summary>
|
||||
|
|
@ -106,3 +59,49 @@ public interface IAetheryteEntry
|
|||
ExcelResolver<Lumina.Excel.GeneratedSheets.Aetheryte> AetheryteData { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class representing an aetheryte entry available to the game.
|
||||
/// </summary>
|
||||
internal sealed class AetheryteEntry : IAetheryteEntry
|
||||
{
|
||||
private readonly TeleportInfo data;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="AetheryteEntry"/> class.
|
||||
/// </summary>
|
||||
/// <param name="data">Data read from the Aetheryte List.</param>
|
||||
internal AetheryteEntry(TeleportInfo data)
|
||||
{
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint AetheryteId => this.data.AetheryteId;
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint TerritoryId => this.data.TerritoryId;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte SubIndex => this.data.SubIndex;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte Ward => this.data.Ward;
|
||||
|
||||
/// <inheritdoc />
|
||||
public byte Plot => this.data.Plot;
|
||||
|
||||
/// <inheritdoc />
|
||||
public uint GilCost => this.data.GilCost;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsFavourite => this.data.IsFavourite != 0;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsSharedHouse => this.data.IsSharedHouse;
|
||||
|
||||
/// <inheritdoc />
|
||||
public bool IsApartment => this.data.IsApartment;
|
||||
|
||||
/// <inheritdoc />
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.Aetheryte> AetheryteData => new(this.AetheryteId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,60 @@ using Dalamud.Game.ClientState.Resolvers;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Buddy;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing represents a buddy such as the chocobo companion, summoned pets, squadron groups and trust parties.
|
||||
/// </summary>
|
||||
public interface IBuddyMember
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the address of the buddy in memory.
|
||||
/// </summary>
|
||||
IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the object ID of this buddy.
|
||||
/// </summary>
|
||||
uint ObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor associated with this buddy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
IGameObject? GameObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current health of this buddy.
|
||||
/// </summary>
|
||||
uint CurrentHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum health of this buddy.
|
||||
/// </summary>
|
||||
uint MaxHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data ID of this buddy.
|
||||
/// </summary>
|
||||
uint DataID { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Mount data related to this buddy. It should only be used with companion buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.Mount> MountData { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Pet data related to this buddy. It should only be used with pet buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.Pet> PetData { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Trust data related to this buddy. It should only be used with battle buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.DawnGrowMember> TrustData { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a buddy such as the chocobo companion, summoned pets, squadron groups and trust parties.
|
||||
/// </summary>
|
||||
|
|
@ -50,57 +104,3 @@ internal unsafe class BuddyMember : IBuddyMember
|
|||
|
||||
private FFXIVClientStructs.FFXIV.Client.Game.UI.Buddy.BuddyMember* Struct => (FFXIVClientStructs.FFXIV.Client.Game.UI.Buddy.BuddyMember*)this.Address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing represents a buddy such as the chocobo companion, summoned pets, squadron groups and trust parties.
|
||||
/// </summary>
|
||||
public interface IBuddyMember
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the address of the buddy in memory.
|
||||
/// </summary>
|
||||
IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the object ID of this buddy.
|
||||
/// </summary>
|
||||
unsafe uint ObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor associated with this buddy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
IGameObject? GameObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current health of this buddy.
|
||||
/// </summary>
|
||||
unsafe uint CurrentHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum health of this buddy.
|
||||
/// </summary>
|
||||
unsafe uint MaxHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data ID of this buddy.
|
||||
/// </summary>
|
||||
unsafe uint DataID { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Mount data related to this buddy. It should only be used with companion buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.Mount> MountData { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Pet data related to this buddy. It should only be used with pet buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.Pet> PetData { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Trust data related to this buddy. It should only be used with battle buddies.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.DawnGrowMember> TrustData { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,135 +7,6 @@ using Dalamud.Memory;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Fates;
|
||||
|
||||
/// <summary>
|
||||
/// This class represents an FFXIV Fate.
|
||||
/// </summary>
|
||||
internal unsafe partial class Fate
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Fate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this fate in memory.</param>
|
||||
internal Fate(IntPtr address)
|
||||
{
|
||||
this.Address = address;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IntPtr Address { get; }
|
||||
|
||||
private FFXIVClientStructs.FFXIV.Client.Game.Fate.FateContext* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Fate.FateContext*)this.Address;
|
||||
|
||||
public static bool operator ==(Fate fate1, Fate fate2)
|
||||
{
|
||||
if (fate1 is null || fate2 is null)
|
||||
return Equals(fate1, fate2);
|
||||
|
||||
return fate1.Equals(fate2);
|
||||
}
|
||||
|
||||
public static bool operator !=(Fate fate1, Fate fate2) => !(fate1 == fate2);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this Fate is still valid in memory.
|
||||
/// </summary>
|
||||
/// <param name="fate">The fate to check.</param>
|
||||
/// <returns>True or false.</returns>
|
||||
public static bool IsValid(Fate fate)
|
||||
{
|
||||
var clientState = Service<ClientState>.GetNullable();
|
||||
|
||||
if (fate == null || clientState == null)
|
||||
return false;
|
||||
|
||||
if (clientState.LocalContentId == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor is still valid in memory.
|
||||
/// </summary>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid() => IsValid(this);
|
||||
|
||||
/// <inheritdoc/>
|
||||
bool IEquatable<IFate>.Equals(IFate other) => this.FateId == other?.FateId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool Equals(object obj) => ((IEquatable<IFate>)this).Equals(obj as IFate);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => this.FateId.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents an FFXIV Fate.
|
||||
/// </summary>
|
||||
internal unsafe partial class Fate : IFate
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public ushort FateId => this.Struct->FateId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lumina.Excel.GeneratedSheets.Fate GameData => Service<DataManager>.Get().GetExcelSheet<Lumina.Excel.GeneratedSheets.Fate>().GetRow(this.FateId);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int StartTimeEpoch => this.Struct->StartTimeEpoch;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public short Duration => this.Struct->Duration;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public long TimeRemaining => this.StartTimeEpoch + this.Duration - DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Name => MemoryHelper.ReadSeString(&this.Struct->Name);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Description => MemoryHelper.ReadSeString(&this.Struct->Description);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Objective => MemoryHelper.ReadSeString(&this.Struct->Objective);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public FateState State => (FateState)this.Struct->State;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte HandInCount => this.Struct->HandInCount;
|
||||
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Progress => this.Struct->Progress;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool HasExpBonus => this.Struct->IsExpBonus;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint IconId => this.Struct->IconId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Level => this.Struct->Level;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte MaxLevel => this.Struct->MaxLevel;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Vector3 Position => this.Struct->Location;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float Radius => this.Struct->Radius;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MapIconId => this.Struct->MapIconId;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the territory this <see cref="Fate"/> is located in.
|
||||
/// </summary>
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing an fate entry that can be seen in the current area.
|
||||
/// </summary>
|
||||
|
|
@ -241,3 +112,131 @@ public interface IFate : IEquatable<IFate>
|
|||
/// </summary>
|
||||
IntPtr Address { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents an FFXIV Fate.
|
||||
/// </summary>
|
||||
internal unsafe partial class Fate
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Fate"/> class.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this fate in memory.</param>
|
||||
internal Fate(IntPtr address)
|
||||
{
|
||||
this.Address = address;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public IntPtr Address { get; }
|
||||
|
||||
private FFXIVClientStructs.FFXIV.Client.Game.Fate.FateContext* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Fate.FateContext*)this.Address;
|
||||
|
||||
public static bool operator ==(Fate fate1, Fate fate2)
|
||||
{
|
||||
if (fate1 is null || fate2 is null)
|
||||
return Equals(fate1, fate2);
|
||||
|
||||
return fate1.Equals(fate2);
|
||||
}
|
||||
|
||||
public static bool operator !=(Fate fate1, Fate fate2) => !(fate1 == fate2);
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this Fate is still valid in memory.
|
||||
/// </summary>
|
||||
/// <param name="fate">The fate to check.</param>
|
||||
/// <returns>True or false.</returns>
|
||||
public static bool IsValid(Fate fate)
|
||||
{
|
||||
var clientState = Service<ClientState>.GetNullable();
|
||||
|
||||
if (fate == null || clientState == null)
|
||||
return false;
|
||||
|
||||
if (clientState.LocalContentId == 0)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor is still valid in memory.
|
||||
/// </summary>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid() => IsValid(this);
|
||||
|
||||
/// <inheritdoc/>
|
||||
bool IEquatable<IFate>.Equals(IFate other) => this.FateId == other?.FateId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override bool Equals(object obj) => ((IEquatable<IFate>)this).Equals(obj as IFate);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => this.FateId.GetHashCode();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents an FFXIV Fate.
|
||||
/// </summary>
|
||||
internal unsafe partial class Fate : IFate
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public ushort FateId => this.Struct->FateId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lumina.Excel.GeneratedSheets.Fate GameData => Service<DataManager>.Get().GetExcelSheet<Lumina.Excel.GeneratedSheets.Fate>().GetRow(this.FateId);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int StartTimeEpoch => this.Struct->StartTimeEpoch;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public short Duration => this.Struct->Duration;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public long TimeRemaining => this.StartTimeEpoch + this.Duration - DateTimeOffset.Now.ToUnixTimeSeconds();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Name => MemoryHelper.ReadSeString(&this.Struct->Name);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Description => MemoryHelper.ReadSeString(&this.Struct->Description);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Objective => MemoryHelper.ReadSeString(&this.Struct->Objective);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public FateState State => (FateState)this.Struct->State;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte HandInCount => this.Struct->HandInCount;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Progress => this.Struct->Progress;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool HasExpBonus => this.Struct->IsExpBonus;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint IconId => this.Struct->IconId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Level => this.Struct->Level;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte MaxLevel => this.Struct->MaxLevel;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Vector3 Position => this.Struct->Location;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float Radius => this.Struct->Radius;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MapIconId => this.Struct->MapIconId;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the territory this <see cref="Fate"/> is located in.
|
||||
/// </summary>
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> TerritoryType => new(this.Struct->TerritoryId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,22 @@ using Lumina.Excel.GeneratedSheets;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Objects.SubKinds;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a player character.
|
||||
/// </summary>
|
||||
public interface IPlayerCharacter : IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="ExcelResolver{T}">world</see> of the character.
|
||||
/// </summary>
|
||||
ExcelResolver<World> CurrentWorld { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the home <see cref="ExcelResolver{T}">world</see> of the character.
|
||||
/// </summary>
|
||||
ExcelResolver<World> HomeWorld { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a player character.
|
||||
/// </summary>
|
||||
|
|
@ -26,29 +42,13 @@ internal unsafe class PlayerCharacter : BattleChara, IPlayerCharacter
|
|||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.World> CurrentWorld => new(this.Struct->CurrentWorld);
|
||||
public ExcelResolver<World> CurrentWorld => new(this.Struct->CurrentWorld);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<Lumina.Excel.GeneratedSheets.World> HomeWorld => new(this.Struct->HomeWorld);
|
||||
public ExcelResolver<World> HomeWorld => new(this.Struct->HomeWorld);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target actor ID of the PlayerCharacter.
|
||||
/// </summary>
|
||||
public override ulong TargetObjectId => this.Struct->LookAt.Controller.Params[0].TargetParam.TargetId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a player character.
|
||||
/// </summary>
|
||||
public interface IPlayerCharacter : IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the current <see cref="ExcelResolver{T}">world</see> of the character.
|
||||
/// </summary>
|
||||
unsafe ExcelResolver<Lumina.Excel.GeneratedSheets.World> CurrentWorld { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the home <see cref="ExcelResolver{T}">world</see> of the character.
|
||||
/// </summary>
|
||||
unsafe ExcelResolver<Lumina.Excel.GeneratedSheets.World> HomeWorld { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,54 +3,6 @@ using Dalamud.Utility;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Objects.Types;
|
||||
|
||||
/// <summary>
|
||||
/// This class represents the battle characters.
|
||||
/// </summary>
|
||||
internal unsafe class BattleChara : Character, IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BattleChara"/> class.
|
||||
/// This represents a battle character.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this character in memory.</param>
|
||||
internal BattleChara(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public StatusList StatusList => new(this.Struct->GetStatusManager());
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCasting => this.Struct->GetCastInfo()->IsCasting > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCastInterruptible => this.Struct->GetCastInfo()->Interruptible > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte CastActionType => (byte)this.Struct->GetCastInfo()->ActionType;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CastActionId => this.Struct->GetCastInfo()->ActionId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ulong CastTargetObjectId => this.Struct->GetCastInfo()->TargetId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float CurrentCastTime => this.Struct->GetCastInfo()->CurrentCastTime;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float BaseCastTime => this.Struct->GetCastInfo()->BaseCastTime;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float TotalCastTime => this.Struct->GetCastInfo()->TotalCastTime;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the underlying structure.
|
||||
/// </summary>
|
||||
protected internal new FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara*)this.Address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a battle character.
|
||||
/// </summary>
|
||||
|
|
@ -105,3 +57,51 @@ public interface IBattleChara : ICharacter
|
|||
/// </summary>
|
||||
public float TotalCastTime { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents the battle characters.
|
||||
/// </summary>
|
||||
internal unsafe class BattleChara : Character, IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BattleChara"/> class.
|
||||
/// This represents a battle character.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this character in memory.</param>
|
||||
internal BattleChara(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public StatusList StatusList => new(this.Struct->GetStatusManager());
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCasting => this.Struct->GetCastInfo()->IsCasting > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsCastInterruptible => this.Struct->GetCastInfo()->Interruptible > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte CastActionType => (byte)this.Struct->GetCastInfo()->ActionType;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CastActionId => this.Struct->GetCastInfo()->ActionId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ulong CastTargetObjectId => this.Struct->GetCastInfo()->TargetId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float CurrentCastTime => this.Struct->GetCastInfo()->CurrentCastTime;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float BaseCastTime => this.Struct->GetCastInfo()->BaseCastTime;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public float TotalCastTime => this.Struct->GetCastInfo()->TotalCastTime;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the underlying structure.
|
||||
/// </summary>
|
||||
protected internal new FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Character.BattleChara*)this.Address;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,17 @@ using Dalamud.Game.ClientState.Objects.Enums;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Objects.Types;
|
||||
|
||||
/// <summary>
|
||||
/// A interface that represents a battle NPC.
|
||||
/// </summary>
|
||||
public interface IBattleNpc : IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the BattleNpc <see cref="BattleNpcSubKind" /> of this BattleNpc.
|
||||
/// </summary>
|
||||
BattleNpcSubKind BattleNpcKind { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a battle NPC.
|
||||
/// </summary>
|
||||
|
|
@ -25,14 +36,3 @@ internal unsafe class BattleNpc : BattleChara, IBattleNpc
|
|||
/// <inheritdoc/>
|
||||
public override ulong TargetObjectId => this.Struct->Character.TargetId;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface that represents a battle NPC.
|
||||
/// </summary>
|
||||
public interface IBattleNpc : IBattleChara
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the BattleNpc <see cref="BattleNpcSubKind" /> of this BattleNpc.
|
||||
/// </summary>
|
||||
BattleNpcSubKind BattleNpcKind { get; }
|
||||
}
|
||||
|
|
@ -8,91 +8,6 @@ using Lumina.Excel.GeneratedSheets;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Objects.Types;
|
||||
|
||||
/// <summary>
|
||||
/// This class represents the base for non-static entities.
|
||||
/// </summary>
|
||||
internal unsafe class Character : GameObject, ICharacter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Character"/> class.
|
||||
/// This represents a non-static entity.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this character in memory.</param>
|
||||
internal Character(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentHp => this.Struct->CharacterData.Health;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxHp => this.Struct->CharacterData.MaxHealth;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentMp => this.Struct->CharacterData.Mana;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxMp => this.Struct->CharacterData.MaxMana;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentGp => this.Struct->CharacterData.GatheringPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxGp => this.Struct->CharacterData.MaxGatheringPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentCp => this.Struct->CharacterData.CraftingPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxCp => this.Struct->CharacterData.MaxCraftingPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte ShieldPercentage => this.Struct->CharacterData.ShieldValue;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<ClassJob> ClassJob => new(this.Struct->CharacterData.ClassJob);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Level => this.Struct->CharacterData.Level;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte[] Customize => this.Struct->DrawData.CustomizeData.Data.ToArray();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString CompanyTag => MemoryHelper.ReadSeString((nint)Unsafe.AsPointer(ref this.Struct->FreeCompanyTag[0]), 6);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target object ID of the character.
|
||||
/// </summary>
|
||||
public override ulong TargetObjectId => this.Struct->TargetId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint NameId => this.Struct->NameId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<OnlineStatus> OnlineStatus => new(this.Struct->CharacterData.OnlineStatus);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the status flags.
|
||||
/// </summary>
|
||||
public StatusFlags StatusFlags =>
|
||||
(this.Struct->IsHostile ? StatusFlags.Hostile : StatusFlags.None) |
|
||||
(this.Struct->InCombat ? StatusFlags.InCombat : StatusFlags.None) |
|
||||
(this.Struct->IsWeaponDrawn ? StatusFlags.WeaponOut : StatusFlags.None) |
|
||||
(this.Struct->IsOffhandDrawn ? StatusFlags.OffhandOut : StatusFlags.None) |
|
||||
(this.Struct->IsPartyMember ? StatusFlags.PartyMember : StatusFlags.None) |
|
||||
(this.Struct->IsAllianceMember ? StatusFlags.AllianceMember : StatusFlags.None) |
|
||||
(this.Struct->IsFriend ? StatusFlags.Friend : StatusFlags.None) |
|
||||
(this.Struct->IsCasting ? StatusFlags.IsCasting : StatusFlags.None);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the underlying structure.
|
||||
/// </summary>
|
||||
protected internal new FFXIVClientStructs.FFXIV.Client.Game.Character.Character* Struct =>
|
||||
(FFXIVClientStructs.FFXIV.Client.Game.Character.Character*)this.Address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a character.
|
||||
/// </summary>
|
||||
|
|
@ -179,3 +94,88 @@ public interface ICharacter : IGameObject
|
|||
/// </summary>
|
||||
public StatusFlags StatusFlags { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents the base for non-static entities.
|
||||
/// </summary>
|
||||
internal unsafe class Character : GameObject, ICharacter
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Character"/> class.
|
||||
/// This represents a non-static entity.
|
||||
/// </summary>
|
||||
/// <param name="address">The address of this character in memory.</param>
|
||||
internal Character(IntPtr address)
|
||||
: base(address)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentHp => this.Struct->CharacterData.Health;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxHp => this.Struct->CharacterData.MaxHealth;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentMp => this.Struct->CharacterData.Mana;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxMp => this.Struct->CharacterData.MaxMana;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentGp => this.Struct->CharacterData.GatheringPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxGp => this.Struct->CharacterData.MaxGatheringPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint CurrentCp => this.Struct->CharacterData.CraftingPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint MaxCp => this.Struct->CharacterData.MaxCraftingPoints;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte ShieldPercentage => this.Struct->CharacterData.ShieldValue;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<ClassJob> ClassJob => new(this.Struct->CharacterData.ClassJob);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Level => this.Struct->CharacterData.Level;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte[] Customize => this.Struct->DrawData.CustomizeData.Data.ToArray();
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString CompanyTag => MemoryHelper.ReadSeString((nint)Unsafe.AsPointer(ref this.Struct->FreeCompanyTag[0]), 6);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target object ID of the character.
|
||||
/// </summary>
|
||||
public override ulong TargetObjectId => this.Struct->TargetId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint NameId => this.Struct->NameId;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ExcelResolver<OnlineStatus> OnlineStatus => new(this.Struct->CharacterData.OnlineStatus);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the status flags.
|
||||
/// </summary>
|
||||
public StatusFlags StatusFlags =>
|
||||
(this.Struct->IsHostile ? StatusFlags.Hostile : StatusFlags.None) |
|
||||
(this.Struct->InCombat ? StatusFlags.InCombat : StatusFlags.None) |
|
||||
(this.Struct->IsWeaponDrawn ? StatusFlags.WeaponOut : StatusFlags.None) |
|
||||
(this.Struct->IsOffhandDrawn ? StatusFlags.OffhandOut : StatusFlags.None) |
|
||||
(this.Struct->IsPartyMember ? StatusFlags.PartyMember : StatusFlags.None) |
|
||||
(this.Struct->IsAllianceMember ? StatusFlags.AllianceMember : StatusFlags.None) |
|
||||
(this.Struct->IsFriend ? StatusFlags.Friend : StatusFlags.None) |
|
||||
(this.Struct->IsCasting ? StatusFlags.IsCasting : StatusFlags.None);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the underlying structure.
|
||||
/// </summary>
|
||||
protected internal new FFXIVClientStructs.FFXIV.Client.Game.Character.Character* Struct =>
|
||||
(FFXIVClientStructs.FFXIV.Client.Game.Character.Character*)this.Address;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,119 @@ using Dalamud.Memory;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Objects.Types;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a game object.
|
||||
/// </summary>
|
||||
public interface IGameObject : IEquatable<IGameObject>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public SeString Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GameObjectID for this GameObject. The Game Object ID is a globally unique identifier that points to
|
||||
/// this specific object. This ID is used to reference specific objects on the local client (e.g. for targeting).
|
||||
///
|
||||
/// Not to be confused with <see cref="EntityId"/>.
|
||||
/// </summary>
|
||||
public ulong GameObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Entity ID for this GameObject. Entity IDs are assigned to networked GameObjects.
|
||||
///
|
||||
/// A value of <c>0xE000_0000</c> indicates that this entity is not networked and has specific interactivity rules.
|
||||
/// </summary>
|
||||
public uint EntityId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data ID for linking to other respective game data.
|
||||
/// </summary>
|
||||
public uint DataId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ID of this GameObject's owner.
|
||||
/// </summary>
|
||||
public uint OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of this object in the object table.
|
||||
/// </summary>
|
||||
public ushort ObjectIndex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entity kind of this <see cref="GameObject" />.
|
||||
/// See <see cref="ObjectKind">the ObjectKind enum</see> for possible values.
|
||||
/// </summary>
|
||||
public ObjectKind ObjectKind { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sub kind of this Actor.
|
||||
/// </summary>
|
||||
public byte SubKind { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the X distance from the local player in yalms.
|
||||
/// </summary>
|
||||
public byte YalmDistanceX { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Y distance from the local player in yalms.
|
||||
/// </summary>
|
||||
public byte YalmDistanceZ { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the object is dead or alive.
|
||||
/// </summary>
|
||||
public bool IsDead { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the object is targetable.
|
||||
/// </summary>
|
||||
public bool IsTargetable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public Vector3 Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the rotation of this <see cref="GameObject" />.
|
||||
/// This ranges from -pi to pi radians.
|
||||
/// </summary>
|
||||
public float Rotation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hitbox radius of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public float HitboxRadius { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current target of the game object.
|
||||
/// </summary>
|
||||
public ulong TargetObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target object of the game object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
// TODO: Fix for non-networked GameObjects
|
||||
public IGameObject? TargetObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the game object in memory.
|
||||
/// </summary>
|
||||
public IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor is still valid in memory.
|
||||
/// </summary>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a GameObject in FFXIV.
|
||||
/// </summary>
|
||||
|
|
@ -22,15 +135,10 @@ internal partial class GameObject
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the game object in memory.
|
||||
/// Gets or sets the address of the game object in memory.
|
||||
/// </summary>
|
||||
public IntPtr Address { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Dalamud instance.
|
||||
/// </summary>
|
||||
private protected Dalamud Dalamud { get; }
|
||||
|
||||
/// <summary>
|
||||
/// This allows you to <c>if (obj) {...}</c> to check for validity.
|
||||
/// </summary>
|
||||
|
|
@ -148,116 +256,3 @@ internal unsafe partial class GameObject : IGameObject
|
|||
/// <inheritdoc/>
|
||||
public override string ToString() => $"{this.GameObjectId:X}({this.Name.TextValue} - {this.ObjectKind}) at {this.Address:X}";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a game object.
|
||||
/// </summary>
|
||||
public interface IGameObject : IEquatable<IGameObject>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the name of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public SeString Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the GameObjectID for this GameObject. The Game Object ID is a globally unique identifier that points to
|
||||
/// this specific object. This ID is used to reference specific objects on the local client (e.g. for targeting).
|
||||
///
|
||||
/// Not to be confused with <see cref="EntityId"/>.
|
||||
/// </summary>
|
||||
public ulong GameObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Entity ID for this GameObject. Entity IDs are assigned to networked GameObjects.
|
||||
///
|
||||
/// A value of <c>0xE000_0000</c> indicates that this entity is not networked and has specific interactivity rules.
|
||||
/// </summary>
|
||||
public uint EntityId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the data ID for linking to other respective game data.
|
||||
/// </summary>
|
||||
public uint DataId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the ID of this GameObject's owner.
|
||||
/// </summary>
|
||||
public uint OwnerId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the index of this object in the object table.
|
||||
/// </summary>
|
||||
public ushort ObjectIndex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the entity kind of this <see cref="GameObject" />.
|
||||
/// See <see cref="ObjectKind">the ObjectKind enum</see> for possible values.
|
||||
/// </summary>
|
||||
public ObjectKind ObjectKind { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sub kind of this Actor.
|
||||
/// </summary>
|
||||
public byte SubKind { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the X distance from the local player in yalms.
|
||||
/// </summary>
|
||||
public byte YalmDistanceX { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Y distance from the local player in yalms.
|
||||
/// </summary>
|
||||
public byte YalmDistanceZ { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the object is dead or alive.
|
||||
/// </summary>
|
||||
public bool IsDead { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the object is targetable.
|
||||
/// </summary>
|
||||
public bool IsTargetable { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public Vector3 Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the rotation of this <see cref="GameObject" />.
|
||||
/// This ranges from -pi to pi radians.
|
||||
/// </summary>
|
||||
public float Rotation { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the hitbox radius of this <see cref="GameObject" />.
|
||||
/// </summary>
|
||||
public float HitboxRadius { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current target of the game object.
|
||||
/// </summary>
|
||||
public ulong TargetObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target object of the game object.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
// TODO: Fix for non-networked GameObjects
|
||||
public IGameObject? TargetObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the game object in memory.
|
||||
/// </summary>
|
||||
public IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this actor is still valid in memory.
|
||||
/// </summary>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,95 @@ using Dalamud.Memory;
|
|||
|
||||
namespace Dalamud.Game.ClientState.Party;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a party member.
|
||||
/// </summary>
|
||||
public interface IPartyMember
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the address of this party member in memory.
|
||||
/// </summary>
|
||||
IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of buffs or debuffs applied to this party member.
|
||||
/// </summary>
|
||||
StatusList Statuses { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position of the party member.
|
||||
/// </summary>
|
||||
Vector3 Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content ID of the party member.
|
||||
/// </summary>
|
||||
long ContentId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor ID of this party member.
|
||||
/// </summary>
|
||||
uint ObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor associated with this buddy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
IGameObject? GameObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current HP of this party member.
|
||||
/// </summary>
|
||||
uint CurrentHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum HP of this party member.
|
||||
/// </summary>
|
||||
uint MaxHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current MP of this party member.
|
||||
/// </summary>
|
||||
ushort CurrentMP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum MP of this party member.
|
||||
/// </summary>
|
||||
ushort MaxMP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the territory this party member is located in.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> Territory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the World this party member resides in.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.World> World { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the displayname of this party member.
|
||||
/// </summary>
|
||||
SeString Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sex of this party member.
|
||||
/// </summary>
|
||||
byte Sex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the classjob of this party member.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.ClassJob> ClassJob { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the level of this party member.
|
||||
/// </summary>
|
||||
byte Level { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents a party member in the group manager.
|
||||
/// </summary>
|
||||
|
|
@ -109,92 +198,3 @@ internal unsafe class PartyMember : IPartyMember
|
|||
|
||||
private FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember* Struct => (FFXIVClientStructs.FFXIV.Client.Game.Group.PartyMember*)this.Address;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a party member.
|
||||
/// </summary>
|
||||
public interface IPartyMember
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the address of this party member in memory.
|
||||
/// </summary>
|
||||
IntPtr Address { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a list of buffs or debuffs applied to this party member.
|
||||
/// </summary>
|
||||
StatusList Statuses { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the position of the party member.
|
||||
/// </summary>
|
||||
Vector3 Position { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the content ID of the party member.
|
||||
/// </summary>
|
||||
long ContentId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor ID of this party member.
|
||||
/// </summary>
|
||||
uint ObjectId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the actor associated with this buddy.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// This iterates the actor table, it should be used with care.
|
||||
/// </remarks>
|
||||
IGameObject? GameObject { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current HP of this party member.
|
||||
/// </summary>
|
||||
uint CurrentHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum HP of this party member.
|
||||
/// </summary>
|
||||
uint MaxHP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the current MP of this party member.
|
||||
/// </summary>
|
||||
ushort CurrentMP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the maximum MP of this party member.
|
||||
/// </summary>
|
||||
ushort MaxMP { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the territory this party member is located in.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.TerritoryType> Territory { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the World this party member resides in.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.World> World { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the displayname of this party member.
|
||||
/// </summary>
|
||||
SeString Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the sex of this party member.
|
||||
/// </summary>
|
||||
byte Sex { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the classjob of this party member.
|
||||
/// </summary>
|
||||
ExcelResolver<Lumina.Excel.GeneratedSheets.ClassJob> ClassJob { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the level of this party member.
|
||||
/// </summary>
|
||||
byte Level { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,30 +1,5 @@
|
|||
namespace Dalamud.Game.Command;
|
||||
|
||||
/// <summary>
|
||||
/// This class describes a registered command.
|
||||
/// </summary>
|
||||
public sealed class CommandInfo : IReadOnlyCommandInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CommandInfo"/> class.
|
||||
/// Create a new CommandInfo with the provided handler.
|
||||
/// </summary>
|
||||
/// <param name="handler">The method to call when the command is run.</param>
|
||||
public CommandInfo(IReadOnlyCommandInfo.HandlerDelegate handler)
|
||||
{
|
||||
this.Handler = handler;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCommandInfo.HandlerDelegate Handler { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string HelpMessage { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool ShowInHelp { get; set; } = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a registered command.
|
||||
/// </summary>
|
||||
|
|
@ -52,3 +27,28 @@ public interface IReadOnlyCommandInfo
|
|||
/// </summary>
|
||||
bool ShowInHelp { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class describes a registered command.
|
||||
/// </summary>
|
||||
public sealed class CommandInfo : IReadOnlyCommandInfo
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="CommandInfo"/> class.
|
||||
/// Create a new CommandInfo with the provided handler.
|
||||
/// </summary>
|
||||
/// <param name="handler">The method to call when the command is run.</param>
|
||||
public CommandInfo(IReadOnlyCommandInfo.HandlerDelegate handler)
|
||||
{
|
||||
this.Handler = handler;
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCommandInfo.HandlerDelegate Handler { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public string HelpMessage { get; set; } = string.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool ShowInHelp { get; set; } = true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -114,22 +114,28 @@ internal sealed class CommandManager : IInternalDisposableService, ICommandManag
|
|||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool AddHandler(string command, CommandInfo info, string loaderAssemblyName = "")
|
||||
/// <summary>
|
||||
/// Add a command handler, which you can use to add your own custom commands to the in-game chat.
|
||||
/// </summary>
|
||||
/// <param name="command">The command to register.</param>
|
||||
/// <param name="info">A <see cref="CommandInfo"/> object describing the command.</param>
|
||||
/// <param name="loaderAssemblyName">Assembly name of the plugin that added this command.</param>
|
||||
/// <returns>If adding was successful.</returns>
|
||||
public bool AddHandler(string command, CommandInfo info, string loaderAssemblyName)
|
||||
{
|
||||
if (info == null)
|
||||
throw new ArgumentNullException(nameof(info), "Command handler is null.");
|
||||
|
||||
if (!this.commandMap.TryAdd(command, info))
|
||||
{
|
||||
Log.Error("Command {CommandName} is already registered.", command);
|
||||
Log.Error("Command {CommandName} is already registered", command);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!this.commandAssemblyNameMap.TryAdd((command, info), loaderAssemblyName))
|
||||
{
|
||||
this.commandMap.Remove(command, out _);
|
||||
Log.Error("Command {CommandName} is already registered in the assembly name map.", command);
|
||||
Log.Error("Command {CommandName} is already registered in the assembly name map", command);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -178,7 +184,7 @@ internal sealed class CommandManager : IInternalDisposableService, ICommandManag
|
|||
/// </summary>
|
||||
/// <param name="assemblyName">The name of the assembly.</param>
|
||||
/// <returns>A list of commands and their associated activation string.</returns>
|
||||
public List<KeyValuePair<(string, IReadOnlyCommandInfo), string>> GetHandlersByAssemblyName(string assemblyName)
|
||||
public List<KeyValuePair<(string Command, IReadOnlyCommandInfo CommandInfo), string>> GetHandlersByAssemblyName(string assemblyName)
|
||||
{
|
||||
return this.commandAssemblyNameMap.Where(c => c.Value == assemblyName).ToList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -111,6 +111,19 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name with the given prefix.
|
||||
/// </summary>
|
||||
/// <param name="menuItem">The menu item to prefix.</param>
|
||||
/// <returns>The prefixed name.</returns>
|
||||
internal SeString GetPrefixedName(IMenuItem menuItem) =>
|
||||
menuItem.Prefix is { } prefix
|
||||
? new SeStringBuilder()
|
||||
.AddUiForeground($"{prefix.ToIconString()} ", menuItem.PrefixColor)
|
||||
.Append(menuItem.Name)
|
||||
.Build()
|
||||
: menuItem.Name;
|
||||
|
||||
private AtkValue* ExpandContextMenuArray(Span<AtkValue> oldValues, int newSize)
|
||||
{
|
||||
// if the array has enough room, don't reallocate
|
||||
|
|
@ -253,17 +266,6 @@ internal sealed unsafe class ContextMenu : IInternalDisposableService, IContextM
|
|||
|
||||
offsetData[sizeHeaderIdx].UInt += (uint)items.Count;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name with the given prefix.
|
||||
/// </summary>
|
||||
internal SeString GetPrefixedName(IMenuItem menuItem) =>
|
||||
menuItem.Prefix is { } prefix
|
||||
? new SeStringBuilder()
|
||||
.AddUiForeground($"{prefix.ToIconString()} ", menuItem.PrefixColor)
|
||||
.Append(menuItem.Name)
|
||||
.Build()
|
||||
: menuItem.Name;
|
||||
|
||||
private void SetupContextMenu(IReadOnlyList<IMenuItem> items, ref int valueCount, ref AtkValue* values)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,6 +8,47 @@ using FFXIVClientStructs.FFXIV.Component.GUI;
|
|||
|
||||
namespace Dalamud.Game.Gui.ContextMenu;
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a context menus args.
|
||||
/// </summary>
|
||||
public interface IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a list of AtkEventInterface pointers associated with the context menu.
|
||||
/// Only available with <see cref="ContextMenuType.Default"/>.
|
||||
/// Almost always an agent pointer. You can use this to find out what type of context menu it is.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">Thrown when the context menu is not a <see cref="ContextMenuType.Default"/>.</exception>
|
||||
public IReadOnlySet<nint> EventInterfaces { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the addon that opened the context menu.
|
||||
/// </summary>
|
||||
public string? AddonName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the memory pointer of the addon that opened the context menu.
|
||||
/// </summary>
|
||||
public nint AddonPtr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the memory pointer of the agent that opened the context menu.
|
||||
/// </summary>
|
||||
public nint AgentPtr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the context menu.
|
||||
/// </summary>
|
||||
public ContextMenuType MenuType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target info of the context menu. The actual type depends on <see cref="MenuType"/>.
|
||||
/// <see cref="ContextMenuType.Default"/> signifies a <see cref="MenuTargetDefault"/>.
|
||||
/// <see cref="ContextMenuType.Inventory"/> signifies a <see cref="MenuTargetInventory"/>.
|
||||
/// </summary>
|
||||
public MenuTarget Target { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Base class for <see cref="IContextMenu"/> menu args.
|
||||
/// </summary>
|
||||
|
|
@ -68,44 +109,3 @@ internal abstract unsafe class MenuArgs : IMenuArgs
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a context menus args.
|
||||
/// </summary>
|
||||
public interface IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a list of AtkEventInterface pointers associated with the context menu.
|
||||
/// Only available with <see cref="ContextMenuType.Default"/>.
|
||||
/// Almost always an agent pointer. You can use this to find out what type of context menu it is.
|
||||
/// </summary>
|
||||
/// <exception cref="InvalidOperationException">Thrown when the context menu is not a <see cref="ContextMenuType.Default"/>.</exception>
|
||||
public IReadOnlySet<nint> EventInterfaces { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of the addon that opened the context menu.
|
||||
/// </summary>
|
||||
public string? AddonName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the memory pointer of the addon that opened the context menu.
|
||||
/// </summary>
|
||||
public nint AddonPtr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the memory pointer of the agent that opened the context menu.
|
||||
/// </summary>
|
||||
public nint AgentPtr { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the type of the context menu.
|
||||
/// </summary>
|
||||
public ContextMenuType MenuType { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the target info of the context menu. The actual type depends on <see cref="MenuType"/>.
|
||||
/// <see cref="ContextMenuType.Default"/> signifies a <see cref="MenuTargetDefault"/>.
|
||||
/// <see cref="ContextMenuType.Inventory"/> signifies a <see cref="MenuTargetInventory"/>.
|
||||
/// </summary>
|
||||
public MenuTarget Target { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,58 +5,6 @@ using Lumina.Excel.GeneratedSheets;
|
|||
|
||||
namespace Dalamud.Game.Gui.ContextMenu;
|
||||
|
||||
/// <summary>
|
||||
/// A menu item that can be added to a context menu.
|
||||
/// </summary>
|
||||
public sealed record MenuItem : IMenuItem
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public SeString Name { get; set; } = SeString.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeIconChar? Prefix { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public char? PrefixChar
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value is { } prefix)
|
||||
{
|
||||
if (!char.IsAsciiLetterUpper(prefix))
|
||||
throw new ArgumentException("Prefix must be an uppercase letter", nameof(value));
|
||||
|
||||
this.Prefix = SeIconChar.BoxedLetterA + prefix - 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Prefix = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort PrefixColor { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool UseDefaultPrefix { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Action<IMenuItemClickedArgs>? OnClicked { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int Priority { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSubmenu { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsReturn { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Interface representing a menu item to be added to a context menu.
|
||||
/// </summary>
|
||||
|
|
@ -129,3 +77,55 @@ public interface IMenuItem
|
|||
/// </summary>
|
||||
bool IsReturn { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A menu item that can be added to a context menu.
|
||||
/// </summary>
|
||||
public sealed record MenuItem : IMenuItem
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public SeString Name { get; set; } = SeString.Empty;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeIconChar? Prefix { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public char? PrefixChar
|
||||
{
|
||||
set
|
||||
{
|
||||
if (value is { } prefix)
|
||||
{
|
||||
if (!char.IsAsciiLetterUpper(prefix))
|
||||
throw new ArgumentException("Prefix must be an uppercase letter", nameof(value));
|
||||
|
||||
this.Prefix = SeIconChar.BoxedLetterA + prefix - 'A';
|
||||
}
|
||||
else
|
||||
{
|
||||
this.Prefix = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort PrefixColor { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool UseDefaultPrefix { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Action<IMenuItemClickedArgs>? OnClicked { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public int Priority { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsEnabled { get; set; } = true;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsSubmenu { get; set; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool IsReturn { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,25 @@ using FFXIVClientStructs.FFXIV.Component.GUI;
|
|||
|
||||
namespace Dalamud.Game.Gui.ContextMenu;
|
||||
|
||||
/// <summary>
|
||||
/// An interface representing the callback args used when a menu item is clicked.
|
||||
/// </summary>
|
||||
public interface IMenuItemClickedArgs : IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Opens a submenu with the given name and items.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the submenu, displayed at the top.</param>
|
||||
/// <param name="items">The items to display in the submenu.</param>
|
||||
void OpenSubmenu(SeString name, IReadOnlyList<IMenuItem> items);
|
||||
|
||||
/// <summary>
|
||||
/// Opens a submenu with the given items.
|
||||
/// </summary>
|
||||
/// <param name="items">The items to display in the submenu.</param>
|
||||
void OpenSubmenu(IReadOnlyList<IMenuItem> items);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Callback args used when a menu item is clicked.
|
||||
/// </summary>
|
||||
|
|
@ -36,22 +55,3 @@ internal sealed unsafe class MenuItemClickedArgs : MenuArgs, IMenuItemClickedArg
|
|||
public void OpenSubmenu(IReadOnlyList<IMenuItem> items) =>
|
||||
this.OnOpenSubmenu(null, items);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An interface representing the callback args used when a menu item is clicked.
|
||||
/// </summary>
|
||||
public interface IMenuItemClickedArgs : IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Opens a submenu with the given name and items.
|
||||
/// </summary>
|
||||
/// <param name="name">The name of the submenu, displayed at the top.</param>
|
||||
/// <param name="items">The items to display in the submenu.</param>
|
||||
void OpenSubmenu(SeString name, IReadOnlyList<IMenuItem> items);
|
||||
|
||||
/// <summary>
|
||||
/// Opens a submenu with the given items.
|
||||
/// </summary>
|
||||
/// <param name="items">The items to display in the submenu.</param>
|
||||
void OpenSubmenu(IReadOnlyList<IMenuItem> items);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,18 @@ using FFXIVClientStructs.FFXIV.Component.GUI;
|
|||
|
||||
namespace Dalamud.Game.Gui.ContextMenu;
|
||||
|
||||
/// <summary>
|
||||
/// An interface representing the callback args used when a menu item is opened.
|
||||
/// </summary>
|
||||
public interface IMenuOpenedArgs : IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a custom menu item to the context menu.
|
||||
/// </summary>
|
||||
/// <param name="item">The menu item to add.</param>
|
||||
void AddMenuItem(MenuItem item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Callback args used when a menu item is opened.
|
||||
/// </summary>
|
||||
|
|
@ -30,15 +42,3 @@ internal sealed unsafe class MenuOpenedArgs : MenuArgs, IMenuOpenedArgs
|
|||
public void AddMenuItem(MenuItem item) =>
|
||||
this.OnAddMenuItem(item);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An interface representing the callback args used when a menu item is opened.
|
||||
/// </summary>
|
||||
public interface IMenuOpenedArgs : IMenuArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Adds a custom menu item to the context menu.
|
||||
/// </summary>
|
||||
/// <param name="item">The menu item to add.</param>
|
||||
void AddMenuItem(MenuItem item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,156 +9,6 @@ using Lumina.Excel.GeneratedSheets;
|
|||
|
||||
namespace Dalamud.Game.Gui.PartyFinder.Types;
|
||||
|
||||
/// <summary>
|
||||
/// A single listing in party finder.
|
||||
/// </summary>
|
||||
internal class PartyFinderListing : IPartyFinderListing
|
||||
{
|
||||
private readonly byte objective;
|
||||
private readonly byte conditions;
|
||||
private readonly byte dutyFinderSettings;
|
||||
private readonly byte lootRules;
|
||||
private readonly byte searchArea;
|
||||
private readonly PartyFinderSlot[] slots;
|
||||
private readonly byte[] jobsPresent;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PartyFinderListing"/> class.
|
||||
/// </summary>
|
||||
/// <param name="listing">The interop listing data.</param>
|
||||
internal PartyFinderListing(PartyFinderPacketListing listing)
|
||||
{
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
|
||||
this.objective = listing.Objective;
|
||||
this.conditions = listing.Conditions;
|
||||
this.dutyFinderSettings = listing.DutyFinderSettings;
|
||||
this.lootRules = listing.LootRules;
|
||||
this.searchArea = listing.SearchArea;
|
||||
this.slots = listing.Slots.Select(accepting => new PartyFinderSlot(accepting)).ToArray();
|
||||
this.jobsPresent = listing.JobsPresent;
|
||||
|
||||
this.Id = listing.Id;
|
||||
this.ContentIdLower = listing.ContentIdLower;
|
||||
this.Name = SeString.Parse(listing.Name.TakeWhile(b => b != 0).ToArray());
|
||||
this.Description = SeString.Parse(listing.Description.TakeWhile(b => b != 0).ToArray());
|
||||
this.World = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.World));
|
||||
this.HomeWorld = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.HomeWorld));
|
||||
this.CurrentWorld = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.CurrentWorld));
|
||||
this.Category = (DutyCategory)listing.Category;
|
||||
this.RawDuty = listing.Duty;
|
||||
this.Duty = new Lazy<ContentFinderCondition>(() => dataManager.GetExcelSheet<ContentFinderCondition>().GetRow(listing.Duty));
|
||||
this.DutyType = (DutyType)listing.DutyType;
|
||||
this.BeginnersWelcome = listing.BeginnersWelcome == 1;
|
||||
this.SecondsRemaining = listing.SecondsRemaining;
|
||||
this.MinimumItemLevel = listing.MinimumItemLevel;
|
||||
this.Parties = listing.NumParties;
|
||||
this.SlotsAvailable = listing.NumSlots;
|
||||
this.LastPatchHotfixTimestamp = listing.LastPatchHotfixTimestamp;
|
||||
this.JobsPresent = listing.JobsPresent
|
||||
.Select(id => new Lazy<ClassJob>(
|
||||
() => id == 0
|
||||
? null
|
||||
: dataManager.GetExcelSheet<ClassJob>().GetRow(id)))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Id { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint ContentIdLower { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Name { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Description { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> World { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> HomeWorld { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> CurrentWorld { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyCategory Category { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort RawDuty { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<ContentFinderCondition> Duty { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyType DutyType { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool BeginnersWelcome { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort SecondsRemaining { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort MinimumItemLevel { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Parties { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte SlotsAvailable { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint LastPatchHotfixTimestamp { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<PartyFinderSlot> Slots => this.slots;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ObjectiveFlags Objective => (ObjectiveFlags)this.objective;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ConditionFlags Conditions => (ConditionFlags)this.conditions;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyFinderSettingsFlags DutyFinderSettings => (DutyFinderSettingsFlags)this.dutyFinderSettings;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public LootRuleFlags LootRules => (LootRuleFlags)this.lootRules;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SearchAreaFlags SearchArea => (SearchAreaFlags)this.searchArea;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<byte> RawJobsPresent => this.jobsPresent;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<Lazy<ClassJob>> JobsPresent { get; }
|
||||
|
||||
#region Indexers
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[ObjectiveFlags flag] => this.objective == 0 || (this.objective & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[ConditionFlags flag] => this.conditions == 0 || (this.conditions & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[DutyFinderSettingsFlags flag] => this.dutyFinderSettings == 0 || (this.dutyFinderSettings & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[LootRuleFlags flag] => this.lootRules == 0 || (this.lootRules & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[SearchAreaFlags flag] => this.searchArea == 0 || (this.searchArea & (uint)flag) > 0;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing a single listing in party finder.
|
||||
/// </summary>
|
||||
|
|
@ -327,3 +177,153 @@ public interface IPartyFinderListing
|
|||
/// <returns>A value indicating whether the flag is present.</returns>
|
||||
bool this[SearchAreaFlags flag] { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A single listing in party finder.
|
||||
/// </summary>
|
||||
internal class PartyFinderListing : IPartyFinderListing
|
||||
{
|
||||
private readonly byte objective;
|
||||
private readonly byte conditions;
|
||||
private readonly byte dutyFinderSettings;
|
||||
private readonly byte lootRules;
|
||||
private readonly byte searchArea;
|
||||
private readonly PartyFinderSlot[] slots;
|
||||
private readonly byte[] jobsPresent;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="PartyFinderListing"/> class.
|
||||
/// </summary>
|
||||
/// <param name="listing">The interop listing data.</param>
|
||||
internal PartyFinderListing(PartyFinderPacketListing listing)
|
||||
{
|
||||
var dataManager = Service<DataManager>.Get();
|
||||
|
||||
this.objective = listing.Objective;
|
||||
this.conditions = listing.Conditions;
|
||||
this.dutyFinderSettings = listing.DutyFinderSettings;
|
||||
this.lootRules = listing.LootRules;
|
||||
this.searchArea = listing.SearchArea;
|
||||
this.slots = listing.Slots.Select(accepting => new PartyFinderSlot(accepting)).ToArray();
|
||||
this.jobsPresent = listing.JobsPresent;
|
||||
|
||||
this.Id = listing.Id;
|
||||
this.ContentIdLower = listing.ContentIdLower;
|
||||
this.Name = SeString.Parse(listing.Name.TakeWhile(b => b != 0).ToArray());
|
||||
this.Description = SeString.Parse(listing.Description.TakeWhile(b => b != 0).ToArray());
|
||||
this.World = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.World));
|
||||
this.HomeWorld = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.HomeWorld));
|
||||
this.CurrentWorld = new Lazy<World>(() => dataManager.GetExcelSheet<World>().GetRow(listing.CurrentWorld));
|
||||
this.Category = (DutyCategory)listing.Category;
|
||||
this.RawDuty = listing.Duty;
|
||||
this.Duty = new Lazy<ContentFinderCondition>(() => dataManager.GetExcelSheet<ContentFinderCondition>().GetRow(listing.Duty));
|
||||
this.DutyType = (DutyType)listing.DutyType;
|
||||
this.BeginnersWelcome = listing.BeginnersWelcome == 1;
|
||||
this.SecondsRemaining = listing.SecondsRemaining;
|
||||
this.MinimumItemLevel = listing.MinimumItemLevel;
|
||||
this.Parties = listing.NumParties;
|
||||
this.SlotsAvailable = listing.NumSlots;
|
||||
this.LastPatchHotfixTimestamp = listing.LastPatchHotfixTimestamp;
|
||||
this.JobsPresent = listing.JobsPresent
|
||||
.Select(id => new Lazy<ClassJob>(
|
||||
() => id == 0
|
||||
? null
|
||||
: dataManager.GetExcelSheet<ClassJob>().GetRow(id)))
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint Id { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint ContentIdLower { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Name { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SeString Description { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> World { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> HomeWorld { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<World> CurrentWorld { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyCategory Category { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort RawDuty { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public Lazy<ContentFinderCondition> Duty { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyType DutyType { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool BeginnersWelcome { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort SecondsRemaining { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ushort MinimumItemLevel { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte Parties { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public byte SlotsAvailable { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public uint LastPatchHotfixTimestamp { get; }
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<PartyFinderSlot> Slots => this.slots;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ObjectiveFlags Objective => (ObjectiveFlags)this.objective;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public ConditionFlags Conditions => (ConditionFlags)this.conditions;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public DutyFinderSettingsFlags DutyFinderSettings => (DutyFinderSettingsFlags)this.dutyFinderSettings;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public LootRuleFlags LootRules => (LootRuleFlags)this.lootRules;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public SearchAreaFlags SearchArea => (SearchAreaFlags)this.searchArea;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<byte> RawJobsPresent => this.jobsPresent;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public IReadOnlyCollection<Lazy<ClassJob>> JobsPresent { get; }
|
||||
|
||||
#region Indexers
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[ObjectiveFlags flag] => this.objective == 0 || (this.objective & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[ConditionFlags flag] => this.conditions == 0 || (this.conditions & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[DutyFinderSettingsFlags flag] => this.dutyFinderSettings == 0 || (this.dutyFinderSettings & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[LootRuleFlags flag] => this.lootRules == 0 || (this.lootRules & (uint)flag) > 0;
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool this[SearchAreaFlags flag] => this.searchArea == 0 || (this.searchArea & (uint)flag) > 0;
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,21 @@
|
|||
namespace Dalamud.Game.Gui.PartyFinder.Types;
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing additional arguments passed by the game.
|
||||
/// </summary>
|
||||
public interface IPartyFinderListingEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the batch number.
|
||||
/// </summary>
|
||||
int BatchNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the listing is visible.
|
||||
/// </summary>
|
||||
bool Visible { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class represents additional arguments passed by the game.
|
||||
/// </summary>
|
||||
|
|
@ -20,19 +36,3 @@ internal class PartyFinderListingEventArgs : IPartyFinderListingEventArgs
|
|||
/// <inheritdoc/>
|
||||
public bool Visible { get; set; } = true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing additional arguments passed by the game.
|
||||
/// </summary>
|
||||
public interface IPartyFinderListingEventArgs
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the batch number.
|
||||
/// </summary>
|
||||
int BatchNumber { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether the listing is visible.
|
||||
/// </summary>
|
||||
bool Visible { get; set; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,6 +54,7 @@ internal class UniversalisMarketBoardUploader : IMarketBoardUploader
|
|||
|
||||
foreach (var marketBoardItemListing in request.Listings)
|
||||
{
|
||||
#pragma warning disable CS0618 // Type or member is obsolete
|
||||
var universalisListing = new UniversalisItemListingsEntry
|
||||
{
|
||||
ListingId = marketBoardItemListing.ListingId.ToString(),
|
||||
|
|
@ -70,6 +71,7 @@ internal class UniversalisMarketBoardUploader : IMarketBoardUploader
|
|||
RetainerCity = marketBoardItemListing.RetainerCityId,
|
||||
Materia = new List<UniversalisItemMateria>(),
|
||||
};
|
||||
#pragma warning restore CS0618 // Type or member is obsolete
|
||||
|
||||
foreach (var itemMateria in marketBoardItemListing.Materia)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -138,12 +138,6 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings
|
|||
/// </summary>
|
||||
public uint ItemQuantity { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the time this offering was last reviewed.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, contains a fake value", false)]
|
||||
internal DateTime LastReviewTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the listing ID.
|
||||
/// </summary>
|
||||
|
|
@ -164,12 +158,6 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings
|
|||
/// </summary>
|
||||
public bool OnMannequin { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the player name.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, contains a fake value", false)]
|
||||
internal string PlayerName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the price per unit.
|
||||
/// </summary>
|
||||
|
|
@ -195,12 +183,6 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings
|
|||
/// </summary>
|
||||
public ulong RetainerOwnerId { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the stain or applied dye of the item.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, use Stain1Id and Stain2Id", false)]
|
||||
internal int StainId => (this.Stain2Id << 8) | this.Stain1Id;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the first stain or applied dye of the item.
|
||||
/// </summary>
|
||||
|
|
@ -215,6 +197,24 @@ public class MarketBoardCurrentOfferings : IMarketBoardCurrentOfferings
|
|||
/// Gets the total tax.
|
||||
/// </summary>
|
||||
public uint TotalTax { get; internal set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the time this offering was last reviewed.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, contains a fake value", false)]
|
||||
internal DateTime LastReviewTime { get; set; } = DateTime.UtcNow;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the stain or applied dye of the item.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, use Stain1Id and Stain2Id", false)]
|
||||
internal int StainId => (this.Stain2Id << 8) | this.Stain1Id;
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the player name.
|
||||
/// </summary>
|
||||
[Obsolete("Universalis Compatibility, contains a fake value", false)]
|
||||
internal string PlayerName { get; set; } = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// This represents the materia slotted to an <see cref="MarketBoardItemListing"/>.
|
||||
|
|
|
|||
|
|
@ -97,6 +97,8 @@ internal sealed class ChangelogWindow : Window, IDisposable
|
|||
/// <param name="tsmWindow">TSM window.</param>
|
||||
/// <param name="fontAtlasFactory">An instance of <see cref="FontAtlasFactory"/>.</param>
|
||||
/// <param name="assets">An instance of <see cref="DalamudAssetManager"/>.</param>
|
||||
/// <param name="gameGui">An instance of <see cref="GameGui"/>.</param>
|
||||
/// <param name="framework">An instance of <see cref="Framework"/>.</param>
|
||||
public ChangelogWindow(
|
||||
TitleScreenMenuWindow tsmWindow,
|
||||
FontAtlasFactory fontAtlasFactory,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
using System.IO;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
using Dalamud.Interface.Internal;
|
||||
using Dalamud.Interface.Textures.TextureWraps;
|
||||
|
||||
namespace Dalamud.Interface.Textures.Internal.SharedImmediateTextures;
|
||||
|
|
@ -19,7 +19,10 @@ internal sealed class FileSystemSharedImmediateTexture : SharedImmediateTexture
|
|||
/// <summary>Creates a new placeholder instance of <see cref="GamePathSharedImmediateTexture"/>.</summary>
|
||||
/// <param name="path">The path.</param>
|
||||
/// <returns>The new instance.</returns>
|
||||
/// <remarks>Only to be used from <see cref="TextureManager.SharedTextureManager.GetFromFile"/>.</remarks>
|
||||
/// <remarks>
|
||||
/// Only to be used from <see cref="TextureManager.SharedTextureManager.GetFromFile(string)"/> or
|
||||
/// <see cref="TextureManager.SharedTextureManager.GetFromFile(FileInfo)"/>.
|
||||
/// </remarks>
|
||||
public static SharedImmediateTexture CreatePlaceholder(string path) => new FileSystemSharedImmediateTexture(path);
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
|
|
|||
|
|
@ -9,6 +9,64 @@ using Dalamud.Interface.Textures.TextureWraps;
|
|||
|
||||
namespace Dalamud.Interface;
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing an entry in the title screen menu.
|
||||
/// </summary>
|
||||
public interface ITitleScreenMenuEntry : IReadOnlyTitleScreenMenuEntry, IComparable<TitleScreenMenuEntry>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not this entry is internal.
|
||||
/// </summary>
|
||||
bool IsInternal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the calling assembly of this entry.
|
||||
/// </summary>
|
||||
Assembly? CallingAssembly { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal ID of this entry.
|
||||
/// </summary>
|
||||
Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keys that have to be pressed to show the menu.
|
||||
/// </summary>
|
||||
IReadOnlySet<VirtualKey> ShowConditionKeys { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines the displaying condition of this menu entry is met.
|
||||
/// </summary>
|
||||
/// <returns>True if met.</returns>
|
||||
bool IsShowConditionSatisfied();
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the action associated with this entry.
|
||||
/// </summary>
|
||||
void Trigger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing a read only entry in the title screen menu.
|
||||
/// </summary>
|
||||
public interface IReadOnlyTitleScreenMenuEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the priority of this entry.
|
||||
/// </summary>
|
||||
ulong Priority { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of this entry.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the texture of this entry.
|
||||
/// </summary>
|
||||
IDalamudTextureWrap Texture { get; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Class representing an entry in the title screen menu.
|
||||
/// </summary>
|
||||
|
|
@ -103,61 +161,3 @@ public class TitleScreenMenuEntry : ITitleScreenMenuEntry
|
|||
this.onTriggered();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing an entry in the title screen menu.
|
||||
/// </summary>
|
||||
public interface ITitleScreenMenuEntry : IReadOnlyTitleScreenMenuEntry, IComparable<TitleScreenMenuEntry>
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether or not this entry is internal.
|
||||
/// </summary>
|
||||
bool IsInternal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the calling assembly of this entry.
|
||||
/// </summary>
|
||||
Assembly? CallingAssembly { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the internal ID of this entry.
|
||||
/// </summary>
|
||||
Guid Id { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the keys that have to be pressed to show the menu.
|
||||
/// </summary>
|
||||
IReadOnlySet<VirtualKey> ShowConditionKeys { get; init; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines the displaying condition of this menu entry is met.
|
||||
/// </summary>
|
||||
/// <returns>True if met.</returns>
|
||||
bool IsShowConditionSatisfied();
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the action associated with this entry.
|
||||
/// </summary>
|
||||
void Trigger();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A interface representing a read only entry in the title screen menu.
|
||||
/// </summary>
|
||||
public interface IReadOnlyTitleScreenMenuEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the priority of this entry.
|
||||
/// </summary>
|
||||
ulong Priority { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the name of this entry.
|
||||
/// </summary>
|
||||
string Name { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the texture of this entry.
|
||||
/// </summary>
|
||||
IDalamudTextureWrap Texture { get; }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,9 +72,9 @@ internal static class PluginValidator
|
|||
|
||||
var cmdManager = Service<CommandManager>.Get();
|
||||
|
||||
foreach (var cmd in cmdManager.GetHandlersByAssemblyName(plugin.InternalName).Where(c => c.Key.Item2.ShowInHelp))
|
||||
foreach (var cmd in cmdManager.GetHandlersByAssemblyName(plugin.InternalName).Where(c => c.Key.CommandInfo.ShowInHelp))
|
||||
{
|
||||
if (string.IsNullOrEmpty(cmd.Key.Item2.HelpMessage))
|
||||
if (string.IsNullOrEmpty(cmd.Key.CommandInfo.HelpMessage))
|
||||
problems.Add(new CommandWithoutHelpTextProblem(cmd.Value));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,6 @@ public interface IFateTable : IReadOnlyCollection<IFate>
|
|||
/// Gets the amount of currently active Fates.
|
||||
/// </summary>
|
||||
public int Length { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this Fate is still valid in memory.
|
||||
/// </summary>
|
||||
/// <param name="fate">The fate to check.</param>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid(IFate fate);
|
||||
|
||||
/// <summary>
|
||||
/// Get an actor at the specified spawn index.
|
||||
|
|
@ -33,6 +26,13 @@ public interface IFateTable : IReadOnlyCollection<IFate>
|
|||
/// <returns>A <see cref="Fate"/> at the specified spawn index.</returns>
|
||||
public IFate? this[int index] { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether this Fate is still valid in memory.
|
||||
/// </summary>
|
||||
/// <param name="fate">The fate to check.</param>
|
||||
/// <returns>True or false.</returns>
|
||||
public bool IsValid(IFate fate);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the address of the Fate at the specified index of the fate table.
|
||||
/// </summary>wo
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ public interface ITextureProvider
|
|||
/// <remarks>
|
||||
/// <para>The following functions support the files of the container types pointed by yielded values.</para>
|
||||
/// <ul>
|
||||
/// <li><see cref="GetFromFile"/></li>
|
||||
/// <li><see cref="GetFromFile(string)"/> and <see cref="GetFromFile(FileInfo)"/></li>
|
||||
/// <li><see cref="GetFromManifestResource"/></li>
|
||||
/// <li><see cref="CreateFromImageAsync(ReadOnlyMemory{byte},string?,CancellationToken)"/></li>
|
||||
/// <li><see cref="CreateFromImageAsync(Stream,bool,string?,CancellationToken)"/></li>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue