mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-19 18:36:25 +00:00
Check EmulatorJS core compatibility
This commit is contained in:
parent
cfa011fa78
commit
ba1f40bea1
1 changed files with 13 additions and 1 deletions
|
@ -639,7 +639,17 @@ class EmulatorJS {
|
||||||
return new Promise(resolve => resolve({"!!notCompressedData": data}));
|
return new Promise(resolve => resolve({"!!notCompressedData": data}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
versionAsInt(ver) {
|
||||||
|
return parseInt(ver.replaceAll(".", ""));
|
||||||
|
}
|
||||||
|
checkCoreCompatibility(version) {
|
||||||
|
// Leave commented until next release - this is ready to go.
|
||||||
|
if (this.versionAsInt(version.minimumEJSVersion) > this.versionAsInt(this.ejs_version)) {
|
||||||
|
//this.textElem.innerText = this.localization("Outdated EmulatorJS version");
|
||||||
|
//this.textElem.style.color = "red";
|
||||||
|
//throw new Error("Core requires minimum EmulatorJS version of " + version.minimumEJSVersion);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
downloadGameCore() {
|
downloadGameCore() {
|
||||||
this.textElem.innerText = this.localization("Download Game Core");
|
this.textElem.innerText = this.localization("Download Game Core");
|
||||||
|
@ -659,6 +669,8 @@ class EmulatorJS {
|
||||||
thread = data[k];
|
thread = data[k];
|
||||||
} else if (k.endsWith(".js")) {
|
} else if (k.endsWith(".js")) {
|
||||||
js = data[k];
|
js = data[k];
|
||||||
|
} else if (k === "build.json") {
|
||||||
|
this.checkCoreCompatibility(JSON.parse(new TextDecoder().decode(data[k])));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.initGameCore(js, wasm, thread);
|
this.initGameCore(js, wasm, thread);
|
||||||
|
|
Loading…
Reference in a new issue