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

@@ -75,7 +75,7 @@ function showAnimationListCommand(command, params, client) {
let chunkedList = splitArrayIntoChunks(animList, 10);
messagePlayerInfo(client, makeChatSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
messagePlayerInfo(client, makeChatBoxSectionHeader(getLocaleString(client, "HeaderAnimationsList")));
for(let i in chunkedList) {
messagePlayerNormal(client, chunkedList[i].join(", "));
@@ -138,4 +138,22 @@ function makePlayerStopAnimation(client) {
getPlayerData(client).animationForced = false;
}
// ===========================================================================
function getAnimationFromParams(params) {
if(isNaN(params)) {
for(let i in getGameData().animations[getServerGame()]) {
if(toLowerCase(getGameData().animations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
return i;
}
}
} else {
if(typeof getGameData().animations[getServerGame()][params] != "undefined") {
return toInteger(params);
}
}
return false;
}
// ===========================================================================