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