Organize a lot of utils

This commit is contained in:
Vortrex
2022-01-09 17:19:53 -06:00
parent 2684ffae7d
commit 5dfe47a3e8
16 changed files with 905 additions and 1069 deletions

View File

@@ -211,4 +211,32 @@ function messagePlayerTimedRandomTip(client, message) {
}
}
// ===========================================================================
function makeChatBoxSectionHeader(name) {
let resultString = `== ${name} `;
let endFiller = fillStringWithCharacter("=", getGlobalConfig().chatSectionHeaderLength-resultString.length);
return `${resultString} ${endFiller}`;
}
// ===========================================================================
function clearChatBox(client) {
//game.messages.clear();
for(let i = 0; i <= 20; i++) {
messageClient(" ", client, COLOUR_WHITE);
}
}
// ===========================================================================
function replaceEmojiIntoString(message) {
for(let i in emojiReplaceString) {
while(message.indexOf(emojiReplaceString[i][0]) != -1) {
message = message.replace(emojiReplaceString[i][0], emojiReplaceString[i][1]);
}
}
return message;
}
// ===========================================================================