Add accents

This commit is contained in:
Vortrex
2021-10-25 12:59:34 -05:00
parent 299ce12008
commit 76432633d4

View File

@@ -27,11 +27,46 @@ function doesPlayerHaveAccent(client) {
function getPlayerAccentInlineOutput(client) {
let outputText = "";
//if(doesPlayerHaveAccent(client)) {
// outputText = `[${getPlayerAccentText(client)}]`;
//}
if(doesPlayerHaveAccent(client)) {
outputText = `[${getPlayerAccentText(client)}] `;
}
return outputText;
}
// ===========================================================================
function setAccentCommand(command, params, client) {
if(areParamsEmpty(params)) {
messagePlayerSyntax(client, getCommandSyntaxText(command));
return false;
}
let accentId = getAccentFromParams(params);
if(!accentId) {
messagePlayerError(client, "Accent not found!");
return false;
}
let accentString = getGlobalConfig().accents[accentId];
getPlayerCurrentSubAccount(client).accent = accentString;
messagePlayerSuccess(client, `You set your accent to ${getInlineChatColourByName("lightGrey")}${accentString}`);
}
// ===========================================================================
function listAccentsCommand(command, params, client) {
let stationList = getGlobalConfig().accents;
let chunkedList = splitArrayIntoChunks(stationList, 8);
messagePlayerInfo(client, `${getInlineChatColourByType("clanOrange")}== ${getInlineChatColourByType("jobYellow")}Accents ${getInlineChatColourByType("clanOrange")}==================================`);
for(let i in chunkedList) {
messagePlayerInfo(client, chunkedList[i].join(", "));
}
}
// ===========================================================================