startgame order and lobby changes

This commit is contained in:
alzeih
2010-07-25 21:31:17 +12:00
parent 4650642311
commit 26b5fbe9bb
4 changed files with 35 additions and 10 deletions

View File

@@ -83,6 +83,15 @@ namespace OpenRA.Widgets.Delegates
Game.Disconnect();
return true;
};
var startGameButton = lobby.GetWidget("START_GAME_BUTTON");
startGameButton.OnMouseUp = mi =>
{
mapButton.Visible = false;
Game.IssueOrder(Order.Command("startgame"));
return true;
};
startGameButton.IsVisible = () => Game.IsHost && Game.LobbyInfo.Clients.All(c => c.State == Session.ClientState.Ready);
var lockTeamsCheckbox = lobby.GetWidget<CheckboxWidget>("LOCKTEAMS_CHECKBOX");
lockTeamsCheckbox.IsVisible = () => true;
@@ -347,9 +356,6 @@ namespace OpenRA.Widgets.Delegates
bool CycleReady(MouseInput mi)
{
//HACK: Can't set this as part of the fuction as LocalClient/State not initalised yet
Widget.RootWidget.GetWidget("SERVER_LOBBY").GetWidget<ButtonWidget>("CHANGEMAP_BUTTON").Visible
= (Game.IsHost && Game.LocalClient.State == Session.ClientState.Ready);
Game.IssueOrder(Order.Command("ready"));
return true;
}