From f5f790f55a5021404e6f9f30526bc0eaa8ecdecf Mon Sep 17 00:00:00 2001 From: Daan Breur Date: Sun, 21 Nov 2021 21:28:32 +0100 Subject: [PATCH] Get settings to the core. - added `allowNonPrimaryColors` to `type:GameCreationPayload` - added `allowNonPrimaryColors` to `class:InGameState` --- src/js/states/ingame.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/js/states/ingame.js b/src/js/states/ingame.js index 7dd90343..d0ad8e99 100644 --- a/src/js/states/ingame.js +++ b/src/js/states/ingame.js @@ -51,6 +51,9 @@ export class GameCreationPayload { /** @type {number} */ this.seed; + + /** @type {boolean} */ + this.allowNonPrimaryColors; } } @@ -79,6 +82,9 @@ export class InGameState extends GameState { /** @type {number} */ this.seed = null; + /** @type {boolean} */ + this.allowNonPrimaryColors = null; + this.boundInputFilter = this.filterInput.bind(this); /** @@ -256,7 +262,7 @@ export class InGameState extends GameState { */ stage4aInitEmptyGame() { if (this.switchStage(stages.s4_A_initEmptyGame)) { - this.core.initNewGame({ seed: this.seed }); + this.core.initNewGame({ seed: this.seed, allowNonPrimaryColors: this.allowNonPrimaryColors }); this.stage5FirstUpdate(); } } @@ -376,6 +382,7 @@ export class InGameState extends GameState { this.savegame = payload.savegame; this.gameModeId = payload.gameModeId; this.seed = payload.seed; + this.allowNonPrimaryColors = payload.allowNonPrimaryColors; this.loadingOverlay = new GameLoadingOverlay(this.app, this.getDivElement()); this.loadingOverlay.showBasic();