()
| 4127 | }; |
| 4128 | } |
| 4129 | saveSettings() { |
| 4130 | if (!window.localStorage || this.config.disableLocalStorage || !this.settingsLoaded) return; |
| 4131 | if (!this.started && !this.failedToStart) return; |
| 4132 | const coreSpecific = { |
| 4133 | controlSettings: this.controls, |
| 4134 | settings: this.settings, |
| 4135 | cheats: this.cheats |
| 4136 | } |
| 4137 | const ejs_settings = { |
| 4138 | volume: this.volume, |
| 4139 | muted: this.muted |
| 4140 | } |
| 4141 | localStorage.setItem("ejs-settings", JSON.stringify(ejs_settings)); |
| 4142 | localStorage.setItem(this.getLocalStorageKey(), JSON.stringify(coreSpecific)); |
| 4143 | } |
| 4144 | getLocalStorageKey() { |
| 4145 | let identifier = (this.config.gameId || 1) + "-" + this.getCore(true); |
| 4146 | if (typeof this.config.gameName === "string") { |
no test coverage detected