function writeRigToChat(animeTitle) {
    let tmpData = [];
    let message = "";
    if (Object.keys(playerData).length !== 2) {
        gameChat.systemMessage("Writing rig to chat requires exactly 2 players, writing rig to chat has been disabled");
        $("#smRigTrackerChat").prop("checked", false);
        updateEnabled("smRigTrackerChat");
    }
    else {
        for (let key of Object.keys(playerData)) {
            tmpData.push(playerData[key]);
        }
        if ($("#smRigTrackerPlayerNames").prop("checked")) {
            message += tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name;
        }
        else {
            message += tmpData[0].rig + "-" + tmpData[1].rig;
        }
        if ($("#smRigTrackerScore").prop("checked")) {
            message += ", Score: " + tmpData[0].score + "-" + tmpData[1].score;
        }
        if ($("#smRigTrackerAnime").prop("checked")) {
            if ($("#smRigTrackerAnimeRomaji").prop("checked")) {
                message += " (" + animeTitle.romaji + ")";
            }
            else if ($("#smRigTrackerAnimeEnglish").prop("checked")){
                message += " (" + animeTitle.english + ")";
            }
            else {
                message += " (" + animeTitle.romaji + ")";
            }
        }
    }
    let oldMessage = gameChat.$chatInputField.val();
    gameChat.$chatInputField.val(message);
    gameChat.sendMessage();
    gameChat.$chatInputField.val(oldMessage);
}
// Writes the rig to chat (for 2 players, automatically disables if there's more or less than 2 players)
Writes the rig to chat (for 2 players, automatically disables if there's more or less than 2 players)
Writes the rig to chat ( for 2 players automatically disables if there ' s more or less than 2 players )
function writeRigToChat(animeTitle) {
    let tmpData = [];
    let message = "";
    if (Object.keys(playerData).length !== 2) {
        gameChat.systemMessage("Writing rig to chat requires exactly 2 players, writing rig to chat has been disabled");
        $("#smRigTrackerChat").prop("checked", false);
        updateEnabled("smRigTrackerChat");
    }
    else {
        for (let key of Object.keys(playerData)) {
            tmpData.push(playerData[key]);
        }
        if ($("#smRigTrackerPlayerNames").prop("checked")) {
            message += tmpData[0].name + " " + tmpData[0].rig + "-" + tmpData[1].rig + " " + tmpData[1].name;
        }
        else {
            message += tmpData[0].rig + "-" + tmpData[1].rig;
        }
        if ($("#smRigTrackerScore").prop("checked")) {
            message += ", Score: " + tmpData[0].score + "-" + tmpData[1].score;
        }
        if ($("#smRigTrackerAnime").prop("checked")) {
            if ($("#smRigTrackerAnimeRomaji").prop("checked")) {
                message += " (" + animeTitle.romaji + ")";
            }
            else if ($("#smRigTrackerAnimeEnglish").prop("checked")){
                message += " (" + animeTitle.english + ")";
            }
            else {
                message += " (" + animeTitle.romaji + ")";
            }
        }
    }
    let oldMessage = gameChat.$chatInputField.val();
    gameChat.$chatInputField.val(message);
    gameChat.sendMessage();
    gameChat.$chatInputField.val(oldMessage);
}
function writeRigToChat ( animeTitle ) { let tmpData = [ ] ; let message = "" ; if ( Object . keys ( playerData ) . length !== 2 ) { gameChat . systemMessage ( "Writing rig to chat requires exactly 2 players, writing rig to chat has been disabled" ) ; $ ( "#smRigTrackerChat" ) . prop ( "checked" , false ) ; updateEnabled ( "smRigTrackerChat" ) ; } else { for ( let key of Object . keys ( playerData ) ) { tmpData . push ( playerData [ key ] ) ; } if ( $ ( "#smRigTrackerPlayerNames" ) . prop ( "checked" ) ) { message += tmpData [ 0 ] . name + " " + tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig + " " + tmpData [ 1 ] . name ; } else { message += tmpData [ 0 ] . rig + "-" + tmpData [ 1 ] . rig ; } if ( $ ( "#smRigTrackerScore" ) . prop ( "checked" ) ) { message += ", Score: " + tmpData [ 0 ] . score + "-" + tmpData [ 1 ] . score ; } if ( $ ( "#smRigTrackerAnime" ) . prop ( "checked" ) ) { if ( $ ( "#smRigTrackerAnimeRomaji" ) . prop ( "checked" ) ) { message += " (" + animeTitle . romaji + ")" ; } else if ( $ ( "#smRigTrackerAnimeEnglish" ) . prop ( "checked" ) ) { message += " (" + animeTitle . english + ")" ; } else { message += " (" + animeTitle . romaji + ")" ; } } } let oldMessage = gameChat . $chatInputField . val ( ) ; gameChat . $chatInputField . val ( message ) ; gameChat . sendMessage ( ) ; gameChat . $chatInputField . val ( oldMessage ) ; }
Writes the rig to chat (for 2 players, automatically disables if there's more or less than 2 players)
Writes the rig to chat ( for 2 players automatically disables if there ' s more or less than 2 players )