Skip to content

Commit

Permalink
only save inputs when using gameinput_api
Browse files Browse the repository at this point in the history
  • Loading branch information
agmass committed Jan 5, 2025
1 parent 0c2d60c commit aee4fc9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions flixel/system/replay/FlxReplay.hx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class FlxReplay
continueFrame = false;
#end

#if FLX_GAMEINPUT_API
var gamepadRecords:Array<GamepadRecord> = new Array();
for (gamepad in FlxG.gamepads.getActiveGamepads())
{
Expand All @@ -176,6 +177,7 @@ class FlxReplay
continueFrame = false;
}
}
#end

if (continueFrame)
{
Expand All @@ -190,7 +192,9 @@ class FlxReplay
#if FLX_KEYBOARD
frameRecorded.keys = keysRecord;
#end
#if FLX_GAMEINPUT_API
frameRecorded.gamepad = gamepadRecords;
#end

_frames[frameCount++] = frameRecorded;

Expand Down Expand Up @@ -235,6 +239,7 @@ class FlxReplay
FlxG.mouse.playback(fr.mouse);
}
#end
#if FLX_GAMEINPUT_API
if (fr.gamepad != null)
{
for (record in fr.gamepad)
Expand All @@ -255,6 +260,7 @@ class FlxReplay
gamepad.playback(record);
}
}
#end
}

/**
Expand Down

0 comments on commit aee4fc9

Please sign in to comment.