From b5a05d1ee507a8861000afa169b054dce16bd834 Mon Sep 17 00:00:00 2001 From: Ethan O'Brien Date: Mon, 9 Jun 2025 10:24:37 -0500 Subject: [PATCH] Check default options when getting core settings --- data/src/emulator.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/data/src/emulator.js b/data/src/emulator.js index fed8208..7738400 100644 --- a/data/src/emulator.js +++ b/data/src/emulator.js @@ -4136,7 +4136,17 @@ class EmulatorJS { return null; } getCoreSettings() { - if (!window.localStorage || this.config.disableLocalStorage) return; + if (!window.localStorage || this.config.disableLocalStorage) { + if (this.config.defaultOptions) { + let rv = ""; + for (const k in this.config.defaultOptions) { + let value = isNaN(this.config.defaultOptions[k]) ? `"${this.config.defaultOptions[k]}"` : this.config.defaultOptions[k]; + rv += `${k} = ${value}\n`; + } + return rv; + } + return ""; + }; let coreSpecific = localStorage.getItem(this.getLocalStorageKey()); if (coreSpecific) { try { @@ -4147,6 +4157,11 @@ class EmulatorJS { let value = isNaN(coreSpecific.settings[k]) ? `"${coreSpecific.settings[k]}"` : coreSpecific.settings[k]; rv += `${k} = ${value}\n`; } + for (const k in this.config.defaultOptions) { + if (rv.includes(k)) continue; + let value = isNaN(this.config.defaultOptions[k]) ? `"${this.config.defaultOptions[k]}"` : this.config.defaultOptions[k]; + rv += `${k} = ${value}\n`; + } return rv; } catch(e) { console.warn("Could not load previous settings", e);