Fix: Default player count and initialize player type rows
This commit is contained in:
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user