Added sideswitch functionality, cleanup, comments

This commit is contained in:
2024-05-28 23:00:32 +02:00
parent 835248a9dc
commit ad6ab2ecab
5 changed files with 60 additions and 9 deletions
+7 -2
View File
@@ -21,7 +21,7 @@ function configTeam(team, name, name2, isSpielgemeinschaft) {};
function setScore(team, score) {};
function alterScore(team, dir) {};
function clearScore() {};
function toggleSwitch() {};
function toggleSideSwitch() {};
function getEnabled() {};
function getValues() {};
@@ -83,8 +83,11 @@ function clearScore() {
}
// Toggle sideswitch
function toggleSwitch() {
function toggleSideswitch() {
console.log("Seiten gewechselt");
sideswitch = !sideswitch;
io.sockets.emit('score', print());
io.sockets.emit('scoreSideswitch', '');
}
// Return enabled value
@@ -92,6 +95,7 @@ function getEnabled() {
return enabled
}
// Print current score depending on sideswitch
function print() {
if(sideswitch) {
return teamB.score + ":" + teamA.score
@@ -100,6 +104,7 @@ function print() {
}
}
// Return all important values
function getValues() {
return {
enabled: enabled,