diff --git a/ConsistencyTracker.csproj b/ConsistencyTracker.csproj index 961488f..cf841ec 100644 --- a/ConsistencyTracker.csproj +++ b/ConsistencyTracker.csproj @@ -16,7 +16,7 @@ true $(CelestePrefix)\legacyRef - XNA + XNA FNA $(WINDIR)\Microsoft.NET\assembly\GAC_32\{0}\v4.0_4.0.0.0__842cf8be1de50553\{0}.dll diff --git a/PhysicsLog/PhysicsLogger.cs b/PhysicsLog/PhysicsLogger.cs index 9fe22cd..a2f4128 100644 --- a/PhysicsLog/PhysicsLogger.cs +++ b/PhysicsLog/PhysicsLogger.cs @@ -703,20 +703,34 @@ public List GetPlayerFlags(Player player, Level level, bool firstFrameIn return flags; } - - private bool PhysicsLogHeldJumpLastFrame; + private bool PhysicsLogHoldingJump; private bool PhysicsLogHoldingSecondJump; + private void UpdateJumpState() { - //Log($"Pre frame: Jump.Check -> {Input.Jump.Check}, Jump.Pressed -> {Input.Jump.Pressed}, Held Jump Last Frame -> {PhysicsLogHeldJumpLastFrame}, Holding Second Jump -> {PhysicsLogHoldingSecondJump}"); - if (Input.Jump.Check) { - if (PhysicsLogHeldJumpLastFrame && Input.Jump.Pressed) { - PhysicsLogHoldingSecondJump = !PhysicsLogHoldingSecondJump; + VirtualButton jump = Input.Jump; + Binding binding = jump.Binding; + int jumpKeysHeld = 0; + + for (int i = 0; i < binding.Keyboard.Count; i++) { + if (MInput.Keyboard.Check(binding.Keyboard[i])) { + jumpKeysHeld++; + } + } + + for (int i = 0; i < binding.Controller.Count; i++) { + if (MInput.GamePads[jump.GamepadIndex].Check(binding.Controller[i], jump.Threshold)) { + jumpKeysHeld++; } - PhysicsLogHeldJumpLastFrame = true; - } else { - PhysicsLogHeldJumpLastFrame = false; - PhysicsLogHoldingSecondJump = false; } + + for (int i = 0; i < binding.Mouse.Count; i++) { + if (MInput.Mouse.Check(binding.Mouse[i])) { + jumpKeysHeld++; + } + } + + PhysicsLogHoldingJump = jumpKeysHeld > 0; + PhysicsLogHoldingSecondJump = jumpKeysHeld > 1; } public string GetInputsFormatted(char separator = ' ') { @@ -731,12 +745,10 @@ public string GetInputsFormatted(char separator = ' ') { inputs += $"{updown}{separator}"; } - if (Input.Jump.Check) { - if (PhysicsLogHoldingSecondJump) { - inputs += $"K{separator}"; - } else { - inputs += $"J{separator}"; - } + if (PhysicsLogHoldingSecondJump) { + inputs += $"K{separator}"; + } else if (PhysicsLogHoldingJump) { + inputs += $"J{separator}"; } if (Input.Dash.Check) {