mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2025-10-30 08:11:25 +00:00
rewind controller support
This commit is contained in:
parent
581e5de970
commit
1e6141cdff
2 changed files with 12 additions and 3 deletions
|
|
@ -992,12 +992,16 @@ class MarbleWorld extends Scheduler {
|
|||
|
||||
var realDt = dt;
|
||||
|
||||
if ((Key.isDown(Settings.controlsSettings.rewind) || MarbleGame.instance.touchInput.rewindButton.pressed)
|
||||
if ((Key.isDown(Settings.controlsSettings.rewind)
|
||||
|| MarbleGame.instance.touchInput.rewindButton.pressed
|
||||
|| Gamepad.isDown(Settings.gamepadSettings.rewind))
|
||||
&& Settings.optionsSettings.rewindEnabled
|
||||
&& !this.isWatching) {
|
||||
this.rewinding = true;
|
||||
} else {
|
||||
if ((Key.isReleased(Settings.controlsSettings.rewind) || !MarbleGame.instance.touchInput.rewindButton.pressed)
|
||||
if ((Key.isReleased(Settings.controlsSettings.rewind)
|
||||
|| !MarbleGame.instance.touchInput.rewindButton.pressed
|
||||
|| Gamepad.isReleased(Settings.gamepadSettings.rewind))
|
||||
&& this.rewinding) {
|
||||
if (this.isRecording) {
|
||||
this.replay.spliceReplay(timeState.currentAttemptTime);
|
||||
|
|
|
|||
|
|
@ -93,6 +93,7 @@ typedef GamepadSettings = {
|
|||
var axisDeadzone:Float;
|
||||
var respawn:Array<String>;
|
||||
var blast:Array<String>;
|
||||
var rewind:Array<String>;
|
||||
}
|
||||
|
||||
typedef PlayStatistics = {
|
||||
|
|
@ -178,7 +179,8 @@ class Settings {
|
|||
invertYAxis: false,
|
||||
axisDeadzone: 0.15,
|
||||
respawn: ["back"],
|
||||
blast: ["X", "LB", "RB"]
|
||||
blast: ["X", "LB", "RB"],
|
||||
rewind: ["Y"],
|
||||
}
|
||||
|
||||
public static var playStatistics:PlayStatistics = {
|
||||
|
|
@ -389,6 +391,9 @@ class Settings {
|
|||
if (json.gamepad != null) {
|
||||
gamepadSettings = json.gamepad;
|
||||
}
|
||||
if (gamepadSettings.rewind == null) {
|
||||
gamepadSettings.rewind = ["Y"];
|
||||
}
|
||||
if (json.stats != null) {
|
||||
playStatistics = json.stats;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue