Made actions show affordability

This commit is contained in:
thepaperpilot 2023-05-14 10:40:56 -05:00
parent e33d16fdf3
commit d045e71e5c
3 changed files with 18 additions and 2 deletions

View file

@ -98,6 +98,14 @@ export function getIncreaseConnectionsAction(
)} energy` )} energy`
}; };
}, },
fillColor(node: BoardNode) {
return Decimal.gte(
main.energy.value,
formula.evaluate((node.state as { maxConnections: number }).maxConnections)
)
? "var(--bought)"
: "var(--locked)";
},
confirmationLabel: (node: BoardNode): NodeLabel => confirmationLabel: (node: BoardNode): NodeLabel =>
Decimal.gte( Decimal.gte(
main.energy.value, main.energy.value,

View file

@ -743,6 +743,14 @@ export const booster = {
)} energy` )} energy`
}; };
}, },
fillColor(node: BoardNode) {
return Decimal.gte(
main.energy.value,
increaseBoostFormula.evaluate((node.state as unknown as BoosterState).level)
)
? "var(--bought)"
: "var(--locked)";
},
confirmationLabel(node: BoardNode) { confirmationLabel(node: BoardNode) {
return Decimal.gte( return Decimal.gte(
main.energy.value, main.energy.value,

View file

@ -731,7 +731,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
miningTabCollapsed miningTabCollapsed
}), }),
resources: () => ({ resources: () => ({
display: "Mine Rates", display: "Ore Rates",
glowColor(): string { glowColor(): string {
return modifierTabs.activeTab.value === this.tab ? "white" : ""; return modifierTabs.activeTab.value === this.tab ? "white" : "";
}, },
@ -740,7 +740,7 @@ export const main = createLayer("main", function (this: BaseLayer) {
resourcesCollapsed resourcesCollapsed
}), }),
resourcesGain: () => ({ resourcesGain: () => ({
display: "Resource Gain", display: "Ore Gain",
glowColor(): string { glowColor(): string {
return modifierTabs.activeTab.value === this.tab ? "white" : ""; return modifierTabs.activeTab.value === this.tab ? "white" : "";
}, },