Fix chat input being reset when others send a msg

This commit is contained in:
Vortrex
2022-04-16 21:44:56 -05:00
parent 39901a71e9
commit 6ff7860b0f

View File

@@ -49,20 +49,20 @@ function unBindChatBoxKeys() {
// =========================================================================== // ===========================================================================
function receiveChatBoxMessageFromServer(messageString, colour) { function receiveChatBoxMessageFromServer(messageString, colour) {
logToConsole(LOG_INFO, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`); logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Received chatbox message from server: ${messageString}`);
// Just in case it's hidden by auto hide // Just in case it's hidden by auto hide
setChatWindowEnabled(true); //setChatWindowEnabled(true);
let colouredString = replaceColoursInMessage(messageString); let colouredString = replaceColoursInMessage(messageString);
logToConsole(LOG_INFO, `[VRR.ChatBox]: Changed colours in string: ${colouredString}`); logToConsole(LOG_DEBUG, `[VRR.ChatBox]: Changed colours in string: ${colouredString}`);
addToChatBoxHistory(colouredString, colour);
//if(bottomMessageIndex >= chatBoxHistory.length-1) { //if(bottomMessageIndex >= chatBoxHistory.length-1) {
message(colouredString, colour); message(colouredString, colour);
bottomMessageIndex = chatBoxHistory.length-1; bottomMessageIndex = chatBoxHistory.length-1;
//} //}
addToChatBoxHistory(colouredString, colour);
chatLastUse = getCurrentUnixTimestamp(); chatLastUse = getCurrentUnixTimestamp();
} }
@@ -151,6 +151,8 @@ function processMouseWheelForChatBox(mouseId, deltaCoordinates, flipped) {
// =========================================================================== // ===========================================================================
function checkChatAutoHide() { function checkChatAutoHide() {
return false;
// Make sure chat input isn't active // Make sure chat input isn't active
if(gui.cursorEnabled) { if(gui.cursorEnabled) {
return false; return false;