From 8f8805bb71666f592c97975fa9cd53bc85822c66 Mon Sep 17 00:00:00 2001 From: Christian 'ketura' McCarty Date: Sun, 24 Nov 2024 14:35:53 -0600 Subject: [PATCH] Reworking game UI startup so that game chat is always loaded after the game message log upon reload --- .../src/main/web/js/gemp-022/chat.js | 13 ++++++++----- .../src/main/web/js/gemp-022/gameUi.js | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js index 1b1c8f6af..6fdd2916a 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/chat.js @@ -168,11 +168,6 @@ var ChatBoxUI = Class.extend({ this.div.append(this.chatTalkDiv); - this.comm.startChat(this.name, - function (xml) { - that.processMessages(xml, true); - }, this.chatErrorMap()); - this.chatTalkDiv.bind("keypress", function (e) { var code = (e.keyCode ? e.keyCode : e.which); if (code == 13) { @@ -189,6 +184,14 @@ var ChatBoxUI = Class.extend({ } }, + beginGameChat:function() { + var that = this; + this.comm.startChat(this.name, + function (xml) { + that.processMessages(xml, true); + }, this.chatErrorMap()); + }, + initPlayerInfo:function (playerInfo) { this.userInfo = playerInfo; this.userName = this.userInfo.name; diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js index be9b75357..41148259a 100644 --- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js +++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/gameUi.js @@ -1132,6 +1132,7 @@ var GempLotrGameUI = Class.extend({ this.communication.startGameSession( function (xml) { that.processXml(xml, false); + that.chatBox.beginGameChat(); }, this.gameErrorMap()); },