Session 16: Global 'Buy All Buildings' bulk-buy feature Added

Adds a global Buy All button to the Buildings panel that purchases as many
of every building type the player can afford at once, bringing Plants in line
with the Upgrades (Buy All) and Prestige (Buy Max) panels.

- game.js: Game.buyAllBuildings() loops buyMaxBuilding() per building type
- ui.js: UI.updateBuyAllBuildings() shows/hides + enables/disables live each tick
- index.html: Buy All button in Buildings panel header (reuses .upgrades-header/.buy-all-btn)
- Added headless test buy-all-buildings-test.mjs (31/31 pass); all existing suites green
This commit is contained in:
2026-08-24 18:00:27 +00:00
parent 44f55f0d24
commit cc1fa6bc4d
4 changed files with 96 additions and 1 deletions
+4 -1
View File
@@ -44,7 +44,10 @@
<!-- Center Panel: Buildings -->
<section id="buildings-panel">
<h2>Plants</h2>
<div class="upgrades-header">
<h2>Plants</h2>
<button id="buy-all-buildings" class="buy-all-btn" style="display:none" title="Buy as many of every building you can currently afford">Buy All</button>
</div>
<div id="buildings-list"></div>
</section>