Fix changing ff-ratio while ff is active

This commit is contained in:
Ethan O'Brien 2023-08-08 13:19:48 -05:00
parent 81a6b94f4f
commit 4a0b1a942b
2 changed files with 5 additions and 1 deletions

View file

@ -3156,11 +3156,15 @@ class EmulatorJS {
} else if (option === "virtual-gamepad-left-handed-mode") {
this.toggleVirtualGamepadLeftHanded(value !== "disabled");
} else if (option === "ff-ratio") {
if (this.isFastForward) this.gameManager.toggleFastForward(0);
if (value === "unlimited") {
this.gameManager.setFastForwardRatio(0);
} else if (!isNaN(value)) {
this.gameManager.setFastForwardRatio(parseFloat(value));
}
setTimeout(() => {
if (this.isFastForward) this.gameManager.toggleFastForward(1);
}, 10)
} else if (option === "fastForward") {
if (value === "enabled") {
this.isFastForward = true;

File diff suppressed because one or more lines are too long