|
5 | 5 | using MonoMod.Cil;
|
6 | 6 | using System.Reflection;
|
7 | 7 | using System.Runtime.CompilerServices;
|
| 8 | +using TAS; |
8 | 9 | // VivHelper namespace has a VivHelper class.... so if we want to visit VivHelper.Entities, we should use VivEntities
|
9 | 10 |
|
10 | 11 | namespace Celeste.Mod.TASHelper.Gameplay.Spinner;
|
@@ -43,14 +44,21 @@ private static void PrepareTags() {
|
43 | 44 | if (ModUtils.GetType("FrostHelper", "FrostHelper.Entities.WallBouncePresentation.WallbouncePlayback") is { } wallbouncePlayBack && wallbouncePlayBack.GetFieldInfo("tag") is { } fieldInfo && wallbouncePlayBack.GetConstructorInfo(new Type[] { typeof(string), typeof(Vector2) }) is { } ctorInfo) {
|
44 | 45 | ctorInfo.HookAfter<object>(x => fieldInfo.SetValue(x, (int)fieldInfo.GetValue(x) & ~IsHazardTagValue));
|
45 | 46 | }
|
46 |
| - } |
| 47 | + } |
| 48 | + |
| 49 | + public static bool WillFastForward => FastForwarding && Manager.NextState == Manager.State.Running; |
| 50 | + |
| 51 | + public static int GroupCounter = 0; |
47 | 52 |
|
48 | 53 | // JIT optimization may cause PredictLoadTimeActive[2] != 524288f when TimeActive = 524288f
|
49 | 54 | [MethodImpl(MethodImplOptions.NoOptimization)]
|
50 | 55 | internal static void PreSpinnerCalculate(Scene self) {
|
51 |
| - if (!TasHelperSettings.Enabled || FastForwarding || self is not Level) { |
| 56 | + if (!TasHelperSettings.Enabled || WillFastForward || self is not Level) { |
52 | 57 | return;
|
53 |
| - } |
| 58 | + } |
| 59 | + |
| 60 | + // only sync this when we plan to render |
| 61 | + GroupCounter = TAS.EverestInterop.Hitboxes.CycleHitboxColor.GroupCounter; |
54 | 62 | float time = TimeActive = self.TimeActive;
|
55 | 63 | for (int i = 0; i <= 9; i++) {
|
56 | 64 | PredictLoadTimeActive[i] = PredictUnloadTimeActive[i] = time;
|
@@ -437,13 +445,13 @@ public static int PredictCountdown(float offset, bool isDust, bool isLoad) {
|
437 | 445 |
|
438 | 446 | public static int CalculateSpinnerGroup(float offset) {
|
439 | 447 | if (OnInterval(PredictLoadTimeActive[0], 0.05f, offset)) {
|
440 |
| - return TAS.EverestInterop.Hitboxes.CycleHitboxColor.GroupCounter; |
| 448 | + return GroupCounter; |
441 | 449 | }
|
442 | 450 | if (OnInterval(PredictLoadTimeActive[1], 0.05f, offset)) {
|
443 |
| - return (1 + TAS.EverestInterop.Hitboxes.CycleHitboxColor.GroupCounter) % 3; |
| 451 | + return (1 + GroupCounter) % 3; |
444 | 452 | }
|
445 | 453 | if (OnInterval(PredictLoadTimeActive[2], 0.05f, offset)) {
|
446 |
| - return (2 + TAS.EverestInterop.Hitboxes.CycleHitboxColor.GroupCounter) % 3; |
| 454 | + return (2 + GroupCounter) % 3; |
447 | 455 | }
|
448 | 456 | return 3;
|
449 | 457 | }
|
|
0 commit comments