mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Prepare standalone build
This commit is contained in:
@@ -33,10 +33,22 @@ export class MainMenuState extends GameState {
|
||||
return `
|
||||
|
||||
<button class="settingsButton"></button>
|
||||
|
||||
${
|
||||
G_IS_STANDALONE
|
||||
? `
|
||||
<button class="exitAppButton"></button>
|
||||
`
|
||||
: ""
|
||||
}
|
||||
|
||||
<video autoplay muted loop class="fullscreenBackgroundVideo">
|
||||
${
|
||||
G_IS_STANDALONE
|
||||
? ""
|
||||
: `<video autoplay muted loop class="fullscreenBackgroundVideo">
|
||||
<source src="${cachebust("res/bg_render.webm")}" type="video/webm">
|
||||
</video>
|
||||
</video>`
|
||||
}
|
||||
|
||||
|
||||
<div class="logo">
|
||||
@@ -184,6 +196,11 @@ export class MainMenuState extends GameState {
|
||||
}
|
||||
|
||||
this.trackClicks(qs(".settingsButton"), this.onSettingsButtonClicked);
|
||||
|
||||
if (G_IS_STANDALONE) {
|
||||
this.trackClicks(qs(".exitAppButton"), this.onExitAppButtonClicked);
|
||||
}
|
||||
|
||||
this.renderSavegames();
|
||||
|
||||
const steamLinks = this.htmlElement.querySelectorAll(".steamLink");
|
||||
@@ -199,6 +216,10 @@ export class MainMenuState extends GameState {
|
||||
return false;
|
||||
}
|
||||
|
||||
onExitAppButtonClicked() {
|
||||
this.app.platformWrapper.exitApp();
|
||||
}
|
||||
|
||||
renderSavegames() {
|
||||
const oldContainer = this.htmlElement.querySelector(".mainContainer .savegames");
|
||||
if (oldContainer) {
|
||||
|
||||
@@ -100,6 +100,13 @@ export class PreloadState extends GameState {
|
||||
return this.app.settings.initialize();
|
||||
})
|
||||
|
||||
.then(() => {
|
||||
// Initialize fullscreen
|
||||
if (this.app.platformWrapper.getSupportsFullscreen()) {
|
||||
this.app.platformWrapper.setFullscreen(this.app.settings.getIsFullScreen());
|
||||
}
|
||||
})
|
||||
|
||||
.then(() => this.setStatus("Initializing sounds"))
|
||||
.then(() => {
|
||||
// Notice: We don't await the sounds loading itself
|
||||
|
||||
Reference in New Issue
Block a user