mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2025-02-16 09:41:40 +00:00
Draw line from factory to selected material node
This commit is contained in:
parent
4421cfe8bd
commit
9e0ed21a2f
1 changed files with 11 additions and 1 deletions
|
@ -456,12 +456,22 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
||||||
},
|
},
|
||||||
links() {
|
links() {
|
||||||
const mine = board.nodes.value.find(n => n.type === "mine") as BoardNode;
|
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,
|
startNode: mine,
|
||||||
endNode: resourceNodes.value[resource as Resources],
|
endNode: resourceNodes.value[resource as Resources],
|
||||||
stroke: "var(--accent3)",
|
stroke: "var(--accent3)",
|
||||||
strokeWidth: 5
|
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;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue