Skip to content

Commit

Permalink
Add support for PCT and VPR to Dalamud.Game.ClientState.JobGauge (#1890)
Browse files Browse the repository at this point in the history
Added PCTGauge and VPRGauge to the job gauge definitions. Also updated JobGauge widget to support VPR and PCT.
  • Loading branch information
NostraThomas99 authored Jul 5, 2024
1 parent 680fdcc commit 9d9326f
Show file tree
Hide file tree
Showing 6 changed files with 216 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Dalamud/Game/ClientState/JobGauge/Enums/CanvasFlags.cs
Original file line number Diff line number Diff line change
@@ -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,
}
32 changes: 32 additions & 0 deletions Dalamud/Game/ClientState/JobGauge/Enums/CreatureFlags.cs
Original file line number Diff line number Diff line change
@@ -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,
}
37 changes: 37 additions & 0 deletions Dalamud/Game/ClientState/JobGauge/Enums/DreadCombo.cs
Original file line number Diff line number Diff line change
@@ -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,
}
66 changes: 66 additions & 0 deletions Dalamud/Game/ClientState/JobGauge/Types/PCTGauge.cs
Original file line number Diff line number Diff line change
@@ -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;
}
42 changes: 42 additions & 0 deletions Dalamud/Game/ClientState/JobGauge/Types/VPRGauge.cs
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ public void Draw()
38 => jobGauges.Get<DNCGauge>(),
39 => jobGauges.Get<RPRGauge>(),
40 => jobGauges.Get<SGEGauge>(),
41 => jobGauges.Get<VPRGauge>(),
42 => jobGauges.Get<PCTGauge>(),
_ => null,
};

Expand Down

0 comments on commit 9d9326f

Please sign in to comment.