Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/common/tooltips.js
Show First 20 Lines • Show All 594 Lines • ▼ Show 20 Lines | function multiplyEntityCosts(template, trainNum) | ||||
return totalCosts; | return totalCosts; | ||||
} | } | ||||
/** | /** | ||||
* Helper function for getEntityCostTooltip. | * Helper function for getEntityCostTooltip. | ||||
*/ | */ | ||||
function getEntityCostComponentsTooltipString(template, entity, buildingsCountToTrainFullBatch = 1, fullBatchSize = 1, remainderBatch = 0) | function getEntityCostComponentsTooltipString(template, entity, buildingsCountToTrainFullBatch = 1, fullBatchSize = 1, remainderBatch = 0) | ||||
{ | { | ||||
if (!template.cost) | |||||
return []; | |||||
let totalCosts = multiplyEntityCosts(template, buildingsCountToTrainFullBatch * fullBatchSize + remainderBatch); | let totalCosts = multiplyEntityCosts(template, buildingsCountToTrainFullBatch * fullBatchSize + remainderBatch); | ||||
if (template.cost.time) | if (template.cost.time) | ||||
Stan: What if time is 0 ? | |||||
FreagarachAuthorUnsubmitted Done Inline ActionsThen the time is not shown. Freagarach: Then the time is not shown. | |||||
totalCosts.time = Math.ceil(template.cost.time * (entity ? Engine.GuiInterfaceCall("GetBatchTime", { | totalCosts.time = Math.ceil(template.cost.time * (entity ? Engine.GuiInterfaceCall("GetBatchTime", { | ||||
"entity": entity, | "entity": entity, | ||||
"batchSize": buildingsCountToTrainFullBatch > 0 ? fullBatchSize : remainderBatch | "batchSize": buildingsCountToTrainFullBatch > 0 ? fullBatchSize : remainderBatch | ||||
}) : 1)); | }) : 1)); | ||||
let costs = []; | let costs = []; | ||||
for (let type of getCostTypes()) | for (let type of getCostTypes()) | ||||
// Population bonus is shown in the tooltip | // Population bonus is shown in the tooltip | ||||
▲ Show 20 Lines • Show All 403 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
What if time is 0 ?