Let panels handle closing themselves

This commit is contained in:
Paul Chote
2011-05-12 20:14:23 +12:00
parent 5fffc9d816
commit 61facc7bb1
11 changed files with 34 additions and 42 deletions

View File

@@ -45,8 +45,8 @@ namespace OpenRA.Mods.Cnc.Widgets
panel.GetWidget<LabelWidget>("CURMAP_THEATER").GetText = () => Rules.TileSets[map.Tileset].Name;
panel.GetWidget<LabelWidget>("CURMAP_PLAYERS").GetText = () => map.PlayerCount.ToString();
panel.GetWidget<CncMenuButtonWidget>("BUTTON_OK").OnClick = () => onSelect(map);
panel.GetWidget<CncMenuButtonWidget>("BUTTON_CANCEL").OnClick = onExit;
panel.GetWidget<CncMenuButtonWidget>("BUTTON_OK").OnClick = () => { Widget.CloseWindow(); onSelect(map); };
panel.GetWidget<CncMenuButtonWidget>("BUTTON_CANCEL").OnClick = () => { Widget.CloseWindow(); onExit(); };
panel.GetWidget<CncMenuButtonWidget>("BUTTON_INSTALL").IsDisabled = () => true;
panel.GetWidget<CncMenuButtonWidget>("BUTTON_INSTALL").OnClick = () => InstallMap();