diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs b/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs index 343cbfd8e..7aaaca908 100644 --- a/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs +++ b/Dalamud/Game/ClientState/JobGauge/Enums/PetGlam.cs @@ -24,5 +24,25 @@ namespace Dalamud.Game.ClientState.JobGauge.Enums /// Ruby carbuncle pet glam. /// RUBY = 3, + + /// + /// Normal carbuncle pet glam. + /// + CARBUNCLE = 4, + + /// + /// Ifrit Egi pet glam. + /// + IFRIT = 5, + + /// + /// Titan Egi pet glam. + /// + TITAN = 6, + + /// + /// Garuda Egi pet glam. + /// + GARUDA = 7, } } diff --git a/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs b/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs index d0b1e933f..aa7e7c8a2 100644 --- a/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs +++ b/Dalamud/Game/ClientState/JobGauge/Enums/SummonPet.cs @@ -11,18 +11,8 @@ namespace Dalamud.Game.ClientState.JobGauge.Enums NONE = 0, /// - /// The summoned pet Ifrit. + /// The summoned pet Carbuncle. /// - IFRIT = 3, - - /// - /// The summoned pet Titan. - /// - TITAN = 4, - - /// - /// The summoned pet Garuda. - /// - GARUDA = 5, + CARBUNCLE = 23, } } diff --git a/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs index 14b2ff19f..f0ca3269e 100644 --- a/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs +++ b/Dalamud/Game/ClientState/JobGauge/Types/ASTGauge.cs @@ -1,4 +1,5 @@ using System; +using System.Linq; using Dalamud.Game.ClientState.JobGauge.Enums; @@ -30,17 +31,16 @@ namespace Dalamud.Game.ClientState.JobGauge.Types /// Currently drawn crown . public CardType DrawnCrownCard => (CardType)(this.Struct->Card - (this.Struct->Card % 10)); + /// + /// Gets the s currently active. + /// + public SealType[] Seals => this.Struct->CurrentSeals.Cast().ToArray(); + /// /// 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; - } + public unsafe bool ContainsSeal(SealType seal) => this.Seals.Contains(seal); } } diff --git a/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs b/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs index 5074f0bc9..9fa75296e 100644 --- a/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs +++ b/Dalamud/Game/ClientState/JobGauge/Types/SMNGauge.cs @@ -1,13 +1,14 @@ using System; using Dalamud.Game.ClientState.JobGauge.Enums; +using FFXIVClientStructs.FFXIV.Client.Game.Gauge; namespace Dalamud.Game.ClientState.JobGauge.Types { /// /// In-memory SMN job gauge. /// - public unsafe class SMNGauge : JobGaugeBase + public unsafe class SMNGauge : JobGaugeBase { /// /// Initializes a new instance of the class. @@ -21,40 +22,93 @@ namespace Dalamud.Game.ClientState.JobGauge.Types /// /// Gets the time remaining for the current summon. /// - public short TimerRemaining => this.Struct->TimerRemaining; + public ushort SummonTimerRemaining => this.Struct->SummonTimer; + + /// + /// Gets the time remaining for the current attunement. + /// + public ushort AttunmentTimerRemaining => this.Struct->SummonTimer; /// /// Gets the summon that will return after the current summon expires. + /// This maps to the sheet. /// public SummonPet ReturnSummon => (SummonPet)this.Struct->ReturnSummon; /// /// Gets the summon glam for the . + /// This maps to the sheet. /// public PetGlam ReturnSummonGlam => (PetGlam)this.Struct->ReturnSummonGlam; + /// + /// Gets the amount of aspected Attunment remaining. + /// + public byte Attunement => this.Struct->Attunement; + /// /// 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; + public AetherFlags AetherFlags => this.Struct->AetherFlags; /// /// Gets a value indicating whether Bahamut is ready to be summoned. /// /// true or false. - public bool IsBahamutReady => (this.AetherFlags & 8) > 0; + public bool IsBahamutReady => !this.AetherFlags.HasFlag(AetherFlags.PhoenixReady); + + /// + /// Gets a value indicating whether if Phoenix is ready to be summoned. + /// + /// true or false. + public bool IsPhoenixReady => this.AetherFlags.HasFlag(AetherFlags.PhoenixReady); + + /// + /// Gets a value indicating whether if Ifrit is ready to be summoned. + /// + /// true or false. + public bool IsIfritReady => this.AetherFlags.HasFlag(AetherFlags.IfritReady); + + /// + /// Gets a value indicating whether if Titan is ready to be summoned. + /// + /// true or false. + public bool IsTitanReady => this.AetherFlags.HasFlag(AetherFlags.TitanReady); + + /// + /// Gets a value indicating whether if Garuda is ready to be summoned. + /// + /// true or false. + public bool IsGarudaReady => this.AetherFlags.HasFlag(AetherFlags.GarudaReady); + + /// + /// Gets a value indicating whether if Ifrit is currently attuned. + /// + /// true or false. + public bool IsIfritAttuned => this.AetherFlags.HasFlag(AetherFlags.IfritAttuned) && !this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned); + + /// + /// Gets a value indicating whether if Titan is currently attuned. + /// + /// true or false. + public bool IsTitanAttuned => this.AetherFlags.HasFlag(AetherFlags.TitanAttuned) && !this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned); + + /// + /// Gets a value indicating whether if Garuda is currently attuned. + /// + /// true or false. + public bool IsGarudaAttuned => this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned); /// /// Gets a value indicating whether there are any Aetherflow stacks available. /// /// true or false. - public bool HasAetherflowStacks => (this.AetherFlags & 3) > 0; + public bool HasAetherflowStacks => this.AetherflowStacks > 0; + + /// + /// Gets the amount of Aetherflow available. + /// + public byte AetherflowStacks => (byte)(this.AetherFlags & AetherFlags.Aetherflow); } } diff --git a/Dalamud/Interface/Internal/Windows/DataWindow.cs b/Dalamud/Interface/Internal/Windows/DataWindow.cs index 4128d41d3..724728c63 100644 --- a/Dalamud/Interface/Internal/Windows/DataWindow.cs +++ b/Dalamud/Interface/Internal/Windows/DataWindow.cs @@ -769,164 +769,37 @@ namespace Dalamud.Interface.Internal.Windows } var jobID = player.ClassJob.Id; - if (jobID == 19) + JobGaugeBase? gauge = jobID switch { - var gauge = jobGauges.Get(); - ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); - ImGui.Text($"{nameof(gauge.OathGauge)}: {gauge.OathGauge}"); - } - else if (jobID == 20) - { - var gauge = jobGauges.Get(); - ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); - ImGui.Text($"{nameof(gauge.Chakra)}: {gauge.Chakra}"); - } - else if (jobID == 21) - { - var gauge = jobGauges.Get(); - ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}"); - ImGui.Text($"{nameof(gauge.BeastGauge)}: {gauge.BeastGauge}"); - } - else if (jobID == 22) - { - var gauge = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 = 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 + 19 => jobGauges.Get(), + 20 => jobGauges.Get(), + 21 => jobGauges.Get(), + 22 => jobGauges.Get(), + 23 => jobGauges.Get(), + 24 => jobGauges.Get(), + 25 => jobGauges.Get(), + 27 => jobGauges.Get(), + 28 => jobGauges.Get(), + 30 => jobGauges.Get(), + 31 => jobGauges.Get(), + 32 => jobGauges.Get(), + 33 => jobGauges.Get(), + 34 => jobGauges.Get(), + 35 => jobGauges.Get(), + 37 => jobGauges.Get(), + 38 => jobGauges.Get(), + 39 => jobGauges.Get(), + 40 => jobGauges.Get(), + _ => null, + }; + + if (gauge == null) { ImGui.Text("No supported gauge exists for this job."); + return; } + + Util.ShowObject(gauge); } private void DrawCommand() diff --git a/Dalamud/Utility/Util.cs b/Dalamud/Utility/Util.cs index 658ebb79c..f69a75f60 100644 --- a/Dalamud/Utility/Util.cs +++ b/Dalamud/Utility/Util.cs @@ -174,7 +174,12 @@ namespace Dalamud.Utility foreach (var propertyInfo in type.GetProperties()) { - ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: {propertyInfo.GetValue(obj)}"); + var value = propertyInfo.GetValue(obj); + var valueType = value?.GetType(); + if (valueType == typeof(IntPtr)) + ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: 0x{value:X}"); + else + ImGui.TextColored(ImGuiColors.DalamudOrange, $" {propertyInfo.Name}: {value}"); } ImGui.Unindent(); diff --git a/lib/FFXIVClientStructs b/lib/FFXIVClientStructs index b4b577fce..8a7333e6d 160000 --- a/lib/FFXIVClientStructs +++ b/lib/FFXIVClientStructs @@ -1 +1 @@ -Subproject commit b4b577fce3710e03db6cf50724b1b3f39b60f368 +Subproject commit 8a7333e6de43c3d315d757ea97dbd29ca5ef8f77