mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-26 12:41:40 +00:00
rewind controller support
This commit is contained in:
parent
8bf03486c8
commit
b73fe67c04
2 changed files with 12 additions and 4 deletions
|
|
@ -915,15 +915,18 @@ class MarbleWorld extends Scheduler {
|
||||||
|
|
||||||
var realDt = dt;
|
var realDt = dt;
|
||||||
|
|
||||||
if (Key.isDown(Settings.controlsSettings.rewind) && Settings.optionsSettings.rewindEnabled && !this.isWatching) {
|
if ((Key.isDown(Settings.controlsSettings.rewind) || Gamepad.isDown(Settings.gamepadSettings.rewind))
|
||||||
|
&& Settings.optionsSettings.rewindEnabled
|
||||||
|
&& !this.isWatching) {
|
||||||
this.rewinding = true;
|
this.rewinding = true;
|
||||||
} else {
|
} else {
|
||||||
this.rewinding = false;
|
if ((Key.isReleased(Settings.controlsSettings.rewind) || Gamepad.isReleased(Settings.gamepadSettings.rewind))
|
||||||
if (Key.isReleased(Settings.controlsSettings.rewind)) {
|
&& this.rewinding) {
|
||||||
if (this.isRecording) {
|
if (this.isRecording) {
|
||||||
this.replay.spliceReplay(timeState.currentAttemptTime);
|
this.replay.spliceReplay(timeState.currentAttemptTime);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.rewinding = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this.isWatching) {
|
if (!this.isWatching) {
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ typedef GamepadSettings = {
|
||||||
var invertXAxis:Bool;
|
var invertXAxis:Bool;
|
||||||
var invertYAxis:Bool;
|
var invertYAxis:Bool;
|
||||||
var axisDeadzone:Float;
|
var axisDeadzone:Float;
|
||||||
|
var rewind:Array<String>;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Settings {
|
class Settings {
|
||||||
|
|
@ -135,7 +136,8 @@ class Settings {
|
||||||
cameraSensitivity: 1.0,
|
cameraSensitivity: 1.0,
|
||||||
invertXAxis: false,
|
invertXAxis: false,
|
||||||
invertYAxis: false,
|
invertYAxis: false,
|
||||||
axisDeadzone: 0.15
|
axisDeadzone: 0.15,
|
||||||
|
rewind: ["Y"],
|
||||||
}
|
}
|
||||||
|
|
||||||
public static var progression = [24, 24, 52];
|
public static var progression = [24, 24, 52];
|
||||||
|
|
@ -263,6 +265,9 @@ class Settings {
|
||||||
if (json.gamepad != null) {
|
if (json.gamepad != null) {
|
||||||
gamepadSettings = json.gamepad;
|
gamepadSettings = json.gamepad;
|
||||||
}
|
}
|
||||||
|
if (gamepadSettings.rewind == null) {
|
||||||
|
gamepadSettings.rewind = ["Y"];
|
||||||
|
}
|
||||||
if (controlsSettings.rewind == null) {
|
if (controlsSettings.rewind == null) {
|
||||||
controlsSettings.rewind = Key.R;
|
controlsSettings.rewind = Key.R;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue