Fix: Default player count and initialize player type rows

This commit is contained in:
sokol
2026-02-22 11:20:13 +03:00
parent ed27ca93ab
commit 18fe0332ae
2 changed files with 8 additions and 2 deletions

View File

@@ -72,6 +72,12 @@ class GameUI {
const playerCountSelect = document.getElementById('player-count');
const playerTypeRows = document.querySelectorAll('.player-type-row');
// Initialize player type rows visibility based on default selection
const initialCount = parseInt(playerCountSelect.value);
playerTypeRows.forEach((row, index) => {
row.style.display = index < initialCount ? 'flex' : 'none';
});
playerCountSelect.addEventListener('change', (e) => {
const count = parseInt(e.target.value);
playerTypeRows.forEach((row, index) => {

View File

@@ -20,8 +20,8 @@
<div class="setup-group">
<label for="player-count">Total Players:</label>
<select id="player-count">
<option value="2">2 Players</option>
<option value="3" selected>3 Players</option>
<option value="2" selected>2 Players</option>
<option value="3">3 Players</option>
<option value="4">4 Players</option>
</select>
</div>