Use normal chat for now

This commit is contained in:
Vortrex
2022-03-11 02:47:59 -06:00
parent 24e70233cb
commit 78330aa4b1
5 changed files with 43 additions and 23 deletions

View File

@@ -46,6 +46,7 @@ function unBindChatBoxKeys() {
// ===========================================================================
function receiveChatBoxMessageFromServer(messageString, colour) {
logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
let colouredString = replaceColoursInMessage(messageString);
if(bottomMessageIndex >= chatBoxHistory.length-1) {

View File

@@ -225,3 +225,10 @@ function onCameraProcess(event) {
}
// ===========================================================================
function onChatOutput(event, messageText, colour) {
//event.preventDefault();
//receiveChatBoxMessageFromServer(messageText, colour);
}
// ===========================================================================

View File

@@ -16,27 +16,32 @@ function initChatScript() {
// ===========================================================================
function processPlayerChat(client, messageText) {
if(!getPlayerData(client)) {
messagePlayerError(client, "You need to login before you can chat!");
return false;
}
if(!isConsole(client)) {
if(!getPlayerData(client)) {
messagePlayerError(client, "You need to login before you can chat!");
return false;
}
if(!isPlayerLoggedIn(client)) {
messagePlayerError(client, "You need to login before you can chat!");
return false;
}
if(!isPlayerLoggedIn(client)) {
messagePlayerError(client, "You need to login before you can chat!");
return false;
}
if(!isPlayerSpawned(client)) {
messagePlayerError(client, "You need to spawn before you can chat!");
return false;
}
if(!isPlayerSpawned(client)) {
messagePlayerError(client, "You need to spawn before you can chat!");
return false;
}
if(isPlayerMuted(client)) {
messagePlayerError(client, "You are muted and can't chat!");
return false;
}
if(isPlayerMuted(client)) {
messagePlayerError(client, "You are muted and can't chat!");
return false;
}
messageText = messageText.substring(0, 128);
messageText = messageText.substring(0, 128);
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
} else {
messagePlayerNormal(null, `🛡️ (ADMIN) - ${messageText}`);
}
/*
let clients = getClients();
@@ -48,7 +53,7 @@ function processPlayerChat(client, messageText) {
messagePlayerNormal(clients[i], `💬 ${getCharacterFullName(client)}: [#FFFFFF]${translatedText}${original}`, clients[i], getColourByName("mediumGrey"));
}
*/
messagePlayerNormal(null, `💬 ${getCharacterFullName(client)}: ${messageText}`);
//messageDiscordChatChannel(`💬 ${getCharacterFullName(client)}: ${messageText}`);
}

View File

@@ -520,9 +520,8 @@ function sendPlayerRemoveFromVehicle(client) {
// ===========================================================================
function sendChatBoxMessageToPlayer(client, message, colour) {
sendNetworkEventToPlayer("vrr.m", client, message, colour)
//messageClient(message, client, colour);
function sendChatBoxMessageToPlayer(client, messageText, colour) {
messageClient(messageText, client, colour);
}
// ===========================================================================

View File

@@ -37,7 +37,15 @@ function messagePlayerNormal(client, messageText, colour = COLOUR_WHITE) {
// logToConsole(LOG_INFO, `${removeColoursInMessage(messageText)}`);
//}
sendChatBoxMessageToPlayer(client, messageText, colour);
messageText = replaceColoursInMessage(messageText);
if(client == null) {
message(messageText, colour);
} else {
messageClient(messageText, client, colour);
}
//sendChatBoxMessageToPlayer(client, messageText, colour);
return true;
}