aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-09-02 20:34:32 -0700
committerPinapelz <yukais@pinapelz.com>2024-09-02 20:34:32 -0700
commitfcecdca25688aca015d352602b7daf2610522d97 (patch)
tree952e700ba4b76496140362dbc5bfd077ab12eeac
parent5e12dcba54bb04586069eb38d3300ec3c395be1e (diff)
add configuration options for showing different toast types
-rw-r--r--Malmstone/Addons/PvPMatchAddon.cs24
-rw-r--r--Malmstone/Configuration.cs1
-rw-r--r--Malmstone/Plugin.cs14
-rw-r--r--Malmstone/Windows/ConfigWindow.cs24
4 files changed, 55 insertions, 8 deletions
diff --git a/Malmstone/Addons/PvPMatchAddon.cs b/Malmstone/Addons/PvPMatchAddon.cs
index 69c16e0..94d35b0 100644
--- a/Malmstone/Addons/PvPMatchAddon.cs
+++ b/Malmstone/Addons/PvPMatchAddon.cs
@@ -89,14 +89,30 @@ namespace Malmstone.Addons
private void ShowSeriesProgressionToast(PvPSeriesInfo seriesInfo)
{
- Plugin.ToastGui.ShowNormal("Series Level " + seriesInfo.CurrentSeriesRank +
- " " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
+ switch (Plugin.Configuration.PostmatchProgressionToastType)
+ {
+ case 0:
+ Plugin.ToastGui.ShowNormal("Series Level " + seriesInfo.CurrentSeriesRank +
+ " " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
+ break;
+ case 1:
+ Plugin.ToastGui.ShowQuest("Series Level " + seriesInfo.CurrentSeriesRank +
+ " " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
+ break;
+ case 2:
+ Plugin.ToastGui.ShowError("Series Level " + seriesInfo.CurrentSeriesRank +
+ " " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
+ break;
+ default:
+ Plugin.ToastGui.ShowNormal("Series Level " + seriesInfo.CurrentSeriesRank +
+ " " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
+ break;
+ }
+
}
private void ShowSeriesProgressionMessage(PvPSeriesInfo seriesInfo, PvPContentType contentType)
{
- Plugin.Chat.Print("Series Level " + seriesInfo.CurrentSeriesRank +
- " - " + seriesInfo.SeriesExperience + "/" + MalmstoneXPCalculator.GetXPTargetForCurrentLevel(seriesInfo.CurrentSeriesRank) + " EXP");
var seString = new SeString(new List<Payload>());
switch (contentType)
{
diff --git a/Malmstone/Configuration.cs b/Malmstone/Configuration.cs
index a353e88..ce87dfd 100644
--- a/Malmstone/Configuration.cs
+++ b/Malmstone/Configuration.cs
@@ -10,6 +10,7 @@ public class Configuration : IPluginConfiguration
public int Version { get; set; } = 0;
public int DefaultTargetRankProperty { get; set; } = 1;
+ public int PostmatchProgressionToastType { get; set; } = 0; // 0 = normal, 1=quest, 2=error
public bool ShowProgressionToastPostMatch { get; set; } = true;
public bool ShowProgressionChatPostRW { get; set; } = true;
public bool ShowProgressionChatPostCC { get; set; } = true;
diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs
index 20c3ad7..4a387ec 100644
--- a/Malmstone/Plugin.cs
+++ b/Malmstone/Plugin.cs
@@ -43,10 +43,18 @@ public sealed class Plugin : IDalamudPlugin
MainWindow = new MainWindow(this);
PvPService = new PvPService();
PvPAddon = new PvPMatchAddon(this);
- PvPAddon.EnableCrystallineConflictPostMatch();
- PvPAddon.EnableRivalWingsPostMatch();
+ if (Configuration.ShowProgressionChatPostCC)
+ PvPAddon.EnableCrystallineConflictPostMatch();
+ if (Configuration.ShowProgressionChatPostRW)
+ PvPAddon.EnableRivalWingsPostMatch();
+ if (Configuration.ShowProgressionChatPostFL)
+ PvPAddon.EnableFrontlinePostMatch();
+ if (Configuration.PostmatchProgressionToastType < 0 || Configuration.PostmatchProgressionToastType > 2)
+ {
+ Configuration.PostmatchProgressionToastType = 0;
+ }
- WindowSystem.AddWindow(ConfigWindow);
+ WindowSystem.AddWindow(ConfigWindow);
WindowSystem.AddWindow(MainWindow);
CommandManager.AddHandler(CommandName, new CommandInfo(OnCommand)
diff --git a/Malmstone/Windows/ConfigWindow.cs b/Malmstone/Windows/ConfigWindow.cs
index 494c7cc..37b9490 100644
--- a/Malmstone/Windows/ConfigWindow.cs
+++ b/Malmstone/Windows/ConfigWindow.cs
@@ -9,6 +9,7 @@ public class ConfigWindow : Window, IDisposable
{
private Configuration Configuration;
private Plugin Plugin;
+ private string[] ToastOptions = {"Normal", "Quest", "Error"};
public ConfigWindow(Plugin Plugin) : base("Malmstone Config")
{
@@ -40,6 +41,7 @@ public class ConfigWindow : Window, IDisposable
ImGui.Separator();
ImGui.Text("Show XP to next level after PVP matches");
+ ImGui.SameLine();
var showProgressionToastPostMatch = Configuration.ShowProgressionToastPostMatch;
if (ImGui.Checkbox("##ShowProgressionToastPostMatch", ref showProgressionToastPostMatch))
{
@@ -47,8 +49,28 @@ public class ConfigWindow : Window, IDisposable
Configuration.Save();
}
+ ImGui.Text("Notification Type");
+ int selectedPostMatchToastType = Configuration.PostmatchProgressionToastType;
+ if (ImGui.Combo("##MatchOptions", ref selectedPostMatchToastType, ToastOptions, ToastOptions.Length))
+ {
+ switch (selectedPostMatchToastType)
+ {
+ case 0:
+ Plugin.ToastGui.ShowNormal("[Malmstone Calculator] Normal Toast Selected");
+ break;
+ case 1:
+ Plugin.ToastGui.ShowQuest("[Malmstone Calculator] Quest Toast Selected");
+ break;
+ case 2:
+ Plugin.ToastGui.ShowError("[Malmstone Calculator] Error Toast Selected");
+ break;
+ }
+ Configuration.PostmatchProgressionToastType = selectedPostMatchToastType;
+ Configuration.Save();
+ }
+
ImGui.Separator();
- ImGui.Text("Show matches to next rank in chat postmatch");
+ ImGui.Text("Show matches until next rank in chat after");
var showCCMatchesRemainingPostGame = Configuration.ShowProgressionChatPostCC;
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage