pull/33/head
tobspr 4 years ago
parent 89d1489ff1
commit c57a8806d8

@ -308,7 +308,7 @@ function gulptasksHTML($, gulp, buildFolder, browserSync) {
gulp.task("html.standalone-beta", () => {
return buildHtml("https://api-staging.shapez.io", {
analytics: true,
analytics: false,
standalone: true,
enableCachebust: false,
});
@ -316,7 +316,7 @@ function gulptasksHTML($, gulp, buildFolder, browserSync) {
gulp.task("html.standalone-prod", () => {
return buildHtml("https://api.shapez.io", {
analytics: true,
analytics: false,
standalone: true,
enableCachebust: false,
});

@ -19,7 +19,7 @@ if (window.coreThreadLoadedCb) {
}
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
).toLocaleString()}\n`,
"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 { cachebust } from "../core/cachebust";
import { PlatformWrapperImplBrowser } from "../platform/browser/wrapper";
import { T } from "../translations";
import { HUDModalDialogs } from "../game/hud/parts/modal_dialogs";
const logger = createLogger("state/preload");
@ -44,9 +46,9 @@ export class PreloadState extends GameState {
}
}
// this.dialogs = new HUDModalDialogs(null, this.app);
// const dialogsElement = document.body.querySelector(".modalDialogParent");
// this.dialogs.initializeToElement(dialogsElement);
this.dialogs = new HUDModalDialogs(null, this.app);
const dialogsElement = document.body.querySelector(".modalDialogParent");
this.dialogs.initializeToElement(dialogsElement);
this.statusText = this.htmlElement.querySelector(".loadingStatus > .desc");
this.statusBar = this.htmlElement.querySelector(".loadingStatus > .bar > .inner");
@ -64,6 +66,42 @@ export class PreloadState extends GameState {
startLoading() {
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.app.platformWrapper.initialize())

@ -85,6 +85,7 @@ dialogs:
reset: Reset
getStandalone: Get Standalone
deleteGame: Delete Progress
viewUpdate: View Update
importSavegameError:
title: Import Error
@ -139,6 +140,10 @@ dialogs:
title: Saving not possible
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:
# This is shown in the top left corner and displays useful keybindings in
# every situation

@ -1 +1 @@
1.0.0
1.0.1
Loading…
Cancel
Save