diff options
| author | Pinapelz <yukais@pinapelz.com> | 2024-09-03 21:31:11 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2024-09-03 21:35:52 -0700 |
| commit | 14a3bd895f297bbf503cf3734b65b4957b0b4ebe (patch) | |
| tree | a6186c85382d736c6ed137dce4c851099b54732e /Malmstone/Plugin.cs | |
| parent | effd23c9e254792d636ac43b17cb712a3fd49b1b (diff) | |
add option to automatically open malmstone calculator when viewing series malmstone
Diffstat (limited to 'Malmstone/Plugin.cs')
| -rw-r--r-- | Malmstone/Plugin.cs | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs index 3a4c679..be9858a 100644 --- a/Malmstone/Plugin.cs +++ b/Malmstone/Plugin.cs @@ -12,6 +12,7 @@ using System.Collections.Generic; using System.Linq; using Malmstone.Utils; using Malmstone.Addons; +using Dalamud.Game.Addon.Lifecycle; namespace Malmstone; @@ -51,12 +52,15 @@ public sealed class Plugin : IDalamudPlugin PvPAddon.EnableFrontlinePostMatch(); if (Configuration.ShowProgressionToastPostMatch) PvPAddon.EnablePostMatchProgressionToast(); + if (Configuration.ShowMainWindowOnPVPReward) + EnablePVPRewardWindowAddon(); + 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) @@ -84,6 +88,8 @@ public sealed class Plugin : IDalamudPlugin PvPAddon.DisableFrontlinePostMatch(); if (Configuration.ShowProgressionToastPostMatch) PvPAddon.DisablePostMatchProgressionToast(); + if(Configuration.ShowMainWindowOnPVPReward) + DisablePVPRewardWindowAddon(); CommandManager.RemoveHandler(CommandName); } @@ -237,4 +243,16 @@ private void OnCommand(string command, string args) public void ToggleConfigUI() => ConfigWindow.Toggle(); public void ToggleMainUI() => MainWindow.Toggle(); + + public void EnablePVPRewardWindowAddon() + { + AddonLifeCycle.RegisterListener(AddonEvent.PostSetup, "PvpReward", MainWindow.OnOpenPVPRewardWindow); + AddonLifeCycle.RegisterListener(AddonEvent.PreFinalize, "PvpReward", MainWindow.OnClosePVPRewardWindow); + } + public void DisablePVPRewardWindowAddon() + { + AddonLifeCycle.UnregisterListener(AddonEvent.PostSetup, "PvpReward", MainWindow.OnOpenPVPRewardWindow); + AddonLifeCycle.UnregisterListener(AddonEvent.PreFinalize, "PvpReward", MainWindow.OnClosePVPRewardWindow); + } } + |
