From e96821b555a4757a3de5a6b7aec7b18d681a8642 Mon Sep 17 00:00:00 2001 From: tobspr Date: Tue, 29 Sep 2020 12:58:16 +0200 Subject: [PATCH] Fix throughput goals and add layer preview to producer --- src/js/game/buildings/item_producer.js | 4 ++++ src/js/game/hub_goals.js | 8 +++++--- src/js/game/hud/parts/pinned_shapes.js | 10 ++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/js/game/buildings/item_producer.js b/src/js/game/buildings/item_producer.js index e6fb1e71..477ed603 100644 --- a/src/js/game/buildings/item_producer.js +++ b/src/js/game/buildings/item_producer.js @@ -14,6 +14,10 @@ export class MetaItemProducerBuilding extends MetaBuilding { return "#b37dcd"; } + getShowWiresLayerPreview() { + return true; + } + /** * Creates the entity at the given location * @param {Entity} entity diff --git a/src/js/game/hub_goals.js b/src/js/game/hub_goals.js index f1ca6660..af6e67fb 100644 --- a/src/js/game/hub_goals.js +++ b/src/js/game/hub_goals.js @@ -144,9 +144,11 @@ export class HubGoals extends BasicSerializableObject { */ getCurrentGoalDelivered() { if (this.currentGoal.throughputOnly) { - return this.root.productionAnalytics.getCurrentShapeRate( - enumAnalyticsDataSource.delivered, - this.currentGoal.definition + return ( + this.root.productionAnalytics.getCurrentShapeRate( + enumAnalyticsDataSource.delivered, + this.currentGoal.definition + ) / globalConfig.analyticsSliceDurationSeconds ); } diff --git a/src/js/game/hud/parts/pinned_shapes.js b/src/js/game/hud/parts/pinned_shapes.js index 941a679f..91663c56 100644 --- a/src/js/game/hud/parts/pinned_shapes.js +++ b/src/js/game/hud/parts/pinned_shapes.js @@ -6,6 +6,7 @@ import { blueprintShape, UPGRADES } from "../../upgrades"; import { enumHubGoalRewards } from "../../tutorial_goals"; import { enumAnalyticsDataSource } from "../../production_analytics"; import { T } from "../../../translations"; +import { globalConfig } from "../../../core/config"; /** * Manages the pinned shapes on the left side of the screen @@ -265,10 +266,11 @@ export class HUDPinnedShapes extends BaseHUDPart { let currentValueFormatted = formatBigNumber(currentValue); if (handle.throughputOnly) { - currentValue = this.root.productionAnalytics.getCurrentShapeRate( - enumAnalyticsDataSource.delivered, - handle.definition - ); + currentValue = + this.root.productionAnalytics.getCurrentShapeRate( + enumAnalyticsDataSource.delivered, + handle.definition + ) / globalConfig.analyticsSliceDurationSeconds; currentValueFormatted = T.ingame.statistics.shapesDisplayUnits.second.replace( "", String(currentValue)