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

@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
[ObjectCreator.UseCtor]
public MainMenuButtonsDelegate([ObjectCreator.Param] Widget widget)
{
Game.modData.WidgetLoader.LoadWidget( new Dictionary<string,object>(), Widget.RootWidget, "PERF_BG" );
Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "PERF_BG" );
widget.GetWidget("MAINMENU_BUTTON_JOIN").OnMouseUp = mi => { Widget.OpenWindow("JOINSERVER_BG"); return true; };
widget.GetWidget("MAINMENU_BUTTON_CREATE").OnMouseUp = mi => { Widget.OpenWindow("CREATESERVER_BG"); return true; };
widget.GetWidget("MAINMENU_BUTTON_SETTINGS").OnMouseUp = mi => { Widget.OpenWindow("SETTINGS_MENU"); return true; };
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Widgets.Delegates
public static void DisplayModSelector()
{
var selector = Game.modData.WidgetLoader.LoadWidget( new Dictionary<string,object>(), Widget.RootWidget, "QUICKMODSWITCHER" );
var selector = Game.modData.WidgetLoader.LoadWidget( new WidgetArgs(), Widget.RootWidget, "QUICKMODSWITCHER" );
var switcher = selector.GetWidget<ButtonWidget>("SWITCHER");
switcher.OnMouseDown = _ => ShowModsDropDown(switcher);
switcher.GetText = ActiveModTitle;