Use simpler chunked list for characters
This commit is contained in:
@@ -245,16 +245,12 @@ function showCharacterSelectToClient(client) {
|
||||
//}, 500);
|
||||
logToConsole(LOG_DEBUG, `[VRR.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select GUI`);
|
||||
} else {
|
||||
//let emojiNumbers = ["➊", "➋", "➌", "➍", "➎", "➏", "➐", "➑", "➒"];
|
||||
//let emojiNumbers = ["①", "②", "③", "④", "⑤", "⑥", "⑦", "⑧", "⑨"];
|
||||
//let emojiNumbers = ["1️⃣", "2️⃣", "3️⃣", "4️⃣", "5️⃣", "6️⃣", "7️⃣", "8️⃣", "9️⃣"];
|
||||
messagePlayerNormal(client, `You have the following characters. Use /usechar <id> to select one:`, getColourByName("teal"));
|
||||
getPlayerData(client).subAccounts.forEach(function(subAccount, index) {
|
||||
let tempSubAccount = getPlayerData(client).subAccounts[0];
|
||||
//let clanName = (tempSubAccount.clan != 0) ? getClanData(getClanIdFromDatabaseId(tempSubAccount.clan)).name : "None";
|
||||
let lastPlayedText = (tempSubAccount.lastLogin != 0) ? `${msToTime(getCurrentUnixTimestamp()-tempSubAccount.lastLogin)} ago` : "Never";
|
||||
messagePlayerNormal(client, `${index+1} • [#BBBBBB]${subAccount.firstName} ${subAccount.lastName} ($${tempSubAccount.cash}, ${lastPlayedText})`);
|
||||
});
|
||||
let charactersList = getPlayerData(client).subAccounts.map(sacct, index => `{teal}${index}: {ALTCOLOUR}${sacct.name}`);
|
||||
let chunkedList = splitArrayIntoChunks(charactersList, 5);
|
||||
messagePlayerNormal(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderCharacterListSelf")));
|
||||
for (let i in chunkedList) {
|
||||
messagePlayerNormal(client, chunkedList[i].join("{MAINCOLOUR}, "));
|
||||
}
|
||||
logToConsole(LOG_DEBUG, `[VRR.SubAccount] ${getPlayerDisplayForConsole(client)} is being shown the character select/list message (GUI disabled)`);
|
||||
}
|
||||
}
|
||||
@@ -302,7 +298,6 @@ function checkNewCharacter(client, firstName, lastName) {
|
||||
getPlayerData(client).subAccounts = loadSubAccountsFromAccount(getPlayerData(client).accountData.databaseId);
|
||||
getPlayerData(client).currentSubAccount = 0;
|
||||
getPlayerData(client).creatingCharacter = false;
|
||||
let tempSubAccount = getPlayerData(client).subAccounts[0];
|
||||
showCharacterSelectToClient(client);
|
||||
}
|
||||
|
||||
@@ -582,5 +577,6 @@ function forcePlayerIntoSwitchCharacterScreen(client) {
|
||||
getPlayerData(client).switchingCharacter = true;
|
||||
|
||||
showConnectCameraToPlayer(client);
|
||||
|
||||
showCharacterSelectToClient(client);
|
||||
}
|
||||
Reference in New Issue
Block a user