From 14a3bd895f297bbf503cf3734b65b4957b0b4ebe Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Tue, 3 Sep 2024 21:31:11 -0700 Subject: add option to automatically open malmstone calculator when viewing series malmstone --- Malmstone/Windows/ConfigWindow.cs | 15 ++++++++++++++- Malmstone/Windows/MainWindow.cs | 11 +++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'Malmstone/Windows') diff --git a/Malmstone/Windows/ConfigWindow.cs b/Malmstone/Windows/ConfigWindow.cs index e6376b3..7d9e44e 100644 --- a/Malmstone/Windows/ConfigWindow.cs +++ b/Malmstone/Windows/ConfigWindow.cs @@ -16,7 +16,7 @@ public class ConfigWindow : Window, IDisposable Flags = ImGuiWindowFlags.NoCollapse | ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.NoScrollWithMouse; SizeConstraints = new WindowSizeConstraints { - MinimumSize = new Vector2(350, 300), + MinimumSize = new Vector2(370, 330), MaximumSize = new Vector2(float.MaxValue, float.MaxValue) }; Configuration = Plugin.Configuration; @@ -124,6 +124,19 @@ public class ConfigWindow : Window, IDisposable ImGui.Separator(); ImGui.Spacing(); + + ImGui.Text("Show calculations when viewing Series Malmstones"); + ImGui.SameLine(); + var showMainWindowOnPVPReward = Configuration.ShowMainWindowOnPVPReward; + if(ImGui.Checkbox("##ShowMainWindowOnPVPReward", ref showMainWindowOnPVPReward)){ + if(showMainWindowOnPVPReward) + Plugin.EnablePVPRewardWindowAddon(); + else + Plugin.DisablePVPRewardWindowAddon(); + Configuration.ShowMainWindowOnPVPReward = showMainWindowOnPVPReward; + Configuration.Save(); + } + ImGui.Text("Changes saved automatically"); } diff --git a/Malmstone/Windows/MainWindow.cs b/Malmstone/Windows/MainWindow.cs index 3cd53a4..4d4ca4c 100644 --- a/Malmstone/Windows/MainWindow.cs +++ b/Malmstone/Windows/MainWindow.cs @@ -1,5 +1,7 @@ using System; using System.Numerics; +using Dalamud.Game.Addon.Lifecycle.AddonArgTypes; +using Dalamud.Game.Addon.Lifecycle; using Dalamud.Interface.Windowing; using ImGuiNET; using Malmstone.Services; @@ -124,6 +126,15 @@ namespace Malmstone.Windows ImGui.Text("PvP Profile is not loaded."); } } + public void OnOpenPVPRewardWindow(AddonEvent eventType, AddonArgs addonInfo) + { + IsOpen = true; + } + + public void OnClosePVPRewardWindow(AddonEvent eventType, AddonArgs addonInfo) + { + IsOpen = false; + } } } -- cgit v1.2.3