From ff10baff76f7712f4407f816c7bc23e077ce6583 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Sun, 21 Aug 2022 10:51:43 -0400 Subject: [The Looker] Load removal It also now doesn't start the timer during the loading screen. --- TheLooker.asl | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/TheLooker.asl b/TheLooker.asl index e9e02db..3ca1c86 100644 --- a/TheLooker.asl +++ b/TheLooker.asl @@ -11,6 +11,11 @@ state("The Looker") { } startup { + var bytes = File.ReadAllBytes(@"Components\LiveSplit.ASLHelper.bin"); + var type = Assembly.Load(bytes).GetType("ASLHelper.Unity"); + vars.Helper = Activator.CreateInstance(type, timer, this); + vars.Helper.LoadSceneManager = true; + // For logging! vars.Log = (Action)((output) => print("[The Looker ASL] " + output)); @@ -164,15 +169,37 @@ init { { (vars.lastAchievement = new MemoryWatcher((IntPtr)vars.unlockAchievement.outputPtr)) }; + + vars.Helper.TryOnLoad = (Func)(mono => + { + var saveLoad = mono.GetClass("SaveLoad"); + vars.Helper["loadingFinished"] = saveLoad.Make("loadingFinished"); + + return true; + }); + + vars.Helper.Load(); } update { + if (!vars.Helper.Update()) + return false; + vars.Watchers.UpdateAll(game); } +isLoading { + return (vars.Helper.Scenes.Active.Index != 1) || !vars.Helper["loadingFinished"].Current; +} + start { - return current.witnessModeActive || (current.playerX != old.playerX) || (current.playerY != old.playerY) || (current.playerZ != old.playerZ); + return (vars.Helper.Scenes.Active.Index == 1) + && vars.Helper["loadingFinished"].Current + && (current.witnessModeActive + || (current.playerX != old.playerX) + || (current.playerY != old.playerY) + || (current.playerZ != old.playerZ)); } split { @@ -185,8 +212,15 @@ split { } } +exit +{ + vars.Helper.Dispose(); +} + shutdown { + vars.Helper.Dispose(); + if (game == null) return; -- cgit 1.4.1