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

Add setting to disable smart tunnels

This commit is contained in:
tobspr
2020-06-16 19:24:23 +02:00
parent 88fba76e3b
commit b753187cde
5 changed files with 24 additions and 5 deletions

View File

@@ -2,7 +2,11 @@ export const CHANGELOG = [
{
version: "1.1.15",
date: "unreleased",
entries: ["Added continue button to main menu and add seperate 'New game' button (by jaysc)"],
entries: [
"Added continue button to main menu and add seperate 'New game' button (by jaysc)",
"Added setting to disable smart tunnel placement introduced with the last update",
"Update translations ",
],
},
{
version: "1.1.14",

View File

@@ -58,6 +58,11 @@ export class UndergroundBeltSystem extends GameSystemWithFilter {
* @param {Entity} entity
*/
onEntityPlaced(entity) {
if (!this.root.app.settings.getAllSettings().enableTunnelSmartplace) {
// Smart-place disabled
return;
}
const undergroundComp = entity.components.UndergroundBelt;
if (undergroundComp && undergroundComp.mode === enumUndergroundBeltMode.receiver) {
const staticComp = entity.components.StaticMapEntity;

View File

@@ -146,6 +146,7 @@ export const allApplicationSettings = [
),
// GAME
new BoolSetting("offerHints", categoryGame, (app, value) => {}),
new EnumSetting("theme", {
options: Object.keys(THEMES),
@@ -197,7 +198,7 @@ export const allApplicationSettings = [
}),
new BoolSetting("alwaysMultiplace", categoryGame, (app, value) => {}),
new BoolSetting("offerHints", categoryGame, (app, value) => {}),
new BoolSetting("enableTunnelSmartplace", categoryGame, (app, value) => {}),
];
export function getApplicationSettingById(id) {
@@ -219,6 +220,7 @@ class SettingsStorage {
this.alwaysMultiplace = false;
this.offerHints = true;
this.enableTunnelSmartplace = true;
/**
* @type {Object.<string, number>}
@@ -408,7 +410,7 @@ export class ApplicationSettings extends ReadWriteProxy {
}
getCurrentVersion() {
return 10;
return 11;
}
/** @param {{settings: SettingsStorage, version: number}} data */
@@ -445,6 +447,11 @@ export class ApplicationSettings extends ReadWriteProxy {
data.version = 10;
}
if (data.version < 11) {
data.settings.enableTunnelSmartplace = true;
data.version = 11;
}
return ExplainedResult.good();
}
}