From 745b939bb15bf41725d4e86e65366a1a8793bbc7 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Mon, 16 Sep 2024 21:48:11 -0700 Subject: add option to replace in game UI series level with plugin tracked series level (tracking for series level above 30) --- Malmstone/Utils/UIChanger.cs | 49 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 Malmstone/Utils/UIChanger.cs (limited to 'Malmstone/Utils/UIChanger.cs') diff --git a/Malmstone/Utils/UIChanger.cs b/Malmstone/Utils/UIChanger.cs new file mode 100644 index 0000000..d764a83 --- /dev/null +++ b/Malmstone/Utils/UIChanger.cs @@ -0,0 +1,49 @@ +using Dalamud.Game.Addon.Lifecycle; +using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; +using FFXIVClientStructs.FFXIV.Component.GUI; +using Malmstone.Services; + +namespace Malmstone.Utils; + +public class UIChanger +{ + private Plugin Plugin; + public UIChanger(Plugin Plugin) + { + this.Plugin = Plugin; + } + + public void ReplacePVPRewardWindowSeriesRank(AddonEvent eventType, AddonArgs addonInfo) + { + unsafe + { + var PvpRewardWindow = (AtkUnitBase*)addonInfo.Addon; + var SeriesLevelTextNode = PvpRewardWindow->GetTextNodeById(16); + PvPSeriesInfo? PvPSeriesInfo = Plugin.PvPService.GetPvPSeriesInfo(); + if (SeriesLevelTextNode != null && PvPSeriesInfo != null) + { + var CurrentSeriesRank = PvPSeriesInfo.CurrentSeriesRank + + Plugin.GetSavedExtraLevels(); + SeriesLevelTextNode->SetText(CurrentSeriesRank.ToString()); + } + } + } + + public void ReplacePVPProfileWindowSeriesRank(AddonEvent eventType, AddonArgs addonInfo) + { + unsafe + { + var PvpProfileWindow = (AtkUnitBase*)addonInfo.Addon; + var SeriesLevelTextNode = PvpProfileWindow->GetTextNodeById(24); + PvPSeriesInfo? PvPSeriesInfo = Plugin.PvPService.GetPvPSeriesInfo(); + if (PvPSeriesInfo == null) + return; + var CurrentSeriesRank = PvPSeriesInfo.CurrentSeriesRank + + Plugin.GetSavedExtraLevels(); + if (SeriesLevelTextNode != null) + { + SeriesLevelTextNode->SetText(CurrentSeriesRank.ToString()); + } + } + } +} -- cgit v1.2.3