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

Do not allow saving in the demo version

This commit is contained in:
tobspr
2020-05-19 15:03:13 +02:00
parent 8abe84b120
commit 9c4fe248db
18 changed files with 177 additions and 62 deletions

View File

@@ -7,6 +7,7 @@ import { BoolSetting, EnumSetting, BaseSetting } from "./setting_types";
import { createLogger } from "../core/logging";
import { ExplainedResult } from "../core/explained_result";
import { THEMES, THEME, applyGameTheme } from "../game/theme";
import { IS_DEMO } from "../core/config";
const logger = createLogger("application_settings");
@@ -66,7 +67,7 @@ export const allApplicationSettings = [
app.platformWrapper.setFullscreen(value);
}
},
G_IS_STANDALONE
!IS_DEMO
),
new BoolSetting(
@@ -101,6 +102,7 @@ export const allApplicationSettings = [
applyGameTheme(id);
document.body.setAttribute("data-theme", id);
},
enabled: !IS_DEMO,
}),
new EnumSetting("refreshRate", {
@@ -114,6 +116,7 @@ export const allApplicationSettings = [
* @param {Application} app
*/
(app, id) => {},
enabled: !IS_DEMO,
}),
];

View File

@@ -7,6 +7,8 @@ import { T } from "../translations";
const logger = createLogger("setting_types");
const standaloneOnlySettingHtml = `<span class="standaloneOnlyHint">${T.demo.settingNotAvailable}</span>`;
export class BaseSetting {
/**
*
@@ -113,6 +115,7 @@ export class EnumSetting extends BaseSetting {
getHtml() {
return `
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
${this.enabled ? "" : standaloneOnlySettingHtml}
<div class="row">
<label>${T.settings.labels[this.id].title}</label>
<div class="value enum" data-setting="${this.id}"></div>
@@ -186,6 +189,8 @@ export class BoolSetting extends BaseSetting {
getHtml() {
return `
<div class="setting cardbox ${this.enabled ? "enabled" : "disabled"}">
${this.enabled ? "" : standaloneOnlySettingHtml}
<div class="row">
<label>${T.settings.labels[this.id].title}</label>
<div class="value checkbox checked" data-setting="${this.id}">