fix dashboard display and player switch

This commit is contained in:
Benjamin Palko 2025-08-27 16:24:16 -04:00
parent 0a33022c6a
commit d42b7cb612
2 changed files with 46 additions and 41 deletions

View file

@ -20,13 +20,14 @@ Singleton {
if (players.length == 0) {
return;
}
properties.currentIndex = properties.currentIndex + 1 % players.length;
properties.currentIndex = (properties.currentIndex + 1) % players.length;
}
function previousPlayer() {
if (players.length == 0) {
return;
}
properties.currentIndex = properties.currentIndex - 1 % players.length;
const newIndex = properties.currentIndex - 1;
properties.currentIndex = newIndex >= 0 ? newIndex : players.length - 1;
}
}