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`
};
},
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 =>
Decimal.gte(
main.energy.value,

View file

@ -743,6 +743,14 @@ export const booster = {
)} 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) {
return Decimal.gte(
main.energy.value,

View file

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