1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

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"; return "#b37dcd";
} }
getShowWiresLayerPreview() {
return true;
}
/** /**
* Creates the entity at the given location * Creates the entity at the given location
* @param {Entity} entity * @param {Entity} entity

View File

@ -144,9 +144,11 @@ export class HubGoals extends BasicSerializableObject {
*/ */
getCurrentGoalDelivered() { getCurrentGoalDelivered() {
if (this.currentGoal.throughputOnly) { if (this.currentGoal.throughputOnly) {
return this.root.productionAnalytics.getCurrentShapeRate( return (
enumAnalyticsDataSource.delivered, this.root.productionAnalytics.getCurrentShapeRate(
this.currentGoal.definition enumAnalyticsDataSource.delivered,
this.currentGoal.definition
) / globalConfig.analyticsSliceDurationSeconds
); );
} }

View File

@ -6,6 +6,7 @@ import { blueprintShape, UPGRADES } from "../../upgrades";
import { enumHubGoalRewards } from "../../tutorial_goals"; import { enumHubGoalRewards } from "../../tutorial_goals";
import { enumAnalyticsDataSource } from "../../production_analytics"; import { enumAnalyticsDataSource } from "../../production_analytics";
import { T } from "../../../translations"; import { T } from "../../../translations";
import { globalConfig } from "../../../core/config";
/** /**
* Manages the pinned shapes on the left side of the screen * Manages the pinned shapes on the left side of the screen
@ -265,10 +266,11 @@ export class HUDPinnedShapes extends BaseHUDPart {
let currentValueFormatted = formatBigNumber(currentValue); let currentValueFormatted = formatBigNumber(currentValue);
if (handle.throughputOnly) { if (handle.throughputOnly) {
currentValue = this.root.productionAnalytics.getCurrentShapeRate( currentValue =
enumAnalyticsDataSource.delivered, this.root.productionAnalytics.getCurrentShapeRate(
handle.definition enumAnalyticsDataSource.delivered,
); handle.definition
) / globalConfig.analyticsSliceDurationSeconds;
currentValueFormatted = T.ingame.statistics.shapesDisplayUnits.second.replace( currentValueFormatted = T.ingame.statistics.shapesDisplayUnits.second.replace(
"<shapes>", "<shapes>",
String(currentValue) String(currentValue)