Add optional chatbox timestamps

This commit is contained in:
Vortrex
2022-06-27 09:35:58 -05:00
parent acd03cc124
commit e017313b58
5 changed files with 88 additions and 41 deletions

View File

@@ -387,6 +387,23 @@ function toggleAccountTwoFactorAuthCommand(command, params, client) {
// ===========================================================================
function toggleChatBoxTimeStampsCommand(command, params, client) {
let flagValue = getAccountSettingsFlagValue("ChatBoxTimestamps");
if (hasBitFlag(getPlayerData(client).accountData.settings, flagValue)) {
getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "ChatBoxTimestampsToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}`));
sendPlayerChatBoxTimeStampsState(client, false);
} else {
getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue);
messagePlayerSuccess(client, getLocaleString(client, "ChatBoxTimestampsToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}`));
sendPlayerChatBoxTimeStampsState(client, false);
}
return true;
}
// ===========================================================================
function registerCommand(command, params, client) {
if (isPlayerRegistered(client)) {
messagePlayerError(client, getLocaleString(client, "AccountNameAlreadyRegistered"));