From 05e58874dcdf31e1a87fe468963fea18804cba22 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 2 May 2022 15:26:39 -0500 Subject: [PATCH] Fix GUI toggle cmd --- scripts/server/account.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/server/account.js b/scripts/server/account.js index 0a2855db..f28b4d01 100644 --- a/scripts/server/account.js +++ b/scripts/server/account.js @@ -92,16 +92,17 @@ function toggleAutoSelectLastCharacterCommand(command, params, client) { // =========================================================================== function toggleAccountGUICommand(command, params, client) { + // Remember, the flag is BACKWARD. Enabled = NO GUI! let flagValue = getAccountSettingsFlagValue("NoGUI"); if(doesPlayerHaveGUIEnabled(client)) { - getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue); - messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`)); - logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`); - } else { getPlayerData(client).accountData.settings = addBitFlag(getPlayerData(client).accountData.settings, flagValue); messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softRed}${toUpperCase(getLocaleString(client, "Off"))}{MAINCOLOUR}`)); logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account OFF.`); + } else { + getPlayerData(client).accountData.settings = removeBitFlag(getPlayerData(client).accountData.settings, flagValue); + messagePlayerNormal(client, getLocaleString(client, "GUIAccountSettingToggle", `{softGreen}${toUpperCase(getLocaleString(client, "On"))}{MAINCOLOUR}`)); + logToConsole(LOG_DEBUG, `[VRR.Account] ${getPlayerDisplayForConsole(client)} has toggled GUI for their account ON.`); } if(!isPlayerLoggedIn(client)) {