From c21a72abe45bb031effc59c8ec66abbeeacfc689 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Thu, 22 Dec 2022 12:51:33 -0600 Subject: [PATCH] Made wheels description dynamic --- src/data/layers/factory.tsx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/data/layers/factory.tsx b/src/data/layers/factory.tsx index 800bc43..97afd12 100644 --- a/src/data/layers/factory.tsx +++ b/src/data/layers/factory.tsx @@ -375,7 +375,13 @@ const factory = createLayer(id, () => { key: "shift+3", name: "Wheel Crafter", type: "processor", - description: "Turns 1 plastic into 1 wheel every second.", + // TODO construct descriptions dynamically better + description: computed( + () => + `Turns 1 plastic into ${ + toys.milestones.milestone5.earned.value ? "2 wheels" : "1 wheel" + } every second.` + ), energyCost: 2, tick: 1, inputs: { @@ -422,7 +428,7 @@ const factory = createLayer(id, () => { amount: 2 }, cloth: { - amount: 3, + amount: 3 }, dye: { amount: 1 @@ -562,7 +568,7 @@ const factory = createLayer(id, () => { imageSrc: string; name: string; type: "command" | "conveyor" | "processor"; - description: string; + description: ProcessedComputable; energyCost?: number; /** amount it consumes */ @@ -1246,7 +1252,7 @@ const factory = createLayer(id, () => {
- {FACTORY_COMPONENTS[whatIsHovered.value].description} + {unref(FACTORY_COMPONENTS[whatIsHovered.value].description)} {FACTORY_COMPONENTS[whatIsHovered.value].energyCost ?? 0 ? ( <>
@@ -1329,7 +1335,7 @@ const factory = createLayer(id, () => { >

{FACTORY_COMPONENTS[compHovered.value.type].name}


- {FACTORY_COMPONENTS[compHovered.value.type].description} + {unref(FACTORY_COMPONENTS[compHovered.value.type].description)}
{compHovered.value.type !== "conveyor" ? ( <>