Fix Game Over Text resetting at the end of round
When the last player dies and should have their custom Game Over text overridden, the mod previously would Clear() the override and destroy the coroutine together with custom behaviour object.
This commit is contained in:
parent
b99e4c1e2c
commit
df0cfc16ff
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue