1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2026-03-02 03:39:21 +00:00

Get rid of some todos / fixmes

This commit is contained in:
tobspr
2020-10-08 19:47:27 +02:00
parent 1025bede1f
commit 8260edb373
13 changed files with 496 additions and 539 deletions

View File

@@ -21,10 +21,6 @@ export class PreloadState extends GameState {
<div class="loadingImage"></div>
<div class="loadingStatus">
<span class="desc">Booting</span>
<span class="bar">
<span class="inner" style="width: 0%"></span>
<span class="status">0%</span>
</span>
</div>
</div>
<span class="prefab_GameHint"></span>
@@ -56,10 +52,6 @@ export class PreloadState extends GameState {
/** @type {HTMLElement} */
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
/** @type {HTMLElement} */
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
/** @type {HTMLElement} */
this.statusBarText = this.htmlElement.querySelector(".loadingStatus > .bar > .status");
/** @type {HTMLElement} */
this.hintsText = this.htmlElement.querySelector(".prefab_GameHint");
@@ -67,7 +59,6 @@ export class PreloadState extends GameState {
this.nextHintDuration = 0;
this.currentStatus = "booting";
this.currentIndex = 0;
this.startLoading();
}
@@ -259,16 +250,8 @@ export class PreloadState extends GameState {
*/
setStatus(text) {
logger.log("✅ " + text);
this.currentIndex += 1;
this.currentStatus = text;
this.statusText.innerText = text;
const numSteps = 10; // FIXME
const percentage = (this.currentIndex / numSteps) * 100.0;
this.statusBar.style.width = percentage + "%";
this.statusBarText.innerText = findNiceValue(percentage) + "%";
return Promise.resolve();
}