blob: ca26d692121b815dc652ec79a52b3628f0055bb2 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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.Address;
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.Address;
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());
}
}
}
}
|