mirror of
https://github.com/thepaperpilot/Planar-Pioneers.git
synced 2024-11-21 16:13:54 +00:00
Display cannot afford when appropriate for increasing connections actions
This commit is contained in:
parent
e9d4adda9c
commit
cfd29548a0
1 changed files with 7 additions and 0 deletions
|
@ -378,6 +378,13 @@ export const main = createLayer("main", function (this: BaseLayer) {
|
|||
)} energy`
|
||||
};
|
||||
},
|
||||
confirmationLabel: (node: BoardNode) =>
|
||||
Decimal.gte(
|
||||
energy.value,
|
||||
formula.evaluate((node.state as { maxConnections: number }).maxConnections)
|
||||
)
|
||||
? { text: "Tap again to confirm" }
|
||||
: { text: "Cannot afford", color: "var(--danger)" },
|
||||
onClick(node: BoardNode) {
|
||||
const cost = formula.evaluate(
|
||||
(node.state as { maxConnections: number }).maxConnections
|
||||
|
|
Loading…
Reference in a new issue