From a5cccf8a763179f3c49642cc9df5d5f3eb494722 Mon Sep 17 00:00:00 2001 From: Raymond Date: Tue, 10 Aug 2021 17:32:03 -0400 Subject: [PATCH] Job Gauge update --- .gitmodules | 2 +- Dalamud/Game/ClientState/ClientState.cs | 2 + .../ClientState/ClientStateAddressResolver.cs | 2 +- .../ClientState/JobGauge/Enums/BOTDState.cs | 23 ++ .../ClientState/JobGauge/Enums/CardType.cs | 53 ++++ .../JobGauge/Enums/DismissedFairy.cs | 18 ++ .../Game/ClientState/JobGauge/Enums/Mudras.cs | 23 ++ .../ClientState/JobGauge/Enums/PetGlam.cs | 28 ++ .../ClientState/JobGauge/Enums/SealType.cs | 28 ++ .../Game/ClientState/JobGauge/Enums/Sen.cs | 31 ++ .../Game/ClientState/JobGauge/Enums/Song.cs | 28 ++ .../ClientState/JobGauge/Enums/SummonPet.cs | 28 ++ .../Game/ClientState/JobGauge/JobGauges.cs | 50 ++++ .../ClientState/JobGauge/Types/ASTGauge.cs | 40 +++ .../ClientState/JobGauge/Types/BLMGauge.cs | 67 +++++ .../ClientState/JobGauge/Types/BRDGauge.cs | 41 +++ .../ClientState/JobGauge/Types/DNCGauge.cs | 46 +++ .../ClientState/JobGauge/Types/DRGGauge.cs | 36 +++ .../ClientState/JobGauge/Types/DRKGauge.cs | 40 +++ .../ClientState/JobGauge/Types/GNBGauge.cs | 34 +++ .../JobGauge/Types/JobGaugeBase.cs | 24 ++ .../JobGauge/Types/JobGaugeBase{T}.cs | 25 ++ .../ClientState/JobGauge/Types/MCHGauge.cs | 56 ++++ .../ClientState/JobGauge/Types/MNKGauge.cs | 24 ++ .../ClientState/JobGauge/Types/NINGauge.cs | 34 +++ .../ClientState/JobGauge/Types/PLDGauge.cs | 24 ++ .../ClientState/JobGauge/Types/RDMGauge.cs | 29 ++ .../ClientState/JobGauge/Types/SAMGauge.cs | 54 ++++ .../ClientState/JobGauge/Types/SCHGauge.cs | 41 +++ .../ClientState/JobGauge/Types/SMNGauge.cs | 60 ++++ .../ClientState/JobGauge/Types/WARGauge.cs | 24 ++ .../ClientState/JobGauge/Types/WHMGauge.cs | 34 +++ Dalamud/Game/ClientState/JobGauges.cs | 35 --- .../ClientState/Structs/JobGauge/ASTGauge.cs | 36 --- .../ClientState/Structs/JobGauge/BLMGauge.cs | 67 ----- .../ClientState/Structs/JobGauge/BRDGauge.cs | 43 --- .../ClientState/Structs/JobGauge/DNCGauge.cs | 50 ---- .../ClientState/Structs/JobGauge/DRGGauge.cs | 35 --- .../ClientState/Structs/JobGauge/DRKGauge.cs | 44 --- .../ClientState/Structs/JobGauge/GNBGauge.cs | 35 --- .../ClientState/Structs/JobGauge/JobEnums.cs | 276 ------------------ .../ClientState/Structs/JobGauge/MCHGauge.cs | 66 ----- .../ClientState/Structs/JobGauge/MNKGauge.cs | 19 -- .../ClientState/Structs/JobGauge/NINGauge.cs | 36 --- .../ClientState/Structs/JobGauge/PLDGauge.cs | 19 -- .../ClientState/Structs/JobGauge/RDMGauge.cs | 27 -- .../ClientState/Structs/JobGauge/SAMGauge.cs | 53 ---- .../ClientState/Structs/JobGauge/SCHGauge.cs | 43 --- .../ClientState/Structs/JobGauge/SMNGauge.cs | 62 ---- .../ClientState/Structs/JobGauge/WARGauge.cs | 19 -- .../ClientState/Structs/JobGauge/WHMGauge.cs | 35 --- .../Interface/Internal/Windows/DataWindow.cs | 171 ++++++++++- lib/FFXIVClientStructs | 2 +- 53 files changed, 1216 insertions(+), 1006 deletions(-) create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/Song.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/JobGauges.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs create mode 100644 Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs delete mode 100644 Dalamud/Game/ClientState/JobGauges.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs delete mode 100644 Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs diff --git a/.gitmodules b/.gitmodules index b43c5aff6..0d0697f5c 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,4 +3,4 @@ url = https://github.com/goatcorp/ImGuiScene [submodule "lib/FFXIVClientStructs"] path = lib/FFXIVClientStructs - url = https://github.com/goatcorp/FFXIVClientStructs.git \ No newline at end of file + url = https://github.com/aers/FFXIVClientStructs.git diff --git a/Dalamud/Game/ClientState/ClientState.cs b/Dalamud/Game/ClientState/ClientState.cs index 0df4c1f69..2da9eddac 100644 --- a/Dalamud/Game/ClientState/ClientState.cs +++ b/Dalamud/Game/ClientState/ClientState.cs @@ -8,7 +8,9 @@ using Dalamud.Game.ClientState.Actors.Types; using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.Fates; using Dalamud.Game.ClientState.GamePad; +using Dalamud.Game.ClientState.JobGauge; using Dalamud.Game.ClientState.Keys; +using Dalamud.Game.Internal; using Dalamud.Hooking; using JetBrains.Annotations; using Serilog; diff --git a/Dalamud/Game/ClientState/ClientStateAddressResolver.cs b/Dalamud/Game/ClientState/ClientStateAddressResolver.cs index a9937b40c..1b6a86454 100644 --- a/Dalamud/Game/ClientState/ClientStateAddressResolver.cs +++ b/Dalamud/Game/ClientState/ClientStateAddressResolver.cs @@ -80,7 +80,7 @@ namespace Dalamud.Game.ClientState this.FateTablePtr = sig.GetStaticAddressFromSig("48 8B 15 ?? ?? ?? ?? 48 8B F9 44 0F B7 41 ??"); this.LocalContentId = sig.GetStaticAddressFromSig("48 0F 44 05 ?? ?? ?? ?? 48 39 07"); - this.JobGaugeData = sig.GetStaticAddressFromSig("E8 ?? ?? ?? ?? FF C6 48 8D 5B 0C", 0xB9) + 0x10; + this.JobGaugeData = sig.GetStaticAddressFromSig("48 8B 0D ?? ?? ?? ?? 48 85 C9 74 43") + 0x10; this.SetupTerritoryType = sig.ScanText("48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B F9 66 89 91 ?? ?? ?? ??"); diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs b/Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs new file mode 100644 index 000000000..0c32755fd --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/BOTDState.cs @@ -0,0 +1,23 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// DRG Blood of the Dragon state types. + /// + public enum BOTDState : byte + { + /// + /// Inactive type. + /// + NONE = 0, + + /// + /// Blood of the Dragon is active. + /// + BOTD = 1, + + /// + /// Life of the Dragon is active. + /// + LOTD = 2, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs b/Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs new file mode 100644 index 000000000..02e064b12 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/CardType.cs @@ -0,0 +1,53 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// AST Arcanum (card) types. + /// + public enum CardType : byte + { + /// + /// No card. + /// + NONE = 0, + + /// + /// The Balance card. + /// + BALANCE = 1, + + /// + /// The Bole card. + /// + BOLE = 2, + + /// + /// The Arrow card. + /// + ARROW = 3, + + /// + /// The Spear card. + /// + SPEAR = 4, + + /// + /// The Ewer card. + /// + EWER = 5, + + /// + /// The Spire card. + /// + SPIRE = 6, + + /// + /// The Lord of Crowns card. + /// + LORD = 0x70, + + /// + /// The Lady of Crowns card. + /// + LADY = 0x80, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs b/Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs new file mode 100644 index 000000000..9083aad8a --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/DismissedFairy.cs @@ -0,0 +1,18 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// SCH Dismissed fairy types. + /// + public enum DismissedFairy : byte + { + /// + /// Dismissed fairy is Eos. + /// + EOS = 6, + + /// + /// Dismissed fairy is Selene. + /// + SELENE = 7, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs b/Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs new file mode 100644 index 000000000..71449645f --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/Mudras.cs @@ -0,0 +1,23 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// NIN Mudra types. + /// + public enum Mudras : byte + { + /// + /// Ten mudra. + /// + TEN = 1, + + /// + /// Chi mudra. + /// + CHI = 2, + + /// + /// Jin mudra. + /// + JIN = 3, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs b/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs new file mode 100644 index 000000000..343cbfd8e --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs @@ -0,0 +1,28 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// SMN summoned pet glam types. + /// + public enum PetGlam : byte + { + /// + /// No pet glam. + /// + NONE = 0, + + /// + /// Emerald carbuncle pet glam. + /// + EMERALD = 1, + + /// + /// Topaz carbuncle pet glam. + /// + TOPAZ = 2, + + /// + /// Ruby carbuncle pet glam. + /// + RUBY = 3, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs b/Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs new file mode 100644 index 000000000..04440dcdc --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/SealType.cs @@ -0,0 +1,28 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// AST Divination seal types. + /// + public enum SealType : byte + { + /// + /// No seal. + /// + NONE = 0, + + /// + /// Sun seal. + /// + SUN = 1, + + /// + /// Moon seal. + /// + MOON = 2, + + /// + /// Celestial seal. + /// + CELESTIAL = 3, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs b/Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs new file mode 100644 index 000000000..de9e01fc4 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/Sen.cs @@ -0,0 +1,31 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// Samurai Sen types. + /// + [Flags] + public enum Sen : byte + { + /// + /// No Sen. + /// + NONE = 0, + + /// + /// Setsu Sen type. + /// + SETSU = 1 << 0, + + /// + /// Getsu Sen type. + /// + GETSU = 1 << 1, + + /// + /// Ka Sen type. + /// + KA = 1 << 2, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/Song.cs b/Dalamud/Game/ClientState/JobGauge/Enums/Song.cs new file mode 100644 index 000000000..25ecf66cc --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/Song.cs @@ -0,0 +1,28 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// BRD Song types. + /// + public enum Song : byte + { + /// + /// No song is active type. + /// + NONE = 0, + + /// + /// Mage's Ballad type. + /// + MAGE = 5, + + /// + /// Army's Paeon type. + /// + ARMY = 10, + + /// + /// The Wanderer's Minuet type. + /// + WANDERER = 15, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs b/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs new file mode 100644 index 000000000..d0b1e933f --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs @@ -0,0 +1,28 @@ +namespace Dalamud.Game.ClientState.JobGauge.Enums +{ + /// + /// SMN summoned pet types. + /// + public enum SummonPet : byte + { + /// + /// No pet. + /// + NONE = 0, + + /// + /// The summoned pet Ifrit. + /// + IFRIT = 3, + + /// + /// The summoned pet Titan. + /// + TITAN = 4, + + /// + /// The summoned pet Garuda. + /// + GARUDA = 5, + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/JobGauges.cs b/Dalamud/Game/ClientState/JobGauge/JobGauges.cs new file mode 100644 index 000000000..f3c836e10 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/JobGauges.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Reflection; + +using Dalamud.Game.ClientState.JobGauge.Types; +using Serilog; + +namespace Dalamud.Game.ClientState.JobGauge +{ + /// + /// This class converts in-memory Job gauge data to structs. + /// + public class JobGauges + { + private Dictionary cache = new(); + + /// + /// Initializes a new instance of the class. + /// + /// Address resolver with the JobGauge memory location(s). + public JobGauges(ClientStateAddressResolver addressResolver) + { + this.Address = addressResolver.JobGaugeData; + + Log.Verbose($"JobGaugeData address 0x{this.Address.ToInt64():X}"); + } + + /// + /// Gets the address of the JobGauge data. + /// + public IntPtr Address { get; } + + /// + /// Get the JobGauge for a given job. + /// + /// A JobGauge struct from ClientState.Structs.JobGauge. + /// A JobGauge. + public T Get() where T : JobGaugeBase + { + // This is cached to mitigate the effects of using activator for instantiation. + // Since the gauge itself reads from live memory, there isn't much downside to doing this. + if (!this.cache.TryGetValue(typeof(T), out var gauge)) + { + gauge = this.cache[typeof(T)] = (T)Activator.CreateInstance(typeof(T), BindingFlags.NonPublic | BindingFlags.Instance, null, new object[] { this.Address }, null); + } + + return (T)gauge; + } + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs new file mode 100644 index 000000000..45175344f --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs @@ -0,0 +1,40 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory AST job gauge. + /// + public unsafe class ASTGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal ASTGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the currently drawn . + /// + /// Currently drawn . + public CardType DrawnCard => (CardType)this.Struct->Card; + + /// + /// Check if a is currently active on the divination gauge. + /// + /// The to check for. + /// If the given Seal is currently divined. + public unsafe bool ContainsSeal(SealType seal) + { + if (this.Struct->Seals[0] == (byte)seal) return true; + if (this.Struct->Seals[1] == (byte)seal) return true; + if (this.Struct->Seals[2] == (byte)seal) return true; + return false; + } + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs new file mode 100644 index 000000000..0e5516b7a --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/BLMGauge.cs @@ -0,0 +1,67 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory BLM job gauge. + /// + public unsafe class BLMGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal BLMGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time remaining for the Enochian time in milliseconds. + /// + public short EnochianTimer => this.Struct->EnochianTimer; + + /// + /// Gets the time remaining for Astral Fire or Umbral Ice in milliseconds. + /// + public short ElementTimeRemaining => this.Struct->ElementTimeRemaining; + + /// + /// Gets the number of Polyglot stacks remaining. + /// + public byte PolyglotStacks => this.Struct->PolyglotStacks; + + /// + /// Gets the number of Umbral Hearts remaining. + /// + public byte UmbralHearts => this.Struct->UmbralHearts; + + /// + /// Gets the amount of Umbral Ice stacks. + /// + public byte UmbralIceStacks => (byte)(this.InUmbralIce ? -this.Struct->ElementStance : 0); + + /// + /// Gets the amount of Astral Fire stacks. + /// + public byte AstralFireStacks => (byte)(this.InAstralFire ? this.Struct->ElementStance : 0); + + /// + /// Gets a value indicating whether if the player is in Umbral Ice. + /// + /// true or false. + public bool InUmbralIce => this.Struct->ElementStance < 0; + + /// + /// Gets a value indicating whether if the player is in Astral fire. + /// + /// true or false. + public bool InAstralFire => this.Struct->ElementStance > 0; + + /// + /// Gets a value indicating whether if Enochian is active. + /// + /// true or false. + public bool IsEnochianActive => this.Struct->Enochian != 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs new file mode 100644 index 000000000..ed814d055 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/BRDGauge.cs @@ -0,0 +1,41 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory BRD job gauge. + /// + public unsafe class BRDGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal BRDGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the current song timer in milliseconds. + /// + public short SongTimer => this.Struct->SongTimer; + + /// + /// Gets the amount of Repertoire accumulated. + /// + public byte Repertoire => this.Struct->Repertoire; + + /// + /// Gets the amount of Soul Voice accumulated. + /// + public byte SoulVoice => this.Struct->SoulVoice; + + /// + /// Gets the type of song that is active. + /// + public Song Song => (Song)this.Struct->Song; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs new file mode 100644 index 000000000..09c829523 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/DNCGauge.cs @@ -0,0 +1,46 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory DNC job gauge. + /// + public unsafe class DNCGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal DNCGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the number of feathers available. + /// + public byte Feathers => this.Struct->Feathers; + + /// + /// Gets the amount of Espirit available. + /// + public byte Esprit => this.Struct->Esprit; + + /// + /// Gets the number of steps completed for the current dance. + /// + public byte CompletedSteps => this.Struct->StepIndex; + + /// + /// Gets the next step in the current dance. + /// + /// The next dance step action ID. + public ulong NextStep => (ulong)(15999 + this.Struct->DanceSteps[this.Struct->StepIndex] - 1); + + /// + /// Gets a value indicating whether the player is dancing or not. + /// + /// true or false. + public bool IsDancing => this.Struct->DanceSteps[0] != 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs new file mode 100644 index 000000000..dd89b069a --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/DRGGauge.cs @@ -0,0 +1,36 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory DRG job gauge. + /// + public unsafe class DRGGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal DRGGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time remaining for Blood of the Dragon in milliseconds. + /// + public short BOTDTimer => this.Struct->BotdTimer; + + /// + /// Gets the current state of Blood of the Dragon. + /// + public BOTDState BOTDState => (BOTDState)this.Struct->BotdState; + + /// + /// Gets the count of eyes opened during Blood of the Dragon. + /// + public byte EyeCount => this.Struct->EyeCount; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs new file mode 100644 index 000000000..d903c0f68 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/DRKGauge.cs @@ -0,0 +1,40 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory DRK job gauge. + /// + public unsafe class DRKGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal DRKGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the amount of blood accumulated. + /// + public byte Blood => this.Struct->Blood; + + /// + /// Gets the Darkside time remaining in milliseconds. + /// + public ushort DarksideTimeRemaining => this.Struct->DarksideTimer; + + /// + /// Gets the Shadow time remaining in milliseconds. + /// + public ushort ShadowTimeRemaining => this.Struct->ShadowTimer; + + /// + /// Gets a value indicating whether the player has Dark Arts or not. + /// + /// true or false. + public bool HasDarkArts => this.Struct->DarkArtsState > 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs new file mode 100644 index 000000000..dc934d8f4 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/GNBGauge.cs @@ -0,0 +1,34 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory GNB job gauge. + /// + public unsafe class GNBGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal GNBGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the amount of ammo available. + /// + public byte Ammo => this.Struct->Ammo; + + /// + /// Gets the max combo time of the Gnashing Fang combo. + /// + public short MaxTimerDuration => this.Struct->MaxTimerDuration; + + /// + /// Gets the current step of the Gnashing Fang combo. + /// + public byte AmmoComboStep => this.Struct->AmmoComboStep; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs b/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs new file mode 100644 index 000000000..0160a9a87 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase.cs @@ -0,0 +1,24 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// Base job gauge class. + /// + public abstract unsafe class JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal JobGaugeBase(IntPtr address) + { + this.Address = address; + } + + /// + /// Gets the address of this job gauge in memory. + /// + public IntPtr Address { get; } + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs b/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs new file mode 100644 index 000000000..0dc494d8b --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/JobGaugeBase{T}.cs @@ -0,0 +1,25 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// Base job gauge class. + /// + /// The underlying FFXIVClientStructs type. + public unsafe class JobGaugeBase : JobGaugeBase where T : unmanaged + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal JobGaugeBase(IntPtr address) + : base(address) + { + } + + /// + /// Gets an unsafe struct pointer of this job gauge. + /// + private protected T* Struct => (T*)this.Address; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs new file mode 100644 index 000000000..1971137a5 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/MCHGauge.cs @@ -0,0 +1,56 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory MCH job gauge. + /// + public unsafe class MCHGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal MCHGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time time remaining for Overheat in milliseconds. + /// + public short OverheatTimeRemaining => this.Struct->OverheatTimeRemaining; + + /// + /// Gets the time remaining for the Rook or Queen in milliseconds. + /// + public short SummonTimeRemaining => this.Struct->SummonTimeRemaining; + + /// + /// Gets the current Heat level. + /// + public byte Heat => this.Struct->Heat; + + /// + /// Gets the current Battery level. + /// + public byte Battery => this.Struct->Battery; + + /// + /// Gets the battery level of the last summon (robot). + /// + public byte LastSummonBatteryPower => this.Struct->LastSummonBatteryPower; + + /// + /// Gets a value indicating whether the player is currently Overheated. + /// + /// true or false. + public bool IsOverheated => (this.Struct->TimerActive & 1) != 0; + + /// + /// Gets a value indicating whether the player has an active Robot. + /// + /// true or false. + public bool IsRobotActive => (this.Struct->TimerActive & 2) != 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs new file mode 100644 index 000000000..8de421541 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/MNKGauge.cs @@ -0,0 +1,24 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory MNK job gauge. + /// + public unsafe class MNKGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal MNKGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the number of Chakra available. + /// + public byte Chakra => this.Struct->Chakra; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs new file mode 100644 index 000000000..40bf64d4a --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/NINGauge.cs @@ -0,0 +1,34 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory NIN job gauge. + /// + public unsafe class NINGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// The address of the gauge. + internal NINGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time left on Huton in milliseconds. + /// + public int HutonTimer => this.Struct->HutonTimer; + + /// + /// Gets the amount of Ninki available. + /// + public byte Ninki => this.Struct->Ninki; + + /// + /// Gets the number of times Huton has been cast manually. + /// + public byte HutonManualCasts => this.Struct->HutonManualCasts; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs new file mode 100644 index 000000000..d610515e1 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/PLDGauge.cs @@ -0,0 +1,24 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory PLD job gauge. + /// + public unsafe class PLDGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal PLDGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the current level of the Oath gauge. + /// + public byte OathGauge => this.Struct->OathGauge; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs new file mode 100644 index 000000000..63c8b6a20 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/RDMGauge.cs @@ -0,0 +1,29 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory RDM job gauge. + /// + public unsafe class RDMGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal RDMGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the level of the White gauge. + /// + public byte WhiteMana => this.Struct->WhiteMana; + + /// + /// Gets the level of the Black gauge. + /// + public byte BlackMana => this.Struct->BlackMana; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs new file mode 100644 index 000000000..64559e4e3 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/SAMGauge.cs @@ -0,0 +1,54 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory SAM job gauge. + /// + public unsafe class SAMGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal SAMGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the current amount of Kenki available. + /// + public byte Kenki => this.Struct->Kenki; + + /// + /// Gets the amount of Meditation stacks. + /// + public byte MeditationStacks => this.Struct->MeditationStacks; + + /// + /// Gets the active Sen. + /// + public Sen Sen => (Sen)this.Struct->SenFlags; + + /// + /// Gets a value indicating whether the Setsu Sen is active. + /// + /// true or false. + public bool HasSetsu => (this.Sen & Sen.SETSU) != 0; + + /// + /// Gets a value indicating whether the Getsu Sen is active. + /// + /// true or false. + public bool HasGetsu => (this.Sen & Sen.GETSU) != 0; + + /// + /// Gets a value indicating whether the Ka Sen is active. + /// + /// true or false. + public bool HasKa => (this.Sen & Sen.KA) != 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs new file mode 100644 index 000000000..f72e7047b --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/SCHGauge.cs @@ -0,0 +1,41 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory SCH job gauge. + /// + public unsafe class SCHGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal SCHGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the amount of Aetherflow stacks available. + /// + public byte Aetherflow => this.Struct->Aetherflow; + + /// + /// Gets the current level of the Fairy Gauge. + /// + public byte FairyGauge => this.Struct->FairyGauge; + + /// + /// Gets the Seraph time remaiSCHg in milliseconds. + /// + public short SeraphTimer => this.Struct->SeraphTimer; + + /// + /// Gets the last dismissed fairy. + /// + public DismissedFairy DismissedFairy => (DismissedFairy)this.Struct->DismissedFairy; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs new file mode 100644 index 000000000..5074f0bc9 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs @@ -0,0 +1,60 @@ +using System; + +using Dalamud.Game.ClientState.JobGauge.Enums; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory SMN job gauge. + /// + public unsafe class SMNGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal SMNGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time remaining for the current summon. + /// + public short TimerRemaining => this.Struct->TimerRemaining; + + /// + /// Gets the summon that will return after the current summon expires. + /// + public SummonPet ReturnSummon => (SummonPet)this.Struct->ReturnSummon; + + /// + /// Gets the summon glam for the . + /// + public PetGlam ReturnSummonGlam => (PetGlam)this.Struct->ReturnSummonGlam; + + /// + /// Gets the current aether flags. + /// Use the summon accessors instead. + /// + public byte AetherFlags => this.Struct->AetherFlags; + + /// + /// Gets a value indicating whether if Phoenix is ready to be summoned. + /// + /// true or false. + public bool IsPhoenixReady => (this.AetherFlags & 0x10) > 0; + + /// + /// Gets a value indicating whether Bahamut is ready to be summoned. + /// + /// true or false. + public bool IsBahamutReady => (this.AetherFlags & 8) > 0; + + /// + /// Gets a value indicating whether there are any Aetherflow stacks available. + /// + /// true or false. + public bool HasAetherflowStacks => (this.AetherFlags & 3) > 0; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs new file mode 100644 index 000000000..484ac83a8 --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/WARGauge.cs @@ -0,0 +1,24 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory WAR job gauge. + /// + public unsafe class WARGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal WARGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the amount of wrath in the Beast gauge. + /// + public byte BeastGauge => this.Struct->BeastGauge; + } +} diff --git a/Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs new file mode 100644 index 000000000..f3933a5aa --- /dev/null +++ b/Dalamud/Game/ClientState/JobGauge/Types/WHMGauge.cs @@ -0,0 +1,34 @@ +using System; + +namespace Dalamud.Game.ClientState.JobGauge.Types +{ + /// + /// In-memory WHM job gauge. + /// + public unsafe class WHMGauge : JobGaugeBase + { + /// + /// Initializes a new instance of the class. + /// + /// Address of the job gauge. + internal WHMGauge(IntPtr address) + : base(address) + { + } + + /// + /// Gets the time to next lily in milliseconds. + /// + public short LilyTimer => this.Struct->LilyTimer; + + /// + /// Gets the number of Lilies. + /// + public byte Lily => this.Struct->Lily; + + /// + /// Gets the number of times the blood lily has been nourished. + /// + public byte BloodLily => this.Struct->BloodLily; + } +} diff --git a/Dalamud/Game/ClientState/JobGauges.cs b/Dalamud/Game/ClientState/JobGauges.cs deleted file mode 100644 index e0e9c0f9d..000000000 --- a/Dalamud/Game/ClientState/JobGauges.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Runtime.InteropServices; - -using Serilog; - -namespace Dalamud.Game.ClientState -{ - /// - /// This class converts in-memory Job gauge data to structs. - /// - public class JobGauges - { - /// - /// Initializes a new instance of the class. - /// - /// Address resolver with the JobGauge memory location(s). - public JobGauges(ClientStateAddressResolver addressResolver) - { - this.Address = addressResolver; - - Log.Verbose($"JobGaugeData address 0x{this.Address.JobGaugeData.ToInt64():X}"); - } - - private ClientStateAddressResolver Address { get; } - - /// - /// Get the JobGauge for a given job. - /// - /// A JobGauge struct from ClientState.Structs.JobGauge. - /// A JobGauge. - public T Get() - { - return Marshal.PtrToStructure(this.Address.JobGaugeData); - } - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs deleted file mode 100644 index c37e1c0a7..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/ASTGauge.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory AST job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct ASTGauge - { - [FieldOffset(4)] - private CardType card; - - [FieldOffset(5)] - private unsafe fixed byte seals[3]; - - /// - /// Gets the currently drawn . - /// - /// Currently drawn . - public CardType DrawnCard() => this.card; - - /// - /// Check if a is currently active on the divination gauge. - /// - /// The to check for. - /// If the given Seal is currently divined. - public unsafe bool ContainsSeal(SealType seal) - { - if (this.seals[0] == (byte)seal) return true; - if (this.seals[1] == (byte)seal) return true; - if (this.seals[2] == (byte)seal) return true; - return false; - } - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs deleted file mode 100644 index e4125745b..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/BLMGauge.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory BLM job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct BLMGauge - { - [FieldOffset(0)] - private short timeUntilNextPolyglot; // enochian timer - - [FieldOffset(2)] - private short elementTimeRemaining; // umbral ice and astral fire timer - - [FieldOffset(4)] - private byte elementStance; // umbral ice or astral fire - - [FieldOffset(5)] - private byte numUmbralHearts; - - [FieldOffset(6)] - private byte numPolyglotStacks; - - [FieldOffset(7)] - private byte enochianState; - - /// - /// Gets the time until the next Polyglot stack in milliseconds. - /// - public short TimeUntilNextPolyglot => this.timeUntilNextPolyglot; - - /// - /// Gets the time remaining for Astral Fire or Umbral Ice in milliseconds. - /// - public short ElementTimeRemaining => this.elementTimeRemaining; - - /// - /// Gets the number of Polyglot stacks remaining. - /// - public byte NumPolyglotStacks => this.numPolyglotStacks; - - /// - /// Gets the number of Umbral Hearts remaining. - /// - public byte NumUmbralHearts => this.numUmbralHearts; - - /// - /// Gets if the player is in Umbral Ice. - /// - /// true or false. - public bool InUmbralIce() => this.elementStance > 4; - - /// - /// Gets if the player is in Astral fire. - /// - /// true or false. - public bool InAstralFire() => this.elementStance > 0 && this.elementStance < 4; - - /// - /// Gets if Enochian is active. - /// - /// true or false. - public bool IsEnoActive() => this.enochianState > 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs deleted file mode 100644 index 98590805c..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/BRDGauge.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory BRD job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct BRDGauge - { - [FieldOffset(0)] - private short songTimer; - - [FieldOffset(2)] - private byte numSongStacks; - - [FieldOffset(3)] - private byte soulVoiceValue; - - [FieldOffset(4)] - private CurrentSong activeSong; - - /// - /// Gets the current song timer in milliseconds. - /// - public short SongTimer => this.songTimer; - - /// - /// Gets the number of stacks for the current song. - /// - public byte NumSongStacks => this.numSongStacks; - - /// - /// Gets the amount of Soul Voice accumulated. - /// - public byte SoulVoiceValue => this.soulVoiceValue; - - /// - /// Gets the type of song that is active. - /// - public CurrentSong ActiveSong => this.activeSong; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs deleted file mode 100644 index e2f4f6544..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DNCGauge.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory DNC job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public unsafe struct DNCGauge - { - [FieldOffset(0)] - private byte numFeathers; - - [FieldOffset(1)] - private byte esprit; - - [FieldOffset(2)] - private fixed byte stepOrder[4]; - - [FieldOffset(6)] - private byte numCompleteSteps; - - /// - /// Gets the number of feathers available. - /// - public byte NumFeathers => this.numFeathers; - - /// - /// Gets the amount of Espirit available. - /// - public byte Esprit => this.esprit; - - /// - /// Gets the number of steps completed for the current dance. - /// - public byte NumCompleteSteps => this.numCompleteSteps; - - /// - /// Gets the next step in the current dance. - /// - /// The next dance step action ID. - public ulong NextStep() => (ulong)(15999 + this.stepOrder[this.NumCompleteSteps] - 1); - - /// - /// Gets if the player is dancing or not. - /// - /// true or false. - public bool IsDancing() => this.stepOrder[0] != 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs deleted file mode 100644 index 2f4c4ef16..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DRGGauge.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory DRG job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct DRGGauge - { - [FieldOffset(0)] - private short botdTimer; - - [FieldOffset(2)] - private BOTDState botdState; - - [FieldOffset(3)] - private byte eyeCount; - - /// - /// Gets the time remaining for Blood of the Dragon in milliseconds. - /// - public short BOTDTimer => this.botdTimer; - - /// - /// Gets the current state of Blood of the Dragon. - /// - public BOTDState BOTDState => this.botdState; - - /// - /// Gets the count of eyes opened during Blood of the Dragon. - /// - public byte EyeCount => this.eyeCount; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs deleted file mode 100644 index 97ab73161..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/DRKGauge.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory DRK job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct DRKGauge - { - [FieldOffset(0)] - private byte blood; - - [FieldOffset(2)] - private ushort darksideTimeRemaining; - - [FieldOffset(4)] - private byte darkArtsState; - - [FieldOffset(6)] - private ushort shadowTimeRemaining; - - /// - /// Gets the amount of blood accumulated. - /// - public byte Blood => this.blood; - - /// - /// Gets the Darkside time remaining in milliseconds. - /// - public ushort DarksideTimeRemaining => this.darksideTimeRemaining; - - /// - /// Gets the Shadow time remaining in milliseconds. - /// - public ushort ShadowTimeRemaining => this.shadowTimeRemaining; - - /// - /// Gets if the player has Dark Arts or not. - /// - /// true or false. - public bool HasDarkArts() => this.darkArtsState > 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs deleted file mode 100644 index d42bd9fa1..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/GNBGauge.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory GNB job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct GNBGauge - { - [FieldOffset(0)] - private byte numAmmo; - - [FieldOffset(2)] - private short maxTimerDuration; - - [FieldOffset(4)] - private byte ammoComboStepNumber; - - /// - /// Gets the amount of ammo available. - /// - public byte NumAmmo => this.numAmmo; - - /// - /// Gets the max combo time of the Gnashing Fang combo. - /// - public short MaxTimerDuration => this.maxTimerDuration; - - /// - /// Gets the current step of the Gnashing Fang combo. - /// - public byte AmmoComboStepNumber => this.ammoComboStepNumber; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs b/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs deleted file mode 100644 index dba4ba4a0..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/JobEnums.cs +++ /dev/null @@ -1,276 +0,0 @@ -using System; - -#pragma warning disable SA1402 // File may only contain a single type - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - #region AST - - /// - /// AST Divination seal types. - /// - public enum SealType : byte - { - /// - /// No seal. - /// - NONE = 0, - - /// - /// Sun seal. - /// - SUN = 1, - - /// - /// Moon seal. - /// - MOON = 2, - - /// - /// Celestial seal. - /// - CELESTIAL = 3, - } - - /// - /// AST Arcanum (card) types. - /// - public enum CardType : byte - { - /// - /// No card. - /// - NONE = 0, - - /// - /// The Balance card. - /// - BALANCE = 1, - - /// - /// The Bole card. - /// - BOLE = 2, - - /// - /// The Arrow card. - /// - ARROW = 3, - - /// - /// The Spear card. - /// - SPEAR = 4, - - /// - /// The Ewer card. - /// - EWER = 5, - - /// - /// The Spire card. - /// - SPIRE = 6, - - /// - /// The Lord of Crowns card. - /// - LORD = 0x70, - - /// - /// The Lady of Crowns card. - /// - LADY = 0x80, - } - - #endregion - - #region BRD - - /// - /// BRD Current Song types. - /// - public enum CurrentSong : byte - { - /// - /// No song is active type. - /// - NONE = 0, - - /// - /// Mage's Ballad type. - /// - MAGE = 5, - - /// - /// Army's Paeon type. - /// - ARMY = 0xA, - - /// - /// The Wanderer's Minuet type. - /// - WANDERER = 0xF, - } - - #endregion - - #region DRG - - /// - /// DRG Blood of the Dragon state types. - /// - public enum BOTDState : byte - { - /// - /// Inactive type. - /// - NONE = 0, - - /// - /// Blood of the Dragon is active. - /// - BOTD = 1, - - /// - /// Life of the Dragon is active. - /// - LOTD = 2, - } - - #endregion - - #region NIN - - /// - /// NIN Mudra types. - /// - public enum Mudras : byte - { - /// - /// Ten mudra. - /// - TEN = 1, - - /// - /// Chi mudra. - /// - CHI = 2, - - /// - /// Jin mudra. - /// - JIN = 3, - } - - #endregion - - #region SAM - - /// - /// Samurai Sen types. - /// - [Flags] - public enum Sen : byte - { - /// - /// No Sen. - /// - NONE = 0, - - /// - /// Setsu Sen type. - /// - SETSU = 1 << 0, - - /// - /// Getsu Sen type. - /// - GETSU = 1 << 1, - - /// - /// Ka Sen type. - /// - KA = 1 << 2, - } - - #endregion - - #region SCH - - /// - /// SCH Dismissed fairy types. - /// - public enum DismissedFairy : byte - { - /// - /// Dismissed fairy is Eos. - /// - EOS = 6, - - /// - /// Dismissed fairy is Selene. - /// - SELENE = 7, - } - - #endregion - - #region SMN - - /// - /// SMN summoned pet types. - /// - public enum SummonPet : byte - { - /// - /// No pet. - /// - NONE = 0, - - /// - /// The summoned pet Ifrit. - /// - IFRIT = 3, - - /// - /// The summoned pet Titan. - /// - TITAN = 4, - - /// - /// The summoned pet Garuda. - /// - GARUDA = 5, - } - - /// - /// SMN summoned pet glam types. - /// - public enum PetGlam : byte - { - /// - /// No pet glam. - /// - NONE = 0, - - /// - /// Emerald carbuncle pet glam. - /// - EMERALD = 1, - - /// - /// Topaz carbuncle pet glam. - /// - TOPAZ = 2, - - /// - /// Ruby carbuncle pet glam. - /// - RUBY = 3, - } - - #endregion -} - -#pragma warning restore SA1402 // File may only contain a single type diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs deleted file mode 100644 index 1444beac0..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/MCHGauge.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory MCH job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct MCHGauge - { - [FieldOffset(0)] - private short overheatTimeRemaining; - - [FieldOffset(2)] - private short robotTimeRemaining; - - [FieldOffset(4)] - private byte heat; - - [FieldOffset(5)] - private byte battery; - - [FieldOffset(6)] - private byte lastRobotBatteryPower; - - [FieldOffset(7)] - private byte timerActive; - - /// - /// Gets the time time remaining for Overheat in milliseconds. - /// - public short OverheatTimeRemaining => this.overheatTimeRemaining; - - /// - /// Gets the time remaining for the Rook or Queen in milliseconds. - /// - public short RobotTimeRemaining => this.robotTimeRemaining; - - /// - /// Gets the current Heat level. - /// - public byte Heat => this.heat; - - /// - /// Gets the current Battery level. - /// - public byte Battery => this.battery; - - /// - /// Gets the battery level of the last Robot. - /// - public byte LastRobotBatteryPower => this.lastRobotBatteryPower; - - /// - /// Gets if the player is currently Overheated. - /// - /// true or false. - public bool IsOverheated() => (this.timerActive & 1) != 0; - - /// - /// Gets if the player has an active Robot. - /// - /// true or false. - public bool IsRobotActive() => (this.timerActive & 2) != 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs deleted file mode 100644 index ef1520d9e..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/MNKGauge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory MNK job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct MNKGauge - { - [FieldOffset(0)] - private byte numChakra; - - /// - /// Gets the number of Chakra available. - /// - public byte NumChakra => this.numChakra; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs deleted file mode 100644 index f2019caf8..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/NINGauge.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory NIN job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct NINGauge - { - [FieldOffset(0)] - private int hutonTimeLeft; - - [FieldOffset(4)] - private byte ninki; - - [FieldOffset(5)] - private byte numHutonManualCasts; - - /// - /// Gets the time left on Huton in milliseconds. - /// - public int HutonTimeLeft => this.hutonTimeLeft; - - /// - /// Gets the amount of Ninki available. - /// - public byte Ninki => this.ninki; - - /// - /// Gets the number of times Huton has been cast manually. - /// - public byte NumHutonManualCasts => this.numHutonManualCasts; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs deleted file mode 100644 index 545ae695a..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/PLDGauge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory PLD job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct PLDGauge - { - [FieldOffset(0)] - private byte gaugeAmount; - - /// - /// Gets the current level of the Oath gauge. - /// - public byte GaugeAmount => this.gaugeAmount; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs deleted file mode 100644 index 8d0ec38e1..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/RDMGauge.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory RDM job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct RDMGauge - { - [FieldOffset(0)] - private byte whiteGauge; - - [FieldOffset(1)] - private byte blackGauge; - - /// - /// Gets the level of the White gauge. - /// - public byte WhiteGauge => this.whiteGauge; - - /// - /// Gets the level of the Black gauge. - /// - public byte BlackGauge => this.blackGauge; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs deleted file mode 100644 index 139a93265..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SAMGauge.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory SAM job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct SAMGauge - { - [FieldOffset(3)] - private byte kenki; - - [FieldOffset(4)] - private byte meditationStacks; - - [FieldOffset(5)] - private Sen sen; - - /// - /// Gets the current amount of Kenki available. - /// - public byte Kenki => this.kenki; - - /// - /// Gets the amount of Meditation stacks. - /// - public byte MeditationStacks => this.meditationStacks; - - /// - /// Gets the active Sen. - /// - public Sen Sen => this.sen; - - /// - /// Gets if the Setsu Sen is active. - /// - /// true or false. - public bool HasSetsu() => (this.Sen & Sen.SETSU) != 0; - - /// - /// Gets if the Getsu Sen is active. - /// - /// true or false. - public bool HasGetsu() => (this.Sen & Sen.GETSU) != 0; - - /// - /// Gets if the Ka Sen is active. - /// - /// true or false. - public bool HasKa() => (this.Sen & Sen.KA) != 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs deleted file mode 100644 index 66347b62e..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SCHGauge.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory SCH job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct SCHGauge - { - [FieldOffset(2)] - private byte numAetherflowStacks; - - [FieldOffset(3)] - private byte fairyGaugeAmount; - - [FieldOffset(4)] - private short seraphTimer; - - [FieldOffset(6)] - private DismissedFairy dismissedFairy; - - /// - /// Gets the amount of Aetherflow stacks available. - /// - public byte NumAetherflowStacks => this.numAetherflowStacks; - - /// - /// Gets the current level of the Fairy Gauge. - /// - public byte FairyGaugeAmount => this.fairyGaugeAmount; - - /// - /// Gets the Seraph time remaining in milliseconds. - /// - public short SeraphTimer => this.seraphTimer; - - /// - /// Gets the last dismissed fairy. - /// - public DismissedFairy DismissedFairy => this.dismissedFairy; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs deleted file mode 100644 index 92cbcc19c..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/SMNGauge.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory SMN job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct SMNGauge - { - [FieldOffset(0)] - private short timerRemaining; - - [FieldOffset(2)] - private SummonPet returnSummon; - - [FieldOffset(3)] - private PetGlam returnSummonGlam; - - [FieldOffset(4)] - private byte numStacks; - - /// - /// Gets the time remaining for the current summon. - /// - public short TimerRemaining => this.timerRemaining; - - /// - /// Gets the summon that will return after the current summon expires. - /// - public SummonPet ReturnSummon => this.returnSummon; - - /// - /// Gets the summon glam for the . - /// - public PetGlam ReturnSummonGlam => this.returnSummonGlam; - - /// - /// Gets the current stacks. - /// Use the summon accessors instead. - /// - public byte NumStacks => this.numStacks; - - /// - /// Gets if Phoenix is ready to be summoned. - /// - /// true or false. - public bool IsPhoenixReady() => (this.NumStacks & 0x10) > 0; - - /// - /// Gets if Bahamut is ready to be summoned. - /// - /// true or false. - public bool IsBahamutReady() => (this.NumStacks & 8) > 0; - - /// - /// Gets if there are any Aetherflow stacks available. - /// - /// true or false. - public bool HasAetherflowStacks() => (this.NumStacks & 3) > 0; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs deleted file mode 100644 index 0d070d68e..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/WARGauge.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory WAR job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct WARGauge - { - [FieldOffset(0)] - private byte beastGaugeAmount; - - /// - /// Gets the amount of wrath in the Beast gauge. - /// - public byte BeastGaugeAmount => this.beastGaugeAmount; - } -} diff --git a/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs b/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs deleted file mode 100644 index 496a39831..000000000 --- a/Dalamud/Game/ClientState/Structs/JobGauge/WHMGauge.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Runtime.InteropServices; - -namespace Dalamud.Game.ClientState.Structs.JobGauge -{ - /// - /// In-memory WHM job gauge. - /// - [StructLayout(LayoutKind.Explicit)] - public struct WHMGauge - { - [FieldOffset(2)] - private short lilyTimer; - - [FieldOffset(4)] - private byte numLilies; - - [FieldOffset(5)] - private byte numBloodLily; - - /// - /// Gets the time to next lily in milliseconds. - /// - public short LilyTimer => this.lilyTimer; - - /// - /// Gets the number of Lilies. - /// - public byte NumLilies => this.numLilies; - - /// - /// Gets the number of times the blood lily has been nourished. - /// - public byte NumBloodLily => this.numBloodLily; - } -} diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index 75b1e8c18..96473d879 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -10,7 +10,8 @@ using Dalamud.Game.ClientState.Actors.Types; using Dalamud.Game.ClientState.Actors.Types.NonPlayer; using Dalamud.Game.ClientState.Conditions; using Dalamud.Game.ClientState.GamePad; -using Dalamud.Game.ClientState.Structs.JobGauge; +using Dalamud.Game.ClientState.JobGauge.Enums; +using Dalamud.Game.ClientState.JobGauge.Types; using Dalamud.Game.Gui.Addons; using Dalamud.Game.Gui.Toast; using Dalamud.Game.Text; @@ -558,8 +559,172 @@ namespace Dalamud.Interface.Internal.Windows private void DrawGauge() { - var gauge = this.dalamud.ClientState.JobGauges.Get(); - ImGui.Text($"Moon: {gauge.ContainsSeal(SealType.MOON)} Drawn: {gauge.DrawnCard()}"); + var player = this.dalamud.ClientState.LocalPlayer; + if (player == null) + { + ImGui.Text("Player is not present"); + return; + } + + var jobID = player.ClassJob.Id; + if (jobID == 19) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.OathGauge)}: {gauge.OathGauge}"); + } + else if (jobID == 20) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Chakra)}: {gauge.Chakra}"); + } + else if (jobID == 21) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.BeastGauge)}: {gauge.BeastGauge}"); + } + else if (jobID == 22) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.BOTDTimer)}: {gauge.BOTDTimer}"); + ImGui.Text($"{nameof(gauge.BOTDState)}: {gauge.BOTDState}"); + ImGui.Text($"{nameof(gauge.EyeCount)}: {gauge.EyeCount}"); + } + else if (jobID == 23) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.SongTimer)}: {gauge.SongTimer}"); + ImGui.Text($"{nameof(gauge.Repertoire)}: {gauge.Repertoire}"); + ImGui.Text($"{nameof(gauge.SoulVoice)}: {gauge.SoulVoice}"); + ImGui.Text($"{nameof(gauge.Song)}: {gauge.Song}"); + } + else if (jobID == 24) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.LilyTimer)}: {gauge.LilyTimer}"); + ImGui.Text($"{nameof(gauge.Lily)}: {gauge.Lily}"); + ImGui.Text($"{nameof(gauge.BloodLily)}: {gauge.BloodLily}"); + } + else if (jobID == 25) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.EnochianTimer)}: {gauge.EnochianTimer}"); + ImGui.Text($"{nameof(gauge.ElementTimeRemaining)}: {gauge.ElementTimeRemaining}"); + ImGui.Text($"{nameof(gauge.PolyglotStacks)}: {gauge.PolyglotStacks}"); + ImGui.Text($"{nameof(gauge.UmbralHearts)}: {gauge.UmbralHearts}"); + ImGui.Text($"{nameof(gauge.UmbralIceStacks)}: {gauge.UmbralIceStacks}"); + ImGui.Text($"{nameof(gauge.AstralFireStacks)}: {gauge.AstralFireStacks}"); + ImGui.Text($"{nameof(gauge.InUmbralIce)}: {gauge.InUmbralIce}"); + ImGui.Text($"{nameof(gauge.InAstralFire)}: {gauge.InAstralFire}"); + ImGui.Text($"{nameof(gauge.IsEnochianActive)}: {gauge.IsEnochianActive}"); + } + else if (jobID == 27) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.TimerRemaining)}: {gauge.TimerRemaining}"); + ImGui.Text($"{nameof(gauge.ReturnSummon)}: {gauge.ReturnSummon}"); + ImGui.Text($"{nameof(gauge.ReturnSummonGlam)}: {gauge.ReturnSummonGlam}"); + ImGui.Text($"{nameof(gauge.AetherFlags)}: {gauge.AetherFlags}"); + ImGui.Text($"{nameof(gauge.IsPhoenixReady)}: {gauge.IsPhoenixReady}"); + ImGui.Text($"{nameof(gauge.IsBahamutReady)}: {gauge.IsBahamutReady}"); + ImGui.Text($"{nameof(gauge.HasAetherflowStacks)}: {gauge.HasAetherflowStacks}"); + } + else if (jobID == 28) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Aetherflow)}: {gauge.Aetherflow}"); + ImGui.Text($"{nameof(gauge.FairyGauge)}: {gauge.FairyGauge}"); + ImGui.Text($"{nameof(gauge.SeraphTimer)}: {gauge.SeraphTimer}"); + ImGui.Text($"{nameof(gauge.DismissedFairy)}: {gauge.DismissedFairy}"); + } + else if (jobID == 30) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.HutonTimer)}: {gauge.HutonTimer}"); + ImGui.Text($"{nameof(gauge.Ninki)}: {gauge.Ninki}"); + ImGui.Text($"{nameof(gauge.HutonManualCasts)}: {gauge.HutonManualCasts}"); + } + else if (jobID == 31) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.OverheatTimeRemaining)}: {gauge.OverheatTimeRemaining}"); + ImGui.Text($"{nameof(gauge.SummonTimeRemaining)}: {gauge.SummonTimeRemaining}"); + ImGui.Text($"{nameof(gauge.Heat)}: {gauge.Heat}"); + ImGui.Text($"{nameof(gauge.Battery)}: {gauge.Battery}"); + ImGui.Text($"{nameof(gauge.LastSummonBatteryPower)}: {gauge.LastSummonBatteryPower}"); + ImGui.Text($"{nameof(gauge.IsOverheated)}: {gauge.IsOverheated}"); + ImGui.Text($"{nameof(gauge.IsRobotActive)}: {gauge.IsRobotActive}"); + } + else if (jobID == 32) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Blood)}: {gauge.Blood}"); + ImGui.Text($"{nameof(gauge.DarksideTimeRemaining)}: {gauge.DarksideTimeRemaining}"); + ImGui.Text($"{nameof(gauge.ShadowTimeRemaining)}: {gauge.ShadowTimeRemaining}"); + ImGui.Text($"{nameof(gauge.HasDarkArts)}: {gauge.HasDarkArts}"); + } + else if (jobID == 33) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.DrawnCard)}: {gauge.DrawnCard}"); + foreach (var seal in Enum.GetValues(typeof(SealType)).Cast()) + { + var sealName = Enum.GetName(typeof(SealType), seal); + ImGui.Text($"{nameof(gauge.ContainsSeal)}({sealName}): {gauge.ContainsSeal(seal)}"); + } + } + else if (jobID == 34) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Kenki)}: {gauge.Kenki}"); + ImGui.Text($"{nameof(gauge.MeditationStacks)}: {gauge.MeditationStacks}"); + ImGui.Text($"{nameof(gauge.Sen)}: {gauge.Sen}"); + ImGui.Text($"{nameof(gauge.HasSetsu)}: {gauge.HasSetsu}"); + ImGui.Text($"{nameof(gauge.HasGetsu)}: {gauge.HasGetsu}"); + ImGui.Text($"{nameof(gauge.HasKa)}: {gauge.HasKa}"); + } + else if (jobID == 35) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.WhiteMana)}: {gauge.WhiteMana}"); + ImGui.Text($"{nameof(gauge.BlackMana)}: {gauge.BlackMana}"); + } + else if (jobID == 37) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Ammo)}: {gauge.Ammo}"); + ImGui.Text($"{nameof(gauge.MaxTimerDuration)}: {gauge.MaxTimerDuration}"); + ImGui.Text($"{nameof(gauge.AmmoComboStep)}: {gauge.AmmoComboStep}"); + } + else if (jobID == 38) + { + var gauge = this.dalamud.ClientState.JobGauges.Get(); + ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); + ImGui.Text($"{nameof(gauge.Feathers)}: {gauge.Feathers}"); + ImGui.Text($"{nameof(gauge.Esprit)}: {gauge.Esprit}"); + ImGui.Text($"{nameof(gauge.CompletedSteps)}: {gauge.CompletedSteps}"); + ImGui.Text($"{nameof(gauge.NextStep)}: {gauge.NextStep}"); + ImGui.Text($"{nameof(gauge.IsDancing)}: {gauge.IsDancing}"); + } + else + { + ImGui.Text("No supported gauge exists for this job."); + } } private void DrawCommand() diff --git a/lib/FFXIVClientStructs b/lib/FFXIVClientStructs index cbbea8ea9..74556bdfe 160000 --- a/lib/FFXIVClientStructs +++ b/lib/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit cbbea8ea911dda876d4a996f214f337e4db88a01 +Subproject commit 74556bdfe469ed66ba77d613186a0c3d6eeda88d