Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Kurochi51 committed Sep 20, 2023
1 parent 9f2b629 commit acb1a3d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 19 deletions.
2 changes: 0 additions & 2 deletions TickTracker/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace TickTracker
{
#pragma warning disable MA0048 // File name must match type name
/// <summary>
/// An enum of expected <see cref="WindowType" />.<paramref name="window"/>
/// </summary>
Expand Down Expand Up @@ -66,5 +65,4 @@ public enum ActionEffectType : byte
VFX = 59,
JobGauge = 61,
};
#pragma warning restore MA0048 // File name must match type name
}
9 changes: 5 additions & 4 deletions TickTracker/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ public sealed class Plugin : IDalamudPlugin
// Seems to trigger when a regen would be active, or there's a CP/GP update
private unsafe delegate void ReceiveSecondaryActorUpdateDelegate(uint objectId, byte* packetData, byte unkByte);

[Obsolete("The update delegates aren't affected by stuff like healing, so this has become unnecessary")]
[Signature("40 55 53 57 41 54 41 55 41 56 41 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B 05 ?? ?? ?? ?? 48 33 C4 48 89 45 70", DetourName = nameof(ReceiveActionEffect))]
private readonly Hook<ReceiveActionEffectDelegate>? receiveActionEffectHook = null;

Expand Down Expand Up @@ -229,7 +230,7 @@ private void UpdateHPTick(double currentTime, bool hpRegen, bool regenHalt)
{
HPBarWindow.LastTick = syncValue;
}
else if (lastHPValue != currentHP && !HPBarWindow.FastTick && HPBarWindow.CanUpdate && HPBarWindow.UpdateAvailable)
else if (lastHPValue != currentHP && !HPBarWindow.FastTick && HPBarWindow.CanUpdate)
{
HPBarWindow.LastTick = currentTime;
HPBarWindow.CanUpdate = false;
Expand All @@ -238,7 +239,7 @@ private void UpdateHPTick(double currentTime, bool hpRegen, bool regenHalt)
healTriggered = false;
}
}
else if (lastHPValue != currentHP && HPBarWindow.FastTick && HPBarWindow.UpdateAvailable)
else if (lastHPValue != currentHP && HPBarWindow.FastTick)
{
if (HPBarWindow.CanUpdate)
{
Expand Down Expand Up @@ -276,7 +277,7 @@ private void UpdateMPTick(double currentTime, bool mpRegen, bool regenHalt)
{
MPBarWindow.LastTick = syncValue;
}
else if (lastMPValue != currentMP && !MPBarWindow.FastTick && MPBarWindow.CanUpdate && MPBarWindow.UpdateAvailable)
else if (lastMPValue != currentMP && !MPBarWindow.FastTick && MPBarWindow.CanUpdate)
{
MPBarWindow.LastTick = currentTime;
MPBarWindow.CanUpdate = false;
Expand All @@ -285,7 +286,7 @@ private void UpdateMPTick(double currentTime, bool mpRegen, bool regenHalt)
mpGainTriggered = false;
}
}
else if (lastMPValue != currentMP && MPBarWindow.FastTick && MPBarWindow.UpdateAvailable)
else if (lastMPValue != currentMP && MPBarWindow.FastTick)
{
if (MPBarWindow.CanUpdate)
{
Expand Down
2 changes: 2 additions & 0 deletions TickTracker/TickTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
</ItemGroup>

<PropertyGroup>
<!-- D:\yes\DalamudV9\bin\Release\ -->
<!-- $(appdata)\XIVLauncher\addon\Hooks\dev\ -->
<DalamudLibPath>$(appdata)\XIVLauncher\addon\Hooks\dev\</DalamudLibPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>
Expand Down
1 change: 0 additions & 1 deletion TickTracker/Windows/BarWindowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public abstract class BarWindowBase : Window
ImGuiWindowFlags.NoResize |
ImGuiWindowFlags.NoNav |
ImGuiWindowFlags.NoInputs;
public bool UpdateAvailable { get; set; }
public bool FastRegenSwitch { get; set; }
public bool RegenHalted { get; set; }
public bool FastTick { get; set; }
Expand Down
16 changes: 8 additions & 8 deletions TickTracker/Windows/DebugWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,22 +61,22 @@ public override void Draw()
ImGui.Spacing();
var maxRegenCount = Math.Max(HealthRegenDictionary.Count, ManaRegenDictionary.Count);
var maxDisabledRegenCount = Math.Max(DisabledHealthRegenDictionary.Count, DisabledManaRegenDictionary.Count);
var column1Table1 = " Health Regen Status IDs";
var column2Table1 = "Mana Regen Status IDs";
var column1Table2 = " Disabled HP Regen Status IDs";
var column2Table2 = "Disabled MP Regen Status IDs";
var Table1Column1 = " Health Regen Status IDs";
var Table1Column2 = "Mana Regen Status IDs";
var Table2Column1 = " Disabled HP Regen Status IDs";
var Table2Column2 = "Disabled MP Regen Status IDs";
if (firstTime)
{
DetermineColumnWidth(column1Table1, column2Table1, HealthRegenDictionary, ManaRegenDictionary, ref hpWidth, ref mpWidth);
DetermineColumnWidth(column1Table2, column2Table2, DisabledHealthRegenDictionary, DisabledManaRegenDictionary, ref disabledHPWidth, ref disabledMPWidth);
DetermineColumnWidth(Table1Column1, Table1Column2, HealthRegenDictionary, ManaRegenDictionary, ref hpWidth, ref mpWidth);
DetermineColumnWidth(Table2Column1, Table2Column2, DisabledHealthRegenDictionary, DisabledManaRegenDictionary, ref disabledHPWidth, ref disabledMPWidth);
firstTime = false;
}
using (var scrollArea = ImRaii.Child("ScrollArea", new Vector2(ImGui.GetContentRegionAvail().X, ImGui.GetContentRegionAvail().Y - 40f), border: true))
{
DrawTable("DisabledRegenSID", column1Table2, column2Table2, disabledHPWidth, disabledMPWidth, maxDisabledRegenCount, DisabledHealthRegenDictionary, DisabledManaRegenDictionary);
DrawTable("DisabledRegenSID", Table2Column1, Table2Column2, disabledHPWidth, disabledMPWidth, maxDisabledRegenCount, DisabledHealthRegenDictionary, DisabledManaRegenDictionary);
ImGui.Separator();
ImGui.Spacing();
DrawTable("RegenSID", column1Table1, column2Table1, hpWidth, mpWidth, maxRegenCount, HealthRegenDictionary, ManaRegenDictionary);
DrawTable("RegenSID", Table1Column1, Table1Column2, hpWidth, mpWidth, maxRegenCount, HealthRegenDictionary, ManaRegenDictionary);
}
CopyAndClose();
}
Expand Down
2 changes: 0 additions & 2 deletions TickTracker/Windows/HPBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public override void Draw()
FastRegenSwitch = false;
}
}
//TODO: revisit and test this
UpdateAvailable = progress >= 1;
if (RegenHalted)
{
progress = PreviousProgress;
Expand Down
2 changes: 0 additions & 2 deletions TickTracker/Windows/MPBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ public override void Draw()
FastRegenSwitch = false;
}
}
//TODO: revisit and test this
UpdateAvailable = progress >= 1;
if (RegenHalted)
{
progress = PreviousProgress;
Expand Down

0 comments on commit acb1a3d

Please sign in to comment.