From 640d1065f0379c3e8bb296528c8e08bec32b364d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BD=D0=B8=D1=97=D0=BB=20=D0=93=D1=80=D0=B8?= =?UTF-8?q?=D0=B3=D0=BE=D1=80=27=D1=94=D0=B2?= Date: Fri, 30 Apr 2021 14:20:39 +0300 Subject: [PATCH] Hide Puzzle Editor Controls in regular game mode, fix typo --- src/js/game/game_mode.js | 4 ++-- src/js/game/hud/parts/building_placer.js | 2 +- src/js/game/hud/parts/building_placer_logic.js | 2 +- src/js/game/modes/puzzle.js | 2 +- src/js/game/modes/regular.js | 4 +++- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/game/game_mode.js b/src/js/game/game_mode.js index f90981a9..bf7e0d97 100644 --- a/src/js/game/game_mode.js +++ b/src/js/game/game_mode.js @@ -47,7 +47,7 @@ export class GameMode extends BasicSerializableObject { constructor(root) { super(); this.root = root; - this.hiddenHurtParts = {}; + this.hiddenHudParts = {}; /** @type {typeof MetaBuilding[]} */ this.hiddenBuildings = [MetaItemProducerBuilding]; @@ -83,7 +83,7 @@ export class GameMode extends BasicSerializableObject { * @returns {boolean} */ isHudPartExcluded(name) { - return this.hiddenHurtParts[name] === false; + return this.hiddenHudParts[name] === false; } /** diff --git a/src/js/game/hud/parts/building_placer.js b/src/js/game/hud/parts/building_placer.js index 7d618b6b..2b876726 100644 --- a/src/js/game/hud/parts/building_placer.js +++ b/src/js/game/hud/parts/building_placer.js @@ -234,7 +234,7 @@ export class HUDBuildingPlacer extends HUDBuildingPlacerLogic { * @param {DrawParameters} parameters */ draw(parameters) { - if (this.root.camera.zoomLevel < globalConfig.mapChunkOverviewMinZoom) { + if (this.root.camera.getIsMapOverlayActive()) { // Dont allow placing in overview mode this.domAttach.update(false); this.variantsAttach.update(false); diff --git a/src/js/game/hud/parts/building_placer_logic.js b/src/js/game/hud/parts/building_placer_logic.js index 1e88abc7..7743aa52 100644 --- a/src/js/game/hud/parts/building_placer_logic.js +++ b/src/js/game/hud/parts/building_placer_logic.js @@ -430,7 +430,7 @@ export class HUDBuildingPlacerLogic extends BaseHUDPart { * @param {Vector} tile */ tryPlaceCurrentBuildingAt(tile) { - if (this.root.camera.zoomLevel < globalConfig.mapChunkOverviewMinZoom) { + if (this.root.camera.getIsMapOverlayActive()) { // Dont allow placing in overview mode return; } diff --git a/src/js/game/modes/puzzle.js b/src/js/game/modes/puzzle.js index ac7c3eef..847f9563 100644 --- a/src/js/game/modes/puzzle.js +++ b/src/js/game/modes/puzzle.js @@ -32,7 +32,7 @@ export class PuzzleGameMode extends GameMode { const data = this.getSaveData(); - this.hiddenHurtParts = { + this.hiddenHudParts = { [HUDGameMenu.name]: false, [HUDMassSelector.name]: false, [HUDInteractiveTutorial.name]: false, diff --git a/src/js/game/modes/regular.js b/src/js/game/modes/regular.js index 60f80dd7..0050691a 100644 --- a/src/js/game/modes/regular.js +++ b/src/js/game/modes/regular.js @@ -13,6 +13,7 @@ import { enumGameModeIds, enumGameModeTypes, GameMode } from "../game_mode"; import { ShapeDefinition } from "../shape_definition"; import { enumHubGoalRewards } from "../tutorial_goals"; import { HUDPuzzleDLCLogo } from "../hud/parts/puzzle_dlc_logo"; +import { HUDPuzzleEditorControls } from "../hud/parts/puzzle_editor_controls"; /** @typedef {{ * shape: string, @@ -516,12 +517,13 @@ export class RegularGameMode extends GameMode { constructor(root) { super(root); - this.hiddenHurtParts = { + this.hiddenHudParts = { [HUDModeMenuBack.name]: false, [HUDPuzzleReview.name]: false, [HUDModeMenu.name]: false, [HUDModeSettings.name]: false, [HUDPuzzleDLCLogo.name]: false, + [HUDPuzzleEditorControls.name]: false, }; this.hiddenBuildings = [MetaConstantProducerBuilding, MetaGoalAcceptorBuilding];