From 031440201d24531d6a1d5a0e93579d76e1e4ba18 Mon Sep 17 00:00:00 2001 From: Pinapelz Date: Sun, 8 Sep 2024 16:52:23 -0700 Subject: add saving functionality to frontline reward bonus - marks as outdated if FrontlineRecord listener is disabled at any point --- Malmstone/Addons/PvPMatchAddon.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'Malmstone/Addons/PvPMatchAddon.cs') 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 { -- cgit v1.2.3