mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-22 00:21:31 +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() {
|
||||
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;
|
||||
}
|
||||
}));
|
||||
|
||||
|
|
Loading…
Reference in a new issue