Gauge update (again)

This commit is contained in:
Raymond 2021-12-05 12:13:02 -05:00
parent a86887f1bf
commit 8758c4c04d
6 changed files with 127 additions and 185 deletions

View file

@ -24,5 +24,25 @@ namespace Dalamud.Game.ClientState.JobGauge.Enums
/// Ruby carbuncle pet glam.
/// </summary>
RUBY = 3,
/// <summary>
/// Normal carbuncle pet glam.
/// </summary>
CARBUNCLE = 4,
/// <summary>
/// Ifrit Egi pet glam.
/// </summary>
IFRIT = 5,
/// <summary>
/// Titan Egi pet glam.
/// </summary>
TITAN = 6,
/// <summary>
/// Garuda Egi pet glam.
/// </summary>
GARUDA = 7,
}
}

View file

@ -11,18 +11,8 @@ namespace Dalamud.Game.ClientState.JobGauge.Enums
NONE = 0,
/// <summary>
/// The summoned pet Ifrit.
/// The summoned pet Carbuncle.
/// </summary>
IFRIT = 3,
/// <summary>
/// The summoned pet Titan.
/// </summary>
TITAN = 4,
/// <summary>
/// The summoned pet Garuda.
/// </summary>
GARUDA = 5,
CARBUNCLE = 23,
}
}

View file

@ -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
/// <returns>Currently drawn crown <see cref="CardType"/>.</returns>
public CardType DrawnCrownCard => (CardType)(this.Struct->Card - (this.Struct->Card % 10));
/// <summary>
/// Gets the <see cref="SealType"/>s currently active.
/// </summary>
public SealType[] Seals => this.Struct->CurrentSeals.Cast<SealType>().ToArray();
/// <summary>
/// Check if a <see cref="SealType"/> is currently active on the divination gauge.
/// </summary>
/// <param name="seal">The <see cref="SealType"/> to check for.</param>
/// <returns>If the given Seal is currently divined.</returns>
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);
}
}

View file

@ -1,13 +1,14 @@
using System;
using Dalamud.Game.ClientState.JobGauge.Enums;
using FFXIVClientStructs.FFXIV.Client.Game.Gauge;
namespace Dalamud.Game.ClientState.JobGauge.Types
{
/// <summary>
/// In-memory SMN job gauge.
/// </summary>
public unsafe class SMNGauge : JobGaugeBase<FFXIVClientStructs.FFXIV.Client.Game.Gauge.SummonerGauge>
public unsafe class SMNGauge : JobGaugeBase<SummonerGauge>
{
/// <summary>
/// Initializes a new instance of the <see cref="SMNGauge"/> class.
@ -21,40 +22,93 @@ namespace Dalamud.Game.ClientState.JobGauge.Types
/// <summary>
/// Gets the time remaining for the current summon.
/// </summary>
public short TimerRemaining => this.Struct->TimerRemaining;
public ushort SummonTimerRemaining => this.Struct->SummonTimer;
/// <summary>
/// Gets the time remaining for the current attunement.
/// </summary>
public ushort AttunmentTimerRemaining => this.Struct->SummonTimer;
/// <summary>
/// Gets the summon that will return after the current summon expires.
/// This maps to the <see cref="Lumina.Excel.GeneratedSheets.Pet"/> sheet.
/// </summary>
public SummonPet ReturnSummon => (SummonPet)this.Struct->ReturnSummon;
/// <summary>
/// Gets the summon glam for the <see cref="ReturnSummon"/>.
/// This maps to the <see cref="Lumina.Excel.GeneratedSheets.PetMirage"/> sheet.
/// </summary>
public PetGlam ReturnSummonGlam => (PetGlam)this.Struct->ReturnSummonGlam;
/// <summary>
/// Gets the amount of aspected Attunment remaining.
/// </summary>
public byte Attunement => this.Struct->Attunement;
/// <summary>
/// Gets the current aether flags.
/// Use the summon accessors instead.
/// </summary>
public byte AetherFlags => this.Struct->AetherFlags;
/// <summary>
/// Gets a value indicating whether if Phoenix is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsPhoenixReady => (this.AetherFlags & 0x10) > 0;
public AetherFlags AetherFlags => this.Struct->AetherFlags;
/// <summary>
/// Gets a value indicating whether Bahamut is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsBahamutReady => (this.AetherFlags & 8) > 0;
public bool IsBahamutReady => !this.AetherFlags.HasFlag(AetherFlags.PhoenixReady);
/// <summary>
/// Gets a value indicating whether if Phoenix is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsPhoenixReady => this.AetherFlags.HasFlag(AetherFlags.PhoenixReady);
/// <summary>
/// Gets a value indicating whether if Ifrit is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsIfritReady => this.AetherFlags.HasFlag(AetherFlags.IfritReady);
/// <summary>
/// Gets a value indicating whether if Titan is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsTitanReady => this.AetherFlags.HasFlag(AetherFlags.TitanReady);
/// <summary>
/// Gets a value indicating whether if Garuda is ready to be summoned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsGarudaReady => this.AetherFlags.HasFlag(AetherFlags.GarudaReady);
/// <summary>
/// Gets a value indicating whether if Ifrit is currently attuned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsIfritAttuned => this.AetherFlags.HasFlag(AetherFlags.IfritAttuned) && !this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned);
/// <summary>
/// Gets a value indicating whether if Titan is currently attuned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsTitanAttuned => this.AetherFlags.HasFlag(AetherFlags.TitanAttuned) && !this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned);
/// <summary>
/// Gets a value indicating whether if Garuda is currently attuned.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool IsGarudaAttuned => this.AetherFlags.HasFlag(AetherFlags.GarudaAttuned);
/// <summary>
/// Gets a value indicating whether there are any Aetherflow stacks available.
/// </summary>
/// <returns><c>true</c> or <c>false</c>.</returns>
public bool HasAetherflowStacks => (this.AetherFlags & 3) > 0;
public bool HasAetherflowStacks => this.AetherflowStacks > 0;
/// <summary>
/// Gets the amount of Aetherflow available.
/// </summary>
public byte AetherflowStacks => (byte)(this.AetherFlags & AetherFlags.Aetherflow);
}
}

View file

@ -769,163 +769,41 @@ namespace Dalamud.Interface.Internal.Windows
}
var jobID = player.ClassJob.Id;
if (jobID == 19)
JobGaugeBase? gauge = jobID switch
{
var gauge = jobGauges.Get<PLDGauge>();
ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}");
ImGui.Text($"{nameof(gauge.OathGauge)}: {gauge.OathGauge}");
}
else if (jobID == 20)
{
var gauge = jobGauges.Get<MNKGauge>();
ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}");
ImGui.Text($"{nameof(gauge.Chakra)}: {gauge.Chakra}");
}
else if (jobID == 21)
{
var gauge = jobGauges.Get<WARGauge>();
ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}");
ImGui.Text($"{nameof(gauge.BeastGauge)}: {gauge.BeastGauge}");
}
else if (jobID == 22)
{
var gauge = jobGauges.Get<DRGGauge>();
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<BRDGauge>();
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<WHMGauge>();
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<BLMGauge>();
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<SMNGauge>();
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<SCHGauge>();
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<NINGauge>();
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<MCHGauge>();
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<DRKGauge>();
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<ASTGauge>();
ImGui.Text($"Address: 0x{gauge.Address.ToInt64():X}");
ImGui.Text($"{nameof(gauge.DrawnCard)}: {gauge.DrawnCard}");
foreach (var seal in Enum.GetValues(typeof(SealType)).Cast<SealType>())
{
var sealName = Enum.GetName(typeof(SealType), seal);
ImGui.Text($"{nameof(gauge.ContainsSeal)}({sealName}): {gauge.ContainsSeal(seal)}");
}
}
else if (jobID == 34)
{
var gauge = jobGauges.Get<SAMGauge>();
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<RDMGauge>();
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<GNBGauge>();
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<DNCGauge>();
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<PLDGauge>(),
20 => jobGauges.Get<MNKGauge>(),
21 => jobGauges.Get<WARGauge>(),
22 => jobGauges.Get<DRGGauge>(),
23 => jobGauges.Get<BRDGauge>(),
24 => jobGauges.Get<WHMGauge>(),
25 => jobGauges.Get<BLMGauge>(),
27 => jobGauges.Get<SMNGauge>(),
28 => jobGauges.Get<SCHGauge>(),
30 => jobGauges.Get<NINGauge>(),
31 => jobGauges.Get<MCHGauge>(),
32 => jobGauges.Get<DRKGauge>(),
33 => jobGauges.Get<ASTGauge>(),
34 => jobGauges.Get<SAMGauge>(),
35 => jobGauges.Get<RDMGauge>(),
37 => jobGauges.Get<GNBGauge>(),
38 => jobGauges.Get<DNCGauge>(),
39 => jobGauges.Get<RPRGauge>(),
40 => jobGauges.Get<SGEGauge>(),
_ => null,
};
if (gauge == null)
{
ImGui.Text("No supported gauge exists for this job.");
return;
}
var props = gauge.GetType().GetProperties();
foreach (var prop in props)
{
var result = prop.GetValue(gauge);
ImGui.Text($"{prop.Name}: {result}");
}
}

@ -1 +1 @@
Subproject commit b4b577fce3710e03db6cf50724b1b3f39b60f368
Subproject commit 8a7333e6de43c3d315d757ea97dbd29ca5ef8f77