Add support for PCT and VPR to Dalamud.Game.ClientState.JobGauge (#1890)

Added PCTGauge and VPRGauge to the job gauge definitions. Also updated JobGauge widget to support VPR and PCT.
This commit is contained in:
NostraThomas99 2024-07-05 03:28:24 -05:00 committed by GitHub
parent 680fdccf9d
commit 9d9326fd6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 216 additions and 0 deletions

View file

@ -0,0 +1,37 @@
namespace Dalamud.Game.ClientState.JobGauge.Enums;
/// <summary>
/// Represents the flags for the canvas in the job gauge.
/// </summary>
public enum CanvasFlags : byte
{
/// <summary>
/// Represents the Pom flag for the canvas in the job gauge.
/// </summary>
Pom = 1,
/// <summary>
/// Represents the Wing canvas flag in the job gauge.
/// </summary>
Wing = 2,
/// <summary>
/// Represents the flag for the claw in the canvas of the job gauge.
/// </summary>
Claw = 4,
/// <summary>
/// Represents the 'Maw' flag for the canvas in the job gauge.
/// </summary>
Maw = 8,
/// <summary>
/// Represents the weapon flag for the canvas in the job gauge.
/// </summary>
Weapon = 16,
/// <summary>
/// Represents the Landscape flag for the canvas in the job gauge.
/// </summary>
Landscape = 32,
}

View file

@ -0,0 +1,32 @@
namespace Dalamud.Game.ClientState.JobGauge.Enums;
/// <summary>
/// Which creature flags are present on the gauge.
/// </summary>
public enum CreatureFlags : byte
{
/// <summary>
/// Pom flag present
/// </summary>
Pom = 1,
/// <summary>
/// Wings flag present
/// </summary>
Wings = 2,
/// <summary>
/// Claw flag present
/// </summary>
Claw = 4,
/// <summary>
/// Moogle portrait present
/// </summary>
MooglePortait = 16,
/// <summary>
/// Madeen portrait present
/// </summary>
MadeenPortrait = 32,
}

View file

@ -0,0 +1,37 @@
namespace Dalamud.Game.ClientState.JobGauge.Enums;
/// <summary>
/// Enum representing the DreadCombo actions for the VPR job gauge.
/// </summary>
public enum DreadCombo : byte
{
/// <summary>
/// Dreadwinder action.
/// </summary>
Dreadwinder = 1,
/// <summary>
/// Hunters Coil Action.
/// </summary>
HuntersCoil = 2,
/// <summary>
/// Swiftskins Coil Action.
/// </summary>
SwiftskinsCoil = 3,
/// <summary>
/// PitOfDread action.
/// </summary>
PitOfDread = 4,
/// <summary>
/// HuntersDen action.
/// </summary>
HuntersDen = 5,
/// <summary>
/// Swiftskins Den action.
/// </summary>
SwiftskinsDen = 6,
}

View file

@ -0,0 +1,66 @@
using FFXIVClientStructs.FFXIV.Client.Game.Gauge;
using CanvasFlags = Dalamud.Game.ClientState.JobGauge.Enums.CanvasFlags;
using CreatureFlags = Dalamud.Game.ClientState.JobGauge.Enums.CreatureFlags;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>
/// In-Memory PCT job gauge.
/// </summary>
public unsafe class PCTGauge : JobGaugeBase<PictomancerGauge>
{
/// <summary>
/// Initializes a new instance of the <see cref="PCTGauge"/> class.
/// </summary>
/// <param name="address">Address of the job gauge.</param>
internal PCTGauge(IntPtr address)
: base(address)
{
}
/// <summary>
/// Tracks use of subjective pallete
/// </summary>
public byte PalleteGauge => Struct->PalleteGauge;
/// <summary>
/// Number of paint the player has.
/// </summary>
public byte Paint => Struct->Paint;
/// <summary>
/// Creature Motif Stack
/// </summary>
public bool CreatureMotifDrawn => Struct->CreatureMotifDrawn;
/// <summary>
/// Weapon Motif Stack
/// </summary>
public bool WeaponMotifDrawn => Struct->WeaponMotifDrawn;
/// <summary>
/// Landscape Motif Stack
/// </summary>
public bool LandscapeMotifDrawn => Struct->LandscapeMotifDrawn;
/// <summary>
/// Moogle Portrait Stack
/// </summary>
public bool MooglePortraitReady => Struct->MooglePortraitReady;
/// <summary>
/// Madeen Portrait Stack
/// </summary>
public bool MadeenPortraitReady => Struct->MadeenPortraitReady;
/// <summary>
/// Which creature flags are present.
/// </summary>
public CreatureFlags CreatureFlags => (CreatureFlags)Struct->CreatureFlags;
/// <summary>
/// Which canvas flags are present.
/// </summary>
public CanvasFlags CanvasFlags => (CanvasFlags)Struct->CanvasFlags;
}

View file

@ -0,0 +1,42 @@
using FFXIVClientStructs.FFXIV.Client.Game.Gauge;
using Reloaded.Memory;
using DreadCombo = Dalamud.Game.ClientState.JobGauge.Enums.DreadCombo;
namespace Dalamud.Game.ClientState.JobGauge.Types;
/// <summary>
/// In-memory VPR job gauge.
/// </summary>
public unsafe class VPRGauge : JobGaugeBase<ViperGauge>
{
/// <summary>
/// Initializes a new instance of the <see cref="VPRGauge"/> class.
/// </summary>
/// <param name="address">Address of the job gauge.</param>
internal VPRGauge(IntPtr address)
: base(address)
{
}
/// <summary>
/// How many uses of uncoiled fury the player has.
/// </summary>
public byte RattlingCoilStacks => Struct->RattlingCoilStacks;
/// <summary>
/// Tracks AnguineTribute stacks and gauge.
/// </summary>
public byte SerpentOffering => Struct->SerpentOffering;
/// <summary>
/// Allows the use of 1st, 2nd, 3rd, 4th generation and Ouroboros.
/// </summary>
public byte AnguineTribute => Struct->AnguineTribute;
/// <summary>
/// Keeps track of last Weaponskill used in DreadWinder/Pit of Dread combo.
/// </summary>
public DreadCombo DreadCombo => (DreadCombo)Struct->DreadCombo;
}

View file

@ -61,6 +61,8 @@ internal class GaugeWidget : IDataWindowWidget
38 => jobGauges.Get<DNCGauge>(),
39 => jobGauges.Get<RPRGauge>(),
40 => jobGauges.Get<SGEGauge>(),
41 => jobGauges.Get<VPRGauge>(),
42 => jobGauges.Get<PCTGauge>(),
_ => null,
};