From 9e0ed21a2f7337f300d059763e99525bde02c318 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 23 Apr 2023 12:05:03 -0500 Subject: [PATCH] Draw line from factory to selected material node --- src/data/projEntry.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/data/projEntry.tsx b/src/data/projEntry.tsx index d2fc793..f44f976 100644 --- a/src/data/projEntry.tsx +++ b/src/data/projEntry.tsx @@ -456,12 +456,22 @@ export const main = createLayer("main", function (this: BaseLayer) { }, links() { const mine = board.nodes.value.find(n => n.type === "mine") as BoardNode; - return Object.keys(resourceMinedCooldown).map(resource => ({ + const links = Object.keys(resourceMinedCooldown).map(resource => ({ startNode: mine, endNode: resourceNodes.value[resource as Resources], stroke: "var(--accent3)", strokeWidth: 5 })); + const factory = board.nodes.value.find(n => n.type === "factory"); + if (factory != null && factory.state != null) { + links.push({ + startNode: factory, + endNode: resourceNodes.value[factory.state as Resources], + stroke: "var(--foreground)", + strokeWidth: 4 + }); + } + return links; } }));