mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
Default controls
This commit is contained in:
parent
dcd01210a1
commit
52152720d6
2 changed files with 3 additions and 0 deletions
|
@ -156,6 +156,7 @@ class EmulatorJS {
|
||||||
this.cheats = [];
|
this.cheats = [];
|
||||||
this.started = false;
|
this.started = false;
|
||||||
this.volume = (typeof this.config.volume === "number") ? this.config.volume : 0.5;
|
this.volume = (typeof this.config.volume === "number") ? this.config.volume : 0.5;
|
||||||
|
if (this.config.defaultControllers) this.defaultControllers = this.config.defaultControllers;
|
||||||
this.muted = false;
|
this.muted = false;
|
||||||
this.paused = true;
|
this.paused = true;
|
||||||
this.listeners = [];
|
this.listeners = [];
|
||||||
|
@ -1288,6 +1289,7 @@ class EmulatorJS {
|
||||||
|
|
||||||
const controls = this.createElement("div");
|
const controls = this.createElement("div");
|
||||||
for (let i=0; i<4; i++) {
|
for (let i=0; i<4; i++) {
|
||||||
|
if (!this.controls[i]) this.controls[i] = {};
|
||||||
const player = this.createElement("div");
|
const player = this.createElement("div");
|
||||||
const playerTitle = this.createElement("div");
|
const playerTitle = this.createElement("div");
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
config.VirtualGamepadSettings = window.EJS_VirtualGamepadSettings;
|
config.VirtualGamepadSettings = window.EJS_VirtualGamepadSettings;
|
||||||
config.buttonOpts = window.EJS_Buttons;
|
config.buttonOpts = window.EJS_Buttons;
|
||||||
config.volume = window.EJS_volume;
|
config.volume = window.EJS_volume;
|
||||||
|
config.defaultControllers = window.EJS_defaultControls
|
||||||
|
|
||||||
new EmulatorJS(EJS_player, config);
|
new EmulatorJS(EJS_player, config);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue