Enhance Voting and Home screens with pixel art styles; add player voting status list and update button designs for improved UI experience
This commit is contained in:
@ -539,8 +539,15 @@ class GameManager {
|
||||
return { error: 'Invalid song ID' };
|
||||
}
|
||||
|
||||
// Record the vote
|
||||
lobby.currentBattle.votes.set(playerId, songId);
|
||||
// Find player name for display purposes
|
||||
const player = lobby.players.find(p => p.id === playerId);
|
||||
const playerName = player ? player.name : 'Unknown Player';
|
||||
|
||||
// Record the vote with player name for UI display
|
||||
lobby.currentBattle.votes.set(playerId, {
|
||||
songId,
|
||||
playerName
|
||||
});
|
||||
|
||||
// Update vote counts
|
||||
if (songId === lobby.currentBattle.song1.id) {
|
||||
@ -549,6 +556,9 @@ class GameManager {
|
||||
lobby.currentBattle.song2Votes++;
|
||||
}
|
||||
|
||||
// Add a voteCount attribute for easier UI rendering
|
||||
lobby.currentBattle.voteCount = lobby.currentBattle.votes.size;
|
||||
|
||||
// Check if all connected players have voted
|
||||
const connectedPlayers = lobby.players.filter(p => p.isConnected).length;
|
||||
const voteCount = lobby.currentBattle.votes.size;
|
||||
|
Reference in New Issue
Block a user