Session 14: Buy All Upgrades (bulk-buy for upgrades) + empty-slot boost leak fix
- Added Game.buyAllUpgrades(): buys every affordable upgrade at once, respecting per-upgrade requirements and looping until nothing remains. - Added a 'Buy All' button to the Upgrades tab header; UI.updateBuyAllButton() shows/hides & enables/disables it live each tick based on affordability. - Fixed empty-slot branch of switchSlot(): added productionBoostUntil: 0 so a temporary golden-bloom boost cannot leak into a fresh slot. - Added .upgrades-header / .buy-all-btn CSS (gold accent theme). Verified: headless test buy-all-upgrades-test.mjs 24/24 pass; existing golden-bloom (22/22) and buy-max (6/6) tests re-run clean, no regressions.
This commit is contained in:
@@ -327,6 +327,42 @@ h2, h3 {
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
/* Upgrades header + Buy All button */
|
||||
.upgrades-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.upgrades-header h3 {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.buy-all-btn {
|
||||
background: var(--accent-gold);
|
||||
color: var(--bg-primary, #1a1035);
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
padding: 6px 14px;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
font-size: 0.8rem;
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.buy-all-btn:hover:not(:disabled) {
|
||||
background: #f1c40f;
|
||||
transform: scale(1.03);
|
||||
}
|
||||
|
||||
.buy-all-btn:disabled {
|
||||
background: var(--text-muted);
|
||||
color: var(--bg-primary, #1a1035);
|
||||
cursor: not-allowed;
|
||||
opacity: 0.4;
|
||||
}
|
||||
|
||||
/* Side Panel Tabs */
|
||||
.tabs {
|
||||
display: flex;
|
||||
|
||||
Reference in New Issue
Block a user