Fix throughput goals and add layer preview to producer

This commit is contained in:
tobspr 2020-09-29 12:58:16 +02:00
parent 8ec2a90ae3
commit e96821b555
3 changed files with 15 additions and 7 deletions

View File

@ -14,6 +14,10 @@ export class MetaItemProducerBuilding extends MetaBuilding {
return "#b37dcd";
}
getShowWiresLayerPreview() {
return true;
}
/**
* Creates the entity at the given location
* @param {Entity} entity

View File

@ -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
);
}

View File

@ -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(
"<shapes>",
String(currentValue)