Disconnect button in lobby (#191)

This commit is contained in:
Paul Chote
2010-05-26 21:39:06 +12:00
parent 49b1870eaa
commit c792ce5686
3 changed files with 16 additions and 3 deletions

View File

@@ -170,8 +170,8 @@ namespace OpenRA
var h = 600; var h = 600;
var r = new Rectangle( (Game.viewport.Width - w) / 2, (Game.viewport.Height - h) / 2, w, h ); var r = new Rectangle( (Game.viewport.Width - w) / 2, (Game.viewport.Height - h) / 2, w, h );
var typingBox = new Rectangle(r.Left + 20, r.Bottom - 47, r.Width - 40, 27); var typingBox = new Rectangle(r.Left + 20, r.Bottom - 77, r.Width - 40, 27);
var chatBox = new Rectangle(r.Left + 20, r.Bottom - 269, r.Width - 40, 220); var chatBox = new Rectangle(r.Left + 20, r.Bottom - 269, r.Width - 40, 190);
DrawDialogBackground(typingBox, "dialog2"); DrawDialogBackground(typingBox, "dialog2");
DrawDialogBackground(chatBox, "dialog3"); DrawDialogBackground(chatBox, "dialog3");

View File

@@ -44,9 +44,14 @@ namespace OpenRA.Widgets.Delegates
r.OpenWindow("MAP_CHOOSER"); r.OpenWindow("MAP_CHOOSER");
return true; return true;
}; };
mapButton.IsVisible = () => mapButton.Visible && Game.IsHost; mapButton.IsVisible = () => mapButton.Visible && Game.IsHost;
var disconnectButton = lobby.GetWidget("DISCONNECT_BUTTON");
disconnectButton.OnMouseUp = mi => {
Game.Disconnect();
return true;
};
Game.LobbyInfoChanged += UpdatePlayerList; Game.LobbyInfoChanged += UpdatePlayerList;
} }

View File

@@ -474,6 +474,14 @@ Container:
Width:120 Width:120
Height:25 Height:25
Text:Change Map Text:Change Map
Button@DISCONNECT_BUTTON:
Id:DISCONNECT_BUTTON
Visible:true
X:PARENT_RIGHT-140
Y:PARENT_BOTTOM-43
Width:120
Height:25
Text:Disconnect
Background@MAP_CHOOSER: Background@MAP_CHOOSER:
Id:MAP_CHOOSER Id:MAP_CHOOSER
X:(WINDOW_RIGHT - WIDTH)/2 X:(WINDOW_RIGHT - WIDTH)/2