Add patch to show diamond time after beating a level (if conditions met)
This commit is contained in:
parent
dfe235ebf4
commit
15f1d23c34
1 changed files with 22 additions and 0 deletions
22
Patches/GamePlayManagerPatches.cs
Normal file
22
Patches/GamePlayManagerPatches.cs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
using HarmonyLib;
|
||||||
|
using MIU;
|
||||||
|
|
||||||
|
namespace MiuuDiamondTimeViewer.Patches
|
||||||
|
{
|
||||||
|
[HarmonyPatch(typeof(GamePlayManager))]
|
||||||
|
[HarmonyPatch("FinishPlay")]
|
||||||
|
internal class GamePlayManagerFinishPlayPatch
|
||||||
|
{
|
||||||
|
static void Postfix(GamePlayManager __instance, MarbleController marble)
|
||||||
|
{
|
||||||
|
if (!Config.Enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if ((__instance.PlayType == PlayType.Normal || __instance.PlayType == PlayType.Ghost) && !MarbleManager.usedRewind && LevelSelect.instance != null)
|
||||||
|
{
|
||||||
|
LevelSelect.instance.bestScore = marble.ElapsedTime;
|
||||||
|
LevelSelect.instance.UpdateMedals();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue