mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2024-09-20 02:46:23 +00:00
gameManager.getState returns a Uint8Array, not a Promise
This commit is contained in:
parent
bc102c8716
commit
390605d2ab
2 changed files with 4 additions and 6 deletions
|
@ -134,10 +134,8 @@ class EJS_GameManager {
|
|||
this.functions.restart();
|
||||
}
|
||||
getState() {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
this.functions.saveStateInfo();
|
||||
resolve(this.FS.readFile("/current.state"));
|
||||
})
|
||||
return this.FS.readFile("/current.state");
|
||||
}
|
||||
loadState(state) {
|
||||
try {
|
||||
|
|
|
@ -1715,7 +1715,7 @@ class EmulatorJS {
|
|||
|
||||
let stateUrl;
|
||||
const saveState = addButton("Save State", '<svg viewBox="0 0 448 512"><path fill="currentColor" d="M433.941 129.941l-83.882-83.882A48 48 0 0 0 316.118 32H48C21.49 32 0 53.49 0 80v352c0 26.51 21.49 48 48 48h352c26.51 0 48-21.49 48-48V163.882a48 48 0 0 0-14.059-33.941zM224 416c-35.346 0-64-28.654-64-64 0-35.346 28.654-64 64-64s64 28.654 64 64c0 35.346-28.654 64-64 64zm96-304.52V212c0 6.627-5.373 12-12 12H76c-6.627 0-12-5.373-12-12V108c0-6.627 5.373-12 12-12h228.52c3.183 0 6.235 1.264 8.485 3.515l3.48 3.48A11.996 11.996 0 0 1 320 111.48z"/></svg>', async () => {
|
||||
const state = await this.gameManager.getState();
|
||||
const state = this.gameManager.getState();
|
||||
const called = this.callEvent("save", {
|
||||
screenshot: await this.gameManager.screenshot(),
|
||||
state: state
|
||||
|
@ -4598,7 +4598,7 @@ class EmulatorJS {
|
|||
syncing = true;
|
||||
if (this.debug) console.log("sync")
|
||||
this.netplay.ready = 0;
|
||||
const state = await this.gameManager.getState();
|
||||
const state = this.gameManager.getState();
|
||||
this.netplay.sendMessage({
|
||||
state: state
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue