From 1a7a06fce29bece8a5d2841ac96df0c9a5ab4ce4 Mon Sep 17 00:00:00 2001 From: tobspr Date: Fri, 12 Jun 2020 09:15:29 +0200 Subject: [PATCH] Move debug options to seperate file so they are not always checked in --- src/js/core/config.js | 42 +++--------------- src/js/core/config.local.js | 87 +++++++++++++++++++++++++++++++++++++ 2 files changed, 94 insertions(+), 35 deletions(-) create mode 100644 src/js/core/config.local.js diff --git a/src/js/core/config.js b/src/js/core/config.js index e6eb7b00..fa3a80ab 100644 --- a/src/js/core/config.js +++ b/src/js/core/config.js @@ -79,40 +79,7 @@ export const globalConfig = { }, rendering: {}, - - debug: { - /* dev:start */ - // fastGameEnter: true, - // noArtificialDelays: true, - // disableSavegameWrite: true, - // showEntityBounds: true, - // showAcceptorEjectors: true, - // disableMusic: true, - // doNotRenderStatics: true, - // disableZoomLimits: true, - // showChunkBorders: true, - // rewardsInstant: true, - allBuildingsUnlocked: true, - blueprintsNoCost: true, - upgradesNoCost: true, - // disableUnlockDialog: true, - // disableLogicTicks: true, - // testClipping: true, - // framePausesBetweenTicks: 40, - // testTranslations: true, - // enableEntityInspector: true, - // testAds: true, - // disableMapOverview: true, - // disableTutorialHints: true, - disableUpgradeNotification: true, - // instantBelts: true, - // instantProcessors: true, - // instantMiners: true, - // resumeGameOnFastEnter: false, - - // renderForTrailer: true, - /* dev:end */ - }, + debug: require("./config.local").default, // Secret vars info: { @@ -130,14 +97,15 @@ export const globalConfig = { export const IS_MOBILE = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent); // Automatic calculations - globalConfig.minerSpeedItemsPerSecond = globalConfig.beltSpeedItemsPerSecond / 5; +// Dynamic calculations if (globalConfig.debug.disableMapOverview) { globalConfig.mapChunkOverviewMinZoom = 0; globalConfig.mapChunkPrerenderMinZoom = 0; } +// Stuff for making the trailer if (G_IS_DEV && globalConfig.debug.renderForTrailer) { globalConfig.debug.framePausesBetweenTicks = 32; // globalConfig.mapChunkOverviewMinZoom = 0.0; @@ -148,3 +116,7 @@ if (G_IS_DEV && globalConfig.debug.renderForTrailer) { globalConfig.debug.disableSavegameWrite = true; // globalConfig.beltSpeedItemsPerSecond *= 2; } + +if (globalConfig.debug.fastGameEnter) { + globalConfig.debug.noArtificalDelays = true; +} diff --git a/src/js/core/config.local.js b/src/js/core/config.local.js new file mode 100644 index 00000000..2060f495 --- /dev/null +++ b/src/js/core/config.local.js @@ -0,0 +1,87 @@ +export default { + // You can set any debug options here! + /* dev:start */ + // ----------------------------------------------------------------------------------- + // Quickly enters the game and skips the main menu - good for fast iterating + // fastGameEnter: true, + // ----------------------------------------------------------------------------------- + // Skips any delays like transitions between states and such + // noArtificialDelays: true, + // ----------------------------------------------------------------------------------- + // Disables writing of savegames, useful for testing the same savegame over and over + // disableSavegameWrite: true, + // ----------------------------------------------------------------------------------- + // Shows bounds of all entities + // showEntityBounds: true, + // ----------------------------------------------------------------------------------- + // Shows arrows for every ejector / acceptor + // showAcceptorEjectors: true, + // ----------------------------------------------------------------------------------- + // Disables the music (Overrides any setting, can cause weird behaviour) + // disableMusic: true, + // ----------------------------------------------------------------------------------- + // Do not render static map entities (=most buildings) + // doNotRenderStatics: true, + // ----------------------------------------------------------------------------------- + // Allow to zoom freely without limits + // disableZoomLimits: true, + // ----------------------------------------------------------------------------------- + // Shows a border arround every chunk + // showChunkBorders: true, + // ----------------------------------------------------------------------------------- + // All rewards can be unlocked by passing just 1 of any shape + // rewardsInstant: true, + // ----------------------------------------------------------------------------------- + // Unlocks all buildings + // allBuildingsUnlocked: true, + // ----------------------------------------------------------------------------------- + // Disables cost of bluepirnts + // blueprintsNoCost: true, + // ----------------------------------------------------------------------------------- + // Disables cost of upgrades + // upgradesNoCost: true, + // ----------------------------------------------------------------------------------- + // Disables the dialog when completing a level + // disableUnlockDialog: true, + // ----------------------------------------------------------------------------------- + // Disables the simulation - This effectively pauses the game. + // disableLogicTicks: true, + // ----------------------------------------------------------------------------------- + // Test the rendering if everything is clipped out properly + // testClipping: true, + // ----------------------------------------------------------------------------------- + // Allows to render slower, useful for recording at half speed to avoid stuttering + // framePausesBetweenTicks: 1, + // ----------------------------------------------------------------------------------- + // Replace all translations with emojis to see which texts are translateable + // testTranslations: true, + // ----------------------------------------------------------------------------------- + // Enables an inspector which shows information about the entity below the curosr + // enableEntityInspector: true, + // ----------------------------------------------------------------------------------- + // Enables ads in the local build (normally they are deactivated there) + // testAds: true, + // ----------------------------------------------------------------------------------- + // Disables the automatic switch to an overview when zooming out + // disableMapOverview: true, + // ----------------------------------------------------------------------------------- + // Disables the notification when there are new entries in the changelog since last played + // disableUpgradeNotification: true, + // ----------------------------------------------------------------------------------- + // Makes belts almost infinitely fast + // instantBelts: true, + // ----------------------------------------------------------------------------------- + // Makes item processors almost infinitely fast + // instantProcessors: true, + // ----------------------------------------------------------------------------------- + // Makes miners almost infinitely fast + // instantMiners: true, + // ----------------------------------------------------------------------------------- + // When using fastGameEnter, controls whether a new game is started or the last one is resumed + // resumeGameOnFastEnter: false, + // ----------------------------------------------------------------------------------- + // Special option used to render the trailer + // renderForTrailer: true, + // ----------------------------------------------------------------------------------- + /* dev:end */ +};