diff options
| -rw-r--r-- | Malmstone/Addons/PvPMatchAddon.cs | 7 | ||||
| -rw-r--r-- | Malmstone/Configuration.cs | 4 | ||||
| -rw-r--r-- | Malmstone/Plugin.cs | 1 | ||||
| -rw-r--r-- | Malmstone/Windows/MainWindow.cs | 18 |
4 files changed, 25 insertions, 5 deletions
diff --git a/Malmstone/Addons/PvPMatchAddon.cs b/Malmstone/Addons/PvPMatchAddon.cs index c3f726a..896001a 100644 --- a/Malmstone/Addons/PvPMatchAddon.cs +++ b/Malmstone/Addons/PvPMatchAddon.cs @@ -53,7 +53,8 @@ namespace Malmstone.Addons public void EnableFrontlinePostMatch() { Plugin.AddonLifeCycle.RegisterListener(AddonEvent.PostSetup, "FrontlineRecord", OnFrontlineRecordTrigger); - Plugin.PvPService.CurrentFrontlineLosingBonus = -1; // Reset bonus tracking for now until config save is done + Plugin.PvPService.CurrentFrontlineLosingBonus = Plugin.Configuration.SavedFrontlineRewardBonus; + Plugin.Configuration.OutdatedFrontlineRewardBonus = true; FrontlineRecordPostSetupEnabled = true; } @@ -121,6 +122,7 @@ namespace Malmstone.Addons { FrontlineMatchResult = FrontlinePlacement.ThirdPlace; } + Plugin.Logger.Debug("Frontline Match Result: " + FrontlineMatchResult.ToString()); if (FrontlineMatchResult != FrontlinePlacement.Unknown) { unsafe @@ -135,6 +137,9 @@ namespace Malmstone.Addons if (int.TryParse(SeriesExpText, out int SeriesExpEarned)) { int CurrentLossBonus = Plugin.PvPService.GenerateFrontlineBonus(FrontlineMatchResult, SeriesExpEarned); + Plugin.Logger.Debug("Series EXP Earned: " + SeriesExpEarned.ToString()); + Plugin.Configuration.SavedFrontlineRewardBonus = CurrentLossBonus; + Plugin.Configuration.OutdatedFrontlineRewardBonus = false; } else { diff --git a/Malmstone/Configuration.cs b/Malmstone/Configuration.cs index c4d091b..4f62a96 100644 --- a/Malmstone/Configuration.cs +++ b/Malmstone/Configuration.cs @@ -17,7 +17,9 @@ public class Configuration : IPluginConfiguration public bool ShowMainWindowOnPVPReward { get; set; } = true; public bool SkipProgressionToastAfterGoal { get; set; } = false; public bool SkipProgressionChatAfterGoal { get; set; } = false; - public bool TrackFrontlineBonus { get; set; } = false; + public bool TrackFrontlineBonus { get; set; } = true; + public int SavedFrontlineRewardBonus { get; set; } = -1; + public bool OutdatedFrontlineRewardBonus { get; set; } = false; // the below exist just to make saving less cumbersome public void Save() diff --git a/Malmstone/Plugin.cs b/Malmstone/Plugin.cs index 87ebb06..ada8202 100644 --- a/Malmstone/Plugin.cs +++ b/Malmstone/Plugin.cs @@ -24,6 +24,7 @@ public sealed class Plugin : IDalamudPlugin [PluginService] internal static IChatGui Chat { get; private set; } = null!; [PluginService] internal static IAddonLifecycle AddonLifeCycle { get; private set; } = null!; [PluginService] internal static IToastGui ToastGui { get; private set; } = null!; + [PluginService] internal static IPluginLog Logger { get; set; } = default!; private const string CommandName = "/pmalm"; diff --git a/Malmstone/Windows/MainWindow.cs b/Malmstone/Windows/MainWindow.cs index 8da004f..bd1ef5d 100644 --- a/Malmstone/Windows/MainWindow.cs +++ b/Malmstone/Windows/MainWindow.cs @@ -26,7 +26,7 @@ namespace Malmstone.Windows { SizeConstraints = new WindowSizeConstraints { - MinimumSize = new Vector2(460, 510), + MinimumSize = new Vector2(460, 530), MaximumSize = new Vector2(float.MaxValue, float.MaxValue) }; @@ -120,7 +120,7 @@ namespace Malmstone.Windows { if(Plugin.PvPService.CurrentFrontlineLosingBonus == 0) { - ImGui.TextColored(new Vector4(0.0f, 1.0f, 0.0f, 1.0f), "No Frontline Reward Bonus Currently Active"); + ImGui.Text("No Frontline Reward Bonus Currently Active"); } else { @@ -129,7 +129,19 @@ namespace Malmstone.Windows { ImGui.BeginTooltip(); ImGui.Text("You will earn a " + Plugin.PvPService.CurrentFrontlineLosingBonus + "%% bonus on PvP EXP, Series EXP, and Wolf Marks " + - "until attain First Place" ); + "until attaining First Place" ); + ImGui.EndTooltip(); + } + } + if (Plugin.Configuration.OutdatedFrontlineRewardBonus) + { + ImGui.SameLine(); + ImGui.TextColored(new Vector4(1.0f, 0.0f, 0.0f, 1.0f),"(Outdated)"); + if (ImGui.IsItemHovered()) + { + ImGui.BeginTooltip(); + ImGui.Text("This information may be outdated due to Frontline tracking loading and unloading!" + + "\nCalculations will refresh after your next match of Frontlines"); ImGui.EndTooltip(); } } |
