@@ -16,6 +16,9 @@ declare const emulators: Emulators;
16
16
export type EmulatorFunction = "dosboxWorker" | "dosboxDirect" | "dosboxNode" | "janus" | "backend" ;
17
17
18
18
export interface DosOptions {
19
+ sensitivityValue ?: number ;
20
+ mirroredControls ?: boolean ;
21
+ scaleControls ?: number ;
19
22
aspect ?: number ;
20
23
noWebGL ?: boolean ;
21
24
emulatorFunction ?: EmulatorFunction ;
@@ -66,12 +69,18 @@ export class DosInstance {
66
69
this . mobileControls = pointers . bind . mobile ;
67
70
this . autolock = false ;
68
71
69
- this . mirroredControls = this . storage . getItem ( "mirroredControls" ) === "true" ;
72
+ this . mirroredControls =
73
+ this . options . mirroredControls === true ||
74
+ this . storage . getItem ( "mirroredControls" ) === "true" ;
70
75
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" ) ;
72
79
this . scaleControls = Number . isNaN ( scaleControlsValue ) ? 1.0 : scaleControlsValue ;
73
80
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" ) ;
75
84
this . sensitivity = Number . isNaN ( sensitivityValue ) ? 1.0 : sensitivityValue ;
76
85
77
86
const volumeValue = Number . parseFloat ( this . storage . getItem ( "volume" ) ?? "1.0" ) ;
0 commit comments