V 1.0.1
This commit is contained in:
parent
89d1489ff1
commit
c57a8806d8
|
@ -308,7 +308,7 @@ function gulptasksHTML($, gulp, buildFolder, browserSync) {
|
||||||
|
|
||||||
gulp.task("html.standalone-beta", () => {
|
gulp.task("html.standalone-beta", () => {
|
||||||
return buildHtml("https://api-staging.shapez.io", {
|
return buildHtml("https://api-staging.shapez.io", {
|
||||||
analytics: true,
|
analytics: false,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
enableCachebust: false,
|
enableCachebust: false,
|
||||||
});
|
});
|
||||||
|
@ -316,7 +316,7 @@ function gulptasksHTML($, gulp, buildFolder, browserSync) {
|
||||||
|
|
||||||
gulp.task("html.standalone-prod", () => {
|
gulp.task("html.standalone-prod", () => {
|
||||||
return buildHtml("https://api.shapez.io", {
|
return buildHtml("https://api.shapez.io", {
|
||||||
analytics: true,
|
analytics: false,
|
||||||
standalone: true,
|
standalone: true,
|
||||||
enableCachebust: false,
|
enableCachebust: false,
|
||||||
});
|
});
|
||||||
|
|
|
@ -19,7 +19,7 @@ if (window.coreThreadLoadedCb) {
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
`%cshapez.io ️%c\n© 2019 Tobias Springer IT Solutions\nCommit %c${G_BUILD_COMMIT_HASH}%c on %c${new Date(
|
`%cshapez.io ️%c\n© 2020 Tobias Springer IT Solutions\nCommit %c${G_BUILD_COMMIT_HASH}%c on %c${new Date(
|
||||||
G_BUILD_TIME
|
G_BUILD_TIME
|
||||||
).toLocaleString()}\n`,
|
).toLocaleString()}\n`,
|
||||||
"font-size: 35px; font-family: Arial;font-weight: bold; padding: 10px 0;",
|
"font-size: 35px; font-family: Arial;font-weight: bold; padding: 10px 0;",
|
||||||
|
|
|
@ -3,6 +3,8 @@ import { createLogger } from "../core/logging";
|
||||||
import { findNiceValue, waitNextFrame } from "../core/utils";
|
import { findNiceValue, waitNextFrame } from "../core/utils";
|
||||||
import { cachebust } from "../core/cachebust";
|
import { cachebust } from "../core/cachebust";
|
||||||
import { PlatformWrapperImplBrowser } from "../platform/browser/wrapper";
|
import { PlatformWrapperImplBrowser } from "../platform/browser/wrapper";
|
||||||
|
import { T } from "../translations";
|
||||||
|
import { HUDModalDialogs } from "../game/hud/parts/modal_dialogs";
|
||||||
|
|
||||||
const logger = createLogger("state/preload");
|
const logger = createLogger("state/preload");
|
||||||
|
|
||||||
|
@ -44,9 +46,9 @@ export class PreloadState extends GameState {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.dialogs = new HUDModalDialogs(null, this.app);
|
this.dialogs = new HUDModalDialogs(null, this.app);
|
||||||
// const dialogsElement = document.body.querySelector(".modalDialogParent");
|
const dialogsElement = document.body.querySelector(".modalDialogParent");
|
||||||
// this.dialogs.initializeToElement(dialogsElement);
|
this.dialogs.initializeToElement(dialogsElement);
|
||||||
|
|
||||||
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
|
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
|
||||||
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
|
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
|
||||||
|
@ -64,6 +66,42 @@ export class PreloadState extends GameState {
|
||||||
startLoading() {
|
startLoading() {
|
||||||
this.setStatus("Booting")
|
this.setStatus("Booting")
|
||||||
|
|
||||||
|
.then(() => this.setStatus("Checking for updates"))
|
||||||
|
.then(() => {
|
||||||
|
if (G_IS_STANDALONE || true) {
|
||||||
|
return Promise.race([
|
||||||
|
new Promise(resolve => setTimeout(resolve, 10000)),
|
||||||
|
fetch(
|
||||||
|
"https://itch.io/api/1/x/wharf/latest?target=tobspr/shapezio&channel_name=windows",
|
||||||
|
{
|
||||||
|
cache: "no-cache",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(res => res.json())
|
||||||
|
.then(({ latest }) => {
|
||||||
|
if (latest !== G_BUILD_VERSION) {
|
||||||
|
const { ok, viewUpdate } = this.dialogs.showInfo(
|
||||||
|
T.dialogs.newUpdate.title,
|
||||||
|
T.dialogs.newUpdate.desc,
|
||||||
|
["ok:good", "viewUpdate:good"]
|
||||||
|
);
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
ok.add(resolve);
|
||||||
|
viewUpdate.add(() => {
|
||||||
|
window.open("https://tobspr.itch.io/shapezio", "_blank");
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
logger.log("Failed to fetch version:", err);
|
||||||
|
}),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
.then(() => this.setStatus("Creating platform wrapper"))
|
.then(() => this.setStatus("Creating platform wrapper"))
|
||||||
.then(() => this.app.platformWrapper.initialize())
|
.then(() => this.app.platformWrapper.initialize())
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,7 @@ dialogs:
|
||||||
reset: Reset
|
reset: Reset
|
||||||
getStandalone: Get Standalone
|
getStandalone: Get Standalone
|
||||||
deleteGame: Delete Progress
|
deleteGame: Delete Progress
|
||||||
|
viewUpdate: View Update
|
||||||
|
|
||||||
importSavegameError:
|
importSavegameError:
|
||||||
title: Import Error
|
title: Import Error
|
||||||
|
@ -139,6 +140,10 @@ dialogs:
|
||||||
title: Saving not possible
|
title: Saving not possible
|
||||||
desc: You can not save in the demo. Your game will be lost. Are you sure?
|
desc: You can not save in the demo. Your game will be lost. Are you sure?
|
||||||
|
|
||||||
|
newUpdate:
|
||||||
|
title: Update available
|
||||||
|
desc: There is an update for this game available!
|
||||||
|
|
||||||
ingame:
|
ingame:
|
||||||
# This is shown in the top left corner and displays useful keybindings in
|
# This is shown in the top left corner and displays useful keybindings in
|
||||||
# every situation
|
# every situation
|
||||||
|
|
Loading…
Reference in New Issue