Chat box auto-hide (for next GTAC update)
This commit is contained in:
@@ -271,6 +271,26 @@ function setAccountChatScrollLinesCommand(command, params, client) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setAccountChatAutoHideDelayCommand(command, params, client) {
|
||||
if(areParamsEmpty(params)) {
|
||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||
return false;
|
||||
}
|
||||
|
||||
if(isNaN(params)) {
|
||||
messagePlayerError(client, `The delay time must be a number!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
let delay = Math.ceil(toInteger(params));
|
||||
|
||||
getPlayerData(client).accountData.chatAutoHideDelay = delay;
|
||||
sendPlayerChatAutoHideDelay(client, delay);
|
||||
messagePlayerSuccess(client, `Your chatbox will now automatically hide after ${toInteger(delay)} seconds!`);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function setAccountEmailCommand(command, params, client) {
|
||||
if(areParamsEmpty(params)) {
|
||||
messagePlayerSyntax(client, getCommandSyntaxText(command));
|
||||
@@ -637,6 +657,7 @@ function saveAccountToDatabase(accountData) {
|
||||
["acct_svr_staff_flags", accountData.flags.admin],
|
||||
["acct_svr_mod_flags", accountData.flags.moderation],
|
||||
["acct_svr_chat_scroll_lines", accountData.chatScrollLines],
|
||||
["acct_svr_chat_auto_hide_delay", accountData.chatAutoHideDelay],
|
||||
];
|
||||
|
||||
let queryString1 = createDatabaseUpdateQuery("acct_main", data, `acct_id=${accountData.databaseId}`);
|
||||
|
||||
@@ -275,6 +275,7 @@ class AccountData {
|
||||
this.twoFactorAuthVerificationCode = "";
|
||||
|
||||
this.chatScrollLines = 1;
|
||||
this.chatAutoHideDelay = 0;
|
||||
|
||||
this.streamingRadioVolume = 20;
|
||||
this.locale = 0;
|
||||
@@ -304,6 +305,7 @@ class AccountData {
|
||||
this.emailVerificationCode = dbAssoc["acct_code_verifyemail"];
|
||||
this.twoFactorAuthVerificationCode = dbAssoc["acct_code_2fa"];
|
||||
this.chatScrollLines = toInteger(dbAssoc["acct_svr_chat_scroll_lines"]);
|
||||
this.chatAutoHideDelay = toInteger(dbAssoc["acct_svr_chat_auto_hide_delay"]);
|
||||
this.streamingRadioVolume = toInteger(dbAssoc["acct_streaming_radio_volume"]);
|
||||
this.locale = toInteger(dbAssoc["acct_locale"]);
|
||||
}
|
||||
|
||||
@@ -938,6 +938,12 @@ function sendPlayerChatScrollLines(client, amount) {
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function sendPlayerChatAutoHideDelay(client, delay) {
|
||||
sendNetworkEventToPlayer("vrr.chatAutoHideDelay", client, delay);
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function playRadioStreamForPlayer(client, streamURL, loop = true, volume = 0, element = false) {
|
||||
logToConsole(LOG_DEBUG, `[VRR.Client] Forcing ${getPlayerDisplayForConsole(client)} to stream ${streamURL}`);
|
||||
sendNetworkEventToPlayer("vrr.radioStream", client, streamURL, loop, volume, element);
|
||||
|
||||
@@ -55,7 +55,8 @@ function loadCommands() {
|
||||
//commandData("setdiscord", setAccountDiscordCommand, "<discord id>", getStaffFlagValue("None"), true, false, "Set up the integration for discord. Allows you to see info and use in-game commands on discord."),
|
||||
commandData("notips", toggleNoRandomTipsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off random tips"),
|
||||
commandData("loginalert", toggleAccountLoginAttemptNotificationsCommand, "", getStaffFlagValue("None"), true, false, "Turn on and off email notifications for attempts to login to your account"),
|
||||
commandData("scrolllines", setAccountChatScrollLinesCommand, "", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
||||
commandData("scrolllines", setAccountChatScrollLinesCommand, "<number of lines>", getStaffFlagValue("None"), true, false, "Sets how many chatbox lines to scroll at a time when using pageup/pagedown"),
|
||||
commandData("chatautohide", setAccountChatAutoHideDelayCommand, "<time in seconds>", getStaffFlagValue("None"), true, false, "Sets how long to wait to hide the chatbox after last use (in seconds)"),
|
||||
|
||||
],
|
||||
ammunation: [],
|
||||
|
||||
Reference in New Issue
Block a user