diff options
Diffstat (limited to 'TheLooker.asl')
-rw-r--r-- | TheLooker.asl | 36 |
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 | ||
13 | startup { | 13 | startup { |
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 | ||
169 | update | 184 | update |
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 | ||
192 | isLoading { | ||
193 | return (vars.Helper.Scenes.Active.Index != 1) || !vars.Helper["loadingFinished"].Current; | ||
194 | } | ||
195 | |||
174 | start { | 196 | start { |
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 | ||
178 | split { | 205 | split { |
@@ -185,8 +212,15 @@ split { | |||
185 | } | 212 | } |
186 | } | 213 | } |
187 | 214 | ||
215 | exit | ||
216 | { | ||
217 | vars.Helper.Dispose(); | ||
218 | } | ||
219 | |||
188 | shutdown | 220 | shutdown |
189 | { | 221 | { |
222 | vars.Helper.Dispose(); | ||
223 | |||
190 | if (game == null) | 224 | if (game == null) |
191 | return; | 225 | return; |
192 | 226 | ||