Added "return to menu" button to disconnected screen
Show the name of the player that left (if not the host) This was SVN commit r7926.
This commit is contained in:
parent
f0a0c69770
commit
e831cac647
@ -1,5 +1,5 @@
|
||||
// Chat data
|
||||
const CHAT_TIMEOUT = 30000;
|
||||
const CHAT_TIMEOUT = 45000;
|
||||
const MAX_NUM_CHAT_LINES = 20;
|
||||
var chatMessages = [];
|
||||
var chatTimers = [];
|
||||
@ -25,6 +25,7 @@ function handleNetMessage(message)
|
||||
case "disconnected":
|
||||
obj.caption = "Connection to the server has been lost";
|
||||
obj.hidden = false;
|
||||
getGUIObjectByName("disconnectedExitButton").hidden = false;
|
||||
// TODO: we need to give players some way to exit
|
||||
break;
|
||||
default:
|
||||
@ -35,8 +36,15 @@ function handleNetMessage(message)
|
||||
case "players":
|
||||
// Find and report all leavings
|
||||
for (var host in g_PlayerAssignments)
|
||||
{
|
||||
if (! message.hosts[host])
|
||||
addChatMessage({ "type": "disconnect", "username": g_PlayerAssignments[host].name });
|
||||
{
|
||||
var obj = getGUIObjectByName("netStatus");
|
||||
obj.caption = g_PlayerAssignments[host].name + " has left\n\nConnection to the server has been lost";
|
||||
obj.hidden = false;
|
||||
getGUIObjectByName("disconnectedExitButton").hidden = false;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case "chat":
|
||||
addChatMessage({ "type": "message", "username": message.username, "text": message.text });
|
||||
|
@ -131,13 +131,13 @@
|
||||
<!-- ================================ ================================ -->
|
||||
|
||||
<!-- Chat panel -->
|
||||
<object name="chatPanel" size="0 100 512 100%-240" type="image" ghost="true">
|
||||
<object name="chatPanel" size="0 80 100% 100%-240" type="image" ghost="true">
|
||||
<object name="chatText" size="3 1 100%-1 100%-1" type="text" style="chatPanel" ghost="true"/>
|
||||
</object>
|
||||
|
||||
<!-- Chat window -->
|
||||
<object name="chatWindow" size="50%-200 50%-13 50%+200 50%+13" type="image" hidden="true" z="10" style="sessionPanelStyle">
|
||||
<object name="chatInput" size="2 2 100%-66 100%-2" type="input" style="wheatInput" max_length="40">
|
||||
<object name="chatInput" size="2 2 100%-66 100%-2" type="input" style="wheatInput" max_length="80">
|
||||
<action on="Press">submitChatInput();</action>
|
||||
</object>
|
||||
|
||||
@ -525,6 +525,19 @@
|
||||
<!-- ================================ ================================ -->
|
||||
<!-- Network status -->
|
||||
<!-- ================================ ================================ -->
|
||||
<object name="netStatus" type="text" style="netStatus" z="100" hidden="true"/>
|
||||
<object name="netStatus" type="text" style="netStatus" z="100" hidden="true">
|
||||
<object type="button"
|
||||
name="disconnectedExitButton"
|
||||
style="wheatButtonFancy"
|
||||
size="50%-84 50%+128 50%+84 50%+160"
|
||||
tooltip_style="snToolTip"
|
||||
hidden="true"
|
||||
>
|
||||
<object size="0 0 100% 100%" type="text" style="centeredText" name="disconnectedExitButtonText" ghost="true" font="serif-14">Return to Main Menu</object>
|
||||
<action on="Press">leaveGame()</action>
|
||||
</object>
|
||||
|
||||
</object>
|
||||
|
||||
|
||||
</objects>
|
||||
|
Loading…
Reference in New Issue
Block a user