übertrag zu laptop

This commit is contained in:
silas
2018-09-27 13:57:36 +02:00
parent d2a5489c32
commit 9678354c92
3 changed files with 66 additions and 39 deletions

View File

@@ -5971,18 +5971,18 @@ class LevelSite extends WordRotatorBaseSite {
let soundManager = SoundManager.getInstance();
let audioOptions = soundManager.get(SoundManager.CHANNELS.SOUND);
this.coinPromise = Promise.all([new Promise((r) => {
setTimeout(() => {
r(continueButton.fadeIn());
}, 500);
}), audioOptions.loadedPromise.catch(e => {
console.error(e);
}),
this.coinPromise.then(() => {
coinsBefore = parseInt(Helper.nonNull(localStorage.getItem("coins"), "0"));
localStorage.setItem("coins", coinsBefore + parseInt(coinsPerLevel));
})
]);
this.coinPromise = this.coinPromise.then(() => {
coinsBefore = parseInt(Helper.nonNull(localStorage.getItem("coins"), "0"));
localStorage.setItem("coins", coinsBefore + parseInt(coinsPerLevel));
}).then(() => {
return Promise.all([new Promise((r) => {
setTimeout(() => {
r(continueButton.fadeIn());
}, 500);
}), audioOptions.loadedPromise.catch(e => {
console.error(e);
})]);
});
this.wonParams.aborted = false;
@@ -6003,13 +6003,18 @@ class LevelSite extends WordRotatorBaseSite {
this.coinAction.redraw();
}
}, timeout / 2);
setTimeout(r, timeout);
}
else {
r();
}
//Always do the next promise for garbage collection
setTimeout(r, timeout);
})
});
}
this.coinPromise = this.coinPromise.catch((e) => {console.error(e);});
this.wonTextScaler();
this.continueButtonScaler();
this.levelScaler();