Add oil gain requirement text

This commit is contained in:
ducdat0507 2022-12-08 22:35:53 +07:00
parent 87a36fd4e7
commit 2d1fb360dc
2 changed files with 11 additions and 3 deletions

View file

@ -993,10 +993,16 @@ const layer = createLayer(id, function (this: BaseLayer) {
sticky={true}
productionDisplay={jsx(() => (
<>
{Decimal.lt(depth.value, 1000) ? "Reach 1000m to start gaining oil" : formatGain(Decimal.add(computedOilSpeed.value, computedOilConsumption.value))}
{Decimal.lt(depth.value, 1000) ? "Reach 1000m to start gaining oil" :
<>{formatGain(Decimal.add(computedOilSpeed.value, computedOilConsumption.value))}
</>
}
</>
))}
/>
{Decimal.eq(computedOilSpeed.value, 0) ? <>
(Need at least 1 Oil Pump, 1 Heavy Drill and 1 Heavy Extractor active to gain oil)
<br/></> : ""}
<Row>
{
depthMilestones[6].earned.value ?

View file

@ -15,7 +15,7 @@
/></span>
<span v-if="productionComponent">
<br />
<component :is="productionComponent" ref="effectRef"
<component :is="productionComponent" ref="productionRef"
/></span>
</div>
</div>
@ -35,7 +35,7 @@
/></span>
<span v-if="productionComponent">
<br />
<component :is="productionComponent" ref="effectRef"
<component :is="productionComponent" ref="productionRef"
/></span>
</div>
</div>
@ -68,6 +68,8 @@ const effectComponent = computeOptionalComponent(
props.effectDisplay as Ref<CoercableComponent | undefined>
);
const productionRef = ref<ComponentPublicInstance | null>(null);
const productionComponent = computeOptionalComponent(
props.productionDisplay as Ref<CoercableComponent | undefined>
);