diff --git a/CHANGELOG.md b/CHANGELOG.md index fd3824f..8e77ae5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ - Added lyrics to the existing track HighLow. - New random track will be selected every time instead of having the same track all day. - Groupped tracks (verses of the same song) are still played together in a sequence. +- Don't reset overridden Game Over text prematurely at the end of round. ## MuzikaGromche 1337.9001.68 - LocalHost hotfix diff --git a/MuzikaGromche/DeathScreenManager.cs b/MuzikaGromche/DeathScreenManager.cs index cb5291c..1dbfa40 100644 --- a/MuzikaGromche/DeathScreenManager.cs +++ b/MuzikaGromche/DeathScreenManager.cs @@ -21,7 +21,12 @@ namespace MuzikaGromche SetTextImpl(text ?? GameOverTextModdedDefault); } - public static IEnumerator SetTextAndClear(string? text) + public static void SetTextAndClear(string? text) + { + HUDManager.Instance.StartCoroutine(SetTextAndClearImpl(text)); + } + + public static IEnumerator SetTextAndClearImpl(string? text) { SetText(text); // Game Over animation duration is about 4.25 seconds @@ -60,7 +65,6 @@ namespace MuzikaGromche [HarmonyPatch(typeof(RoundManager))] static class DeathScreenGameOverTextResetPatch { - [HarmonyPatch(nameof(RoundManager.DespawnPropsAtEndOfRound))] [HarmonyPatch(nameof(RoundManager.OnDestroy))] [HarmonyPrefix] static void OnDestroy(RoundManager __instance) diff --git a/MuzikaGromche/Plugin.cs b/MuzikaGromche/Plugin.cs index 65fb5cf..55bc57a 100644 --- a/MuzikaGromche/Plugin.cs +++ b/MuzikaGromche/Plugin.cs @@ -2089,8 +2089,6 @@ namespace MuzikaGromche public override void OnDestroy() { Config.Volume.SettingChanged -= UpdateVolume; - - DeathScreenGameOverTextManager.Clear(); Stop(); } @@ -2388,7 +2386,7 @@ namespace MuzikaGromche // Playing as a client with a host who doesn't have the mod return; } - StartCoroutine(DeathScreenGameOverTextManager.SetTextAndClear(CurrentTrack.GameOverText)); + DeathScreenGameOverTextManager.SetTextAndClear(CurrentTrack.GameOverText); } }