diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-09-16 21:48:11 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-09-16 21:48:11 -0700 |
| commit | 745b939bb15bf41725d4e86e65366a1a8793bbc7 (patch) | |
| tree | 07b190c52400d8bd6ac960d8b8b21e9e779e0952 /Malmstone/Utils/UIChanger.cs | |
| parent | 481ec3932c98771310cf9d834ebad8446b01f5c4 (diff) | |
add option to replace in game UI series level with plugin tracked series level (tracking for series level above 30)
Diffstat (limited to 'Malmstone/Utils/UIChanger.cs')
| -rw-r--r-- | Malmstone/Utils/UIChanger.cs | 49 |
1 files changed, 49 insertions, 0 deletions
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()); + } + } + } +} |
