Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ConsistencyTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<CelesteIsCore Condition="Exists('$(CelestePrefix)\Celeste.dll')">true</CelesteIsCore>
<CelestePrefix Condition="$(CelesteIsCore)">$(CelestePrefix)\legacyRef</CelestePrefix>

<CelesteType Condition="'$(CelesteType)' == '' And Exists('$(CelesteGamePath)\BuildIsXNA.txt')">XNA</CelesteType>
<CelesteType Condition="'$(CelesteType)' == '' And Exists('$(CelestePrefix)\BuildIsXNA.txt')">XNA</CelesteType>
<CelesteType Condition="'$(CelesteType)' == ''">FNA</CelesteType>
<XNAPath Condition="'$(XNAPath)' == ''">$(WINDIR)\Microsoft.NET\assembly\GAC_32\{0}\v4.0_4.0.0.0__842cf8be1de50553\{0}.dll</XNAPath>
</PropertyGroup>
Expand Down
44 changes: 28 additions & 16 deletions PhysicsLog/PhysicsLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -703,20 +703,34 @@ public List<string> 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 = ' ') {
Expand All @@ -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) {
Expand Down
Loading