diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/index.html b/gemp-lotr/gemp-lotr-web/src/main/webapp/index.html index 0a47b655c..344e50b68 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/index.html +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/index.html @@ -20,6 +20,15 @@ .tablePlayer { text-align: center; } + + .chatMessage { + color: #000000; + } + + .warningMessage { + color: #ff0000; + } + @@ -64,10 +73,10 @@ var participantId = getUrlParam("participantId"); $("#user").append("You are logged in as " + participantId + ", create a table or join one where other player is waiting."); - var hall = new GempLotrHallUI($("#hall"), "/gemp-lotr/server"); - var chat = new ChatBoxUI("default", $("#chat"), "/gemp-lotr/server"); chat.setBounds(2, 2, 780 - 4, 200 - 4); + + var hall = new GempLotrHallUI($("#hall"), "/gemp-lotr/server", chat); } }); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js index 0a8f14140..c1b925fe3 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/chat.js @@ -7,10 +7,12 @@ var ChatBoxUI = Class.extend({ talkBoxHeight: 25, init: function(name, div, url) { + var that = this; this.name = name; this.div = div; this.communication = new GempLotrCommunication(url, function() { - alert("Chat had a problem communicating with the server, reload the page to continue"); + that.appendMessage("Chat had a problem communicating with the server, no new messages will be displayed, but your messages still might get sent.", "warningMessage"); + that.appendMessage("Reload the browser page (press F5) to resume the chat.", "warningMessage"); }); this.chatMessagesDiv = $("
"); diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js index 8de51f074..480a8af7e 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/gameUi.js @@ -392,7 +392,7 @@ var GempLotrGameUI = Class.extend({ } else if (eventType == "MESSAGE") { this.message(gameEvent); } else if (eventType == "WARNING") { - this.message(gameEvent); + this.warning(gameEvent); } } if (gameEvents.length > 0) diff --git a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/hallUi.js b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/hallUi.js index cd0a8eb77..f98c2e910 100644 --- a/gemp-lotr/gemp-lotr-web/src/main/webapp/js/hallUi.js +++ b/gemp-lotr/gemp-lotr-web/src/main/webapp/js/hallUi.js @@ -6,10 +6,11 @@ var GempLotrHallUI = Class.extend({ tablesDiv: null, - init: function(div, url) { + init: function(div, url, chat) { this.div = div; this.comm = new GempLotrCommunication(url, function() { - alert("There was a problem communicating with the server, reload this window to continue."); + chat.appendMessage("The game hall had a problem communication with the server, no new updates will be displayed.", "warningMessage"); + chat.appendMessage("Reload the browser page (press F5) to resume the game hall functionality.", "warningMessage"); }); var width = $(div).width();