Add a WidgetArgs type to work around gmcs not understanding lambda -> Action -> object.

This commit is contained in:
Paul Chote
2011-05-13 09:41:21 +12:00
parent 603379aa96
commit f4ea4c5daa
17 changed files with 85 additions and 79 deletions

View File

@@ -29,9 +29,9 @@ namespace OpenRA.Mods.Cnc.Widgets
[ObjectCreator.Param] Action continueLoading)
{
var panel = widget.GetWidget("INSTALL_PANEL");
var args = new Dictionary<string, object>()
var args = new WidgetArgs()
{
{ "continueLoading", new Action(() => { Widget.CloseWindow(); continueLoading(); }) },
{ "continueLoading", () => { Widget.CloseWindow(); continueLoading(); } },
{ "installData", installData }
};
@@ -46,11 +46,11 @@ namespace OpenRA.Mods.Cnc.Widgets
// TODO:
panel.GetWidget<CncMenuButtonWidget>("MODS_BUTTON").OnClick = () =>
{
Widget.OpenWindow("MODS_PANEL", new Dictionary<string, object>()
Widget.OpenWindow("MODS_PANEL", new WidgetArgs()
{
{ "onExit", new Action(() => {}) },
{ "onExit", () => {} },
// Close this panel
{ "onSwitch", new Action(Widget.CloseWindow) },
{ "onSwitch", Widget.CloseWindow },
});
};
}