Convert remaining buttons and checkboxes to cnc variants

This commit is contained in:
Paul Chote
2011-05-07 22:42:17 +12:00
parent 1e66d57ef1
commit dded6040d6
3 changed files with 25 additions and 16 deletions

View File

@@ -464,9 +464,9 @@ namespace OpenRA.Mods.Cnc.Widgets
team.OnMouseDown = _ => ShowTeamDropDown(team);
team.GetText = () => (c.Team == 0) ? "-" : c.Team.ToString();
var status = template.GetWidget<CheckboxWidget>("STATUS");
var status = template.GetWidget<CncCheckboxWidget>("STATUS");
status.IsChecked = () => c.State == Session.ClientState.Ready;
status.OnChange += CycleReady;
status.OnClick += CycleReady;
var spectator = template.GetWidget<LabelWidget>("SPECTATOR");
@@ -496,10 +496,10 @@ namespace OpenRA.Mods.Cnc.Widgets
var team = template.GetWidget<LabelWidget>("TEAM");
team.GetText = () => (c.Team == 0) ? "-" : c.Team.ToString();
var status = template.GetWidget<CheckboxWidget>("STATUS");
var status = template.GetWidget<CncCheckboxWidget>("STATUS");
status.IsChecked = () => c.State == Session.ClientState.Ready;
if (c.Index == orderManager.LocalClient.Index)
status.OnChange += CycleReady;
status.OnClick += CycleReady;
var spectator = template.GetWidget<LabelWidget>("SPECTATOR");
@@ -528,7 +528,7 @@ namespace OpenRA.Mods.Cnc.Widgets
bool SpawnPointAvailable(int index) { return (index == 0) || orderManager.LobbyInfo.Clients.All(c => c.SpawnPoint != index); }
void CycleReady(bool ready)
void CycleReady()
{
orderManager.IssueOrder(Order.Command("ready"));
}