Terry Hearst
dc24ec0593
Remove enabled property in favor of checking for 'never'. Autosave on console command use. Remove save/load commands
24 lines
674 B
C#
24 lines
674 B
C#
using HarmonyLib;
|
|
using MIU;
|
|
|
|
namespace DiamondTimeViewer.Patches
|
|
{
|
|
[HarmonyPatch(typeof(GamePlayManager), nameof(GamePlayManager.FinishPlay))]
|
|
internal class GamePlayManagerFinishPlayPatch
|
|
{
|
|
static void Postfix(GamePlayManager __instance, MarbleController marble)
|
|
{
|
|
if (Config.Mode == DisplayMode.Never)
|
|
return;
|
|
|
|
if ((__instance.PlayType == PlayType.Normal || __instance.PlayType == PlayType.Ghost) && !MarbleManager.usedRewind && LevelSelect.instance != null)
|
|
{
|
|
if (marble.ElapsedTime < LevelSelect.instance.bestScore)
|
|
{
|
|
LevelSelect.instance.bestScore = marble.ElapsedTime;
|
|
LevelSelect.instance.UpdateMedals();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|