about summary refs log tree commit diff stats
path: root/TheLooker.asl
diff options
context:
space:
mode:
authorStar Rauchenberger <fefferburbia@gmail.com>2022-08-21 10:51:43 -0400
committerStar Rauchenberger <fefferburbia@gmail.com>2022-08-21 10:51:43 -0400
commitff10baff76f7712f4407f816c7bc23e077ce6583 (patch)
tree3be9cdb703e893d3fa4bc2f600cdf00483afd074 /TheLooker.asl
parent213606f0437feaa44e3f316c5f091b1f8ae26a3c (diff)
downloadautosplitters-ff10baff76f7712f4407f816c7bc23e077ce6583.tar.gz
autosplitters-ff10baff76f7712f4407f816c7bc23e077ce6583.tar.bz2
autosplitters-ff10baff76f7712f4407f816c7bc23e077ce6583.zip
[The Looker] Load removal
It also now doesn't start the timer during the loading screen.
Diffstat (limited to 'TheLooker.asl')
-rw-r--r--TheLooker.asl36
1 files changed, 35 insertions, 1 deletions
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") {
11} 11}
12 12
13startup { 13startup {
14 var bytes = File.ReadAllBytes(@"Components\LiveSplit.ASLHelper.bin");
15 var type = Assembly.Load(bytes).GetType("ASLHelper.Unity");
16 vars.Helper = Activator.CreateInstance(type, timer, this);
17 vars.Helper.LoadSceneManager = true;
18
14 // For logging! 19 // For logging!
15 vars.Log = (Action<object>)((output) => print("[The Looker ASL] " + output)); 20 vars.Log = (Action<object>)((output) => print("[The Looker ASL] " + output));
16 21
@@ -164,15 +169,37 @@ init {
164 { 169 {
165 (vars.lastAchievement = new MemoryWatcher<IntPtr>((IntPtr)vars.unlockAchievement.outputPtr)) 170 (vars.lastAchievement = new MemoryWatcher<IntPtr>((IntPtr)vars.unlockAchievement.outputPtr))
166 }; 171 };
172
173 vars.Helper.TryOnLoad = (Func<dynamic, bool>)(mono =>
174 {
175 var saveLoad = mono.GetClass("SaveLoad");
176 vars.Helper["loadingFinished"] = saveLoad.Make<bool>("loadingFinished");
177
178 return true;
179 });
180
181 vars.Helper.Load();
167} 182}
168 183
169update 184update
170{ 185{
186 if (!vars.Helper.Update())
187 return false;
188
171 vars.Watchers.UpdateAll(game); 189 vars.Watchers.UpdateAll(game);
172} 190}
173 191
192isLoading {
193 return (vars.Helper.Scenes.Active.Index != 1) || !vars.Helper["loadingFinished"].Current;
194}
195
174start { 196start {
175 return current.witnessModeActive || (current.playerX != old.playerX) || (current.playerY != old.playerY) || (current.playerZ != old.playerZ); 197 return (vars.Helper.Scenes.Active.Index == 1)
198 && vars.Helper["loadingFinished"].Current
199 && (current.witnessModeActive
200 || (current.playerX != old.playerX)
201 || (current.playerY != old.playerY)
202 || (current.playerZ != old.playerZ));
176} 203}
177 204
178split { 205split {
@@ -185,8 +212,15 @@ split {
185 } 212 }
186} 213}
187 214
215exit
216{
217 vars.Helper.Dispose();
218}
219
188shutdown 220shutdown
189{ 221{
222 vars.Helper.Dispose();
223
190 if (game == null) 224 if (game == null)
191 return; 225 return;
192 226