aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Malmstone/Addons/PvPMatchAddon.cs31
-rw-r--r--Malmstone/Plugin.cs2
-rw-r--r--Malmstone/Windows/ConfigWindow.cs6
3 files changed, 27 insertions, 12 deletions
diff --git a/Malmstone/Addons/PvPMatchAddon.cs b/Malmstone/Addons/PvPMatchAddon.cs
index 7912665..0acb617 100644
--- a/Malmstone/Addons/PvPMatchAddon.cs
+++ b/Malmstone/Addons/PvPMatchAddon.cs
@@ -22,6 +22,20 @@ namespace Malmstone.Addons
this.Plugin = Plugin;
}
+ public void EnablePostMatchProgressionToast()
+ {
+ Plugin.AddonLifeCycle.RegisterListener(AddonEvent.PreSetup, "MKSRecord", ShowSeriesProgressionToast);
+ Plugin.AddonLifeCycle.RegisterListener(AddonEvent.PreSetup, "FrontlineRecord", ShowSeriesProgressionToast);
+ Plugin.AddonLifeCycle.RegisterListener(AddonEvent.PreSetup, "ManeuversRecord", ShowSeriesProgressionToast);
+ }
+
+ public void DisablePostMatchProgressionToast()
+ {
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PreSetup, "MKSRecord", ShowSeriesProgressionToast);
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PreSetup, "FrontlineRecord", ShowSeriesProgressionToast);
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PreSetup, "ManeuversRecord", ShowSeriesProgressionToast);
+ }
+
public void EnableCrystallineConflictPostMatch()
{
Plugin.AddonLifeCycle.RegisterListener(AddonEvent.PostSetup, "MKSRecord", OnCrystallineConflictRecordTrigger);
@@ -29,7 +43,7 @@ namespace Malmstone.Addons
public void DisableCrystallineConflictPostMatch()
{
- Plugin.AddonLifeCycle.UnregisterListener(OnCrystallineConflictRecordTrigger);
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PostSetup, "MKSRecord", OnCrystallineConflictRecordTrigger);
}
public void EnableFrontlinePostMatch()
@@ -39,7 +53,7 @@ namespace Malmstone.Addons
public void DisableFrontlinePostMatch()
{
- Plugin.AddonLifeCycle.UnregisterListener(OnFrontlineRecordTrigger);
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PostSetup, "FrontlineRecord", OnFrontlineRecordTrigger);
}
public void EnableRivalWingsPostMatch()
@@ -48,7 +62,7 @@ namespace Malmstone.Addons
}
public void DisableRivalWingsPostMatch()
{
- Plugin.AddonLifeCycle.UnregisterListener(OnRivalWingsRecordTrigger);
+ Plugin.AddonLifeCycle.UnregisterListener(AddonEvent.PostSetup, "ManeuversRecord", OnRivalWingsRecordTrigger);
}
@@ -57,8 +71,6 @@ namespace Malmstone.Addons
{
PvPSeriesInfo? seriesInfo = Plugin.PvPService.GetPvPSeriesInfo();
if (seriesInfo == null) return;
- if (Plugin.Configuration.ShowProgressionToastPostMatch)
- ShowSeriesProgressionToast(seriesInfo);
if (Plugin.Configuration.ShowProgressionChatPostCC)
ShowSeriesProgressionMessage(seriesInfo, PvPContentType.CrystallineConflict);
}
@@ -67,8 +79,6 @@ namespace Malmstone.Addons
{
PvPSeriesInfo? seriesInfo = Plugin.PvPService.GetPvPSeriesInfo();
if (seriesInfo == null) return;
- if (Plugin.Configuration.ShowProgressionToastPostMatch)
- ShowSeriesProgressionToast(seriesInfo);
if (Plugin.Configuration.ShowProgressionChatPostFL)
ShowSeriesProgressionMessage(seriesInfo, PvPContentType.RivalWings);
}
@@ -77,15 +87,14 @@ namespace Malmstone.Addons
{
PvPSeriesInfo? seriesInfo = Plugin.PvPService.GetPvPSeriesInfo();
if (seriesInfo == null) return;
- if (Plugin.Configuration.ShowProgressionToastPostMatch)
- ShowSeriesProgressionToast(seriesInfo);
if (Plugin.Configuration.ShowProgressionChatPostRW)
ShowSeriesProgressionMessage(seriesInfo, PvPContentType.RivalWings);
}
-
- private void ShowSeriesProgressionToast(PvPSeriesInfo seriesInfo)
+ private void ShowSeriesProgressionToast(AddonEvent eventType, AddonArgs addonInfo)
{
+ PvPSeriesInfo? seriesInfo = Plugin.PvPService.GetPvPSeriesInfo();
+ if (seriesInfo == null) return;
switch (Plugin.Configuration.PostmatchProgressionToastType)
{
case 0:
diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs
index 4a387ec..b2cfde7 100644
--- a/Malmstone/Plugin.cs
+++ b/Malmstone/Plugin.cs
@@ -49,6 +49,8 @@ public sealed class Plugin : IDalamudPlugin
PvPAddon.EnableRivalWingsPostMatch();
if (Configuration.ShowProgressionChatPostFL)
PvPAddon.EnableFrontlinePostMatch();
+ if (Configuration.ShowProgressionToastPostMatch)
+ PvPAddon.EnablePostMatchProgressionToast();
if (Configuration.PostmatchProgressionToastType < 0 || Configuration.PostmatchProgressionToastType > 2)
{
Configuration.PostmatchProgressionToastType = 0;
diff --git a/Malmstone/Windows/ConfigWindow.cs b/Malmstone/Windows/ConfigWindow.cs
index 9858b7e..e6376b3 100644
--- a/Malmstone/Windows/ConfigWindow.cs
+++ b/Malmstone/Windows/ConfigWindow.cs
@@ -43,12 +43,16 @@ public class ConfigWindow : Window, IDisposable
ImGui.Separator();
- ImGui.Text("Show XP to next level after PVP matches");
+ ImGui.Text("Show EXP progression after PVP matches");
ImGui.SameLine();
var showProgressionToastPostMatch = Configuration.ShowProgressionToastPostMatch;
if (ImGui.Checkbox("##ShowProgressionToastPostMatch", ref showProgressionToastPostMatch))
{
Configuration.ShowProgressionToastPostMatch = showProgressionToastPostMatch;
+ if (showProgressionToastPostMatch)
+ Plugin.PvPAddon.EnablePostMatchProgressionToast();
+ else
+ Plugin.PvPAddon.DisablePostMatchProgressionToast();
Configuration.Save();
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage