function writeResultsToChat() {
    let tmpData = [];
    for (let key of Object.keys(playerData)) {
        tmpData.push(playerData[key]);
    }
    let oldMessage = gameChat.$chatInputField.val();
    gameChat.$chatInputField.val("========FINAL RESULT========");
    gameChat.sendMessage();
    if (!returningToLobby) {
        if ($("#smRigTrackerQuizEndScore").prop("checked")) {
            if ($("#smRigTrackerQuizEndNames").prop("checked")) {
                gameChat.$chatInputField.val("Score: " + tmpData[0].name + " " + tmpData[0].score + "-" + tmpData[1].score + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Score: " + tmpData[0].score + "-" + tmpData[1].score);
                gameChat.sendMessage();
            }
        }
        if ($("#smRigTrackerQuizEndRig").prop("checked")) {
            if ($("#smRigTrackerQuizEndNames").prop("checked")) {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].rig + "-" + tmpData[1].rig);
                gameChat.sendMessage();
            }
        }
    }
    else {
        if ($("#smRigTrackerLobbyScore").prop("checked")) {
            if ($("#smRigTrackerLobbyNames").prop("checked")) {
                gameChat.$chatInputField.val("Score: " + tmpData[0].name + " " + tmpData[0].score + "-" + tmpData[1].score + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Score: " + tmpData[0].score + "-" + tmpData[1].score);
                gameChat.sendMessage();
            }
        }
        if ($("#smRigTrackerLobbyRig").prop("checked")) {
            if ($("#smRigTrackerLobbyNames").prop("checked")) {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].rig + "-" + tmpData[1].rig);
                gameChat.sendMessage();
            }
        }
    }

    gameChat.$chatInputField.val(oldMessage);
}
// Write the final result at the end of the game
Write the final result at the end of the game
Write the final result at the end of the game
function writeResultsToChat() {
    let tmpData = [];
    for (let key of Object.keys(playerData)) {
        tmpData.push(playerData[key]);
    }
    let oldMessage = gameChat.$chatInputField.val();
    gameChat.$chatInputField.val("========FINAL RESULT========");
    gameChat.sendMessage();
    if (!returningToLobby) {
        if ($("#smRigTrackerQuizEndScore").prop("checked")) {
            if ($("#smRigTrackerQuizEndNames").prop("checked")) {
                gameChat.$chatInputField.val("Score: " + tmpData[0].name + " " + tmpData[0].score + "-" + tmpData[1].score + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Score: " + tmpData[0].score + "-" + tmpData[1].score);
                gameChat.sendMessage();
            }
        }
        if ($("#smRigTrackerQuizEndRig").prop("checked")) {
            if ($("#smRigTrackerQuizEndNames").prop("checked")) {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].rig + "-" + tmpData[1].rig);
                gameChat.sendMessage();
            }
        }
    }
    else {
        if ($("#smRigTrackerLobbyScore").prop("checked")) {
            if ($("#smRigTrackerLobbyNames").prop("checked")) {
                gameChat.$chatInputField.val("Score: " + tmpData[0].name + " " + tmpData[0].score + "-" + tmpData[1].score + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Score: " + tmpData[0].score + "-" + tmpData[1].score);
                gameChat.sendMessage();
            }
        }
        if ($("#smRigTrackerLobbyRig").prop("checked")) {
            if ($("#smRigTrackerLobbyNames").prop("checked")) {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name);
                gameChat.sendMessage();
            }
            else {
                gameChat.$chatInputField.val("Rig: " + tmpData[0].rig + "-" + tmpData[1].rig);
                gameChat.sendMessage();
            }
        }
    }
    gameChat.$chatInputField.val(oldMessage);
}
function writeResultsToChat ( ) { let tmpData = [ ] ; for ( let key of Object . keys ( playerData ) ) { tmpData . push ( playerData [ key ] ) ; } let oldMessage = gameChat . $chatInputField . val ( ) ; gameChat . $chatInputField . val ( "========FINAL RESULT========" ) ; gameChat . sendMessage ( ) ; if ( ! returningToLobby ) { if ( $ ( "#smRigTrackerQuizEndScore" ) . prop ( "checked" ) ) { if ( $ ( "#smRigTrackerQuizEndNames" ) . prop ( "checked" ) ) { gameChat . $chatInputField . val ( "Score: " + tmpData [ 0 ] . name + " " + tmpData [ 0 ] . score + "-" + tmpData [ 1 ] . score + " " + tmpData [ 1 ] . name ) ; gameChat . sendMessage ( ) ; } else { gameChat . $chatInputField . val ( "Score: " + tmpData [ 0 ] . score + "-" + tmpData [ 1 ] . score ) ; gameChat . sendMessage ( ) ; } } if ( $ ( "#smRigTrackerQuizEndRig" ) . prop ( "checked" ) ) { if ( $ ( "#smRigTrackerQuizEndNames" ) . prop ( "checked" ) ) { gameChat . $chatInputField . val ( "Rig: " + tmpData [ 0 ] . name + " " + tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig + " " + tmpData [ 1 ] . name ) ; gameChat . sendMessage ( ) ; } else { gameChat . $chatInputField . val ( "Rig: " + tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig ) ; gameChat . sendMessage ( ) ; } } } else { if ( $ ( "#smRigTrackerLobbyScore" ) . prop ( "checked" ) ) { if ( $ ( "#smRigTrackerLobbyNames" ) . prop ( "checked" ) ) { gameChat . $chatInputField . val ( "Score: " + tmpData [ 0 ] . name + " " + tmpData [ 0 ] . score + "-" + tmpData [ 1 ] . score + " " + tmpData [ 1 ] . name ) ; gameChat . sendMessage ( ) ; } else { gameChat . $chatInputField . val ( "Score: " + tmpData [ 0 ] . score + "-" + tmpData [ 1 ] . score ) ; gameChat . sendMessage ( ) ; } } if ( $ ( "#smRigTrackerLobbyRig" ) . prop ( "checked" ) ) { if ( $ ( "#smRigTrackerLobbyNames" ) . prop ( "checked" ) ) { gameChat . $chatInputField . val ( "Rig: " + tmpData [ 0 ] . name + " " + tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig + " " + tmpData [ 1 ] . name ) ; gameChat . sendMessage ( ) ; } else { gameChat . $chatInputField . val ( "Rig: " + tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig ) ; gameChat . sendMessage ( ) ; } } } gameChat . $chatInputField . val ( oldMessage ) ; }
Write the final result at the end of the game
Write the final result at the end of the game