Skip to content

Commit 55c30ae

Browse files
committed
caiiiycuk/js-dos#261: more options to configure scale,sensistivity,mirrored
1 parent 8cdb8f0 commit 55c30ae

File tree

3 files changed

+16
-7
lines changed

3 files changed

+16
-7
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "emulators-ui",
3-
"version": "0.73.8",
3+
"version": "0.73.9",
44
"description": "Emulators UI",
55
"main": "dist/emulators-ui.js",
66
"types": "dist/types/emulators-ui.d.ts",

src/build.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// gulpfile.ts/wasm.ts --> generateBuildInfo
55

66
export const Build = {
7-
short: "0.73.8",
8-
version: "0.73.8 (3f45c09550da147bae83e339cc00d649)",
9-
buildSeed: 1673509074063,
7+
short: "0.73.9",
8+
version: "0.73.9 (8dd6a9be3fd1f818af5862d3c3c93443)",
9+
buildSeed: 1673509944011,
1010
};

src/js-dos.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ declare const emulators: Emulators;
1616
export type EmulatorFunction = "dosboxWorker" | "dosboxDirect" | "dosboxNode" | "janus" | "backend";
1717

1818
export interface DosOptions {
19+
sensitivityValue?: number;
20+
mirroredControls?: boolean;
21+
scaleControls?: number;
1922
aspect?: number;
2023
noWebGL?: boolean;
2124
emulatorFunction?: EmulatorFunction;
@@ -66,12 +69,18 @@ export class DosInstance {
6669
this.mobileControls = pointers.bind.mobile;
6770
this.autolock = false;
6871

69-
this.mirroredControls = this.storage.getItem("mirroredControls") === "true";
72+
this.mirroredControls =
73+
this.options.mirroredControls === true ||
74+
this.storage.getItem("mirroredControls") === "true";
7075

71-
const scaleControlsValue = Number.parseFloat(this.storage.getItem("scaleControls") ?? "1.0");
76+
const scaleControlsValue =
77+
this.options.scaleControls ??
78+
Number.parseFloat(this.storage.getItem("scaleControls") ?? "1.0");
7279
this.scaleControls = Number.isNaN(scaleControlsValue) ? 1.0 : scaleControlsValue;
7380

74-
const sensitivityValue = Number.parseFloat(this.storage.getItem("sensitivity") ?? "1.0");
81+
const sensitivityValue =
82+
this.options.sensitivityValue ??
83+
Number.parseFloat(this.storage.getItem("sensitivity") ?? "1.0");
7584
this.sensitivity = Number.isNaN(sensitivityValue) ? 1.0 : sensitivityValue;
7685

7786
const volumeValue = Number.parseFloat(this.storage.getItem("volume") ?? "1.0");

0 commit comments

Comments
 (0)