diff --git a/OpenRA.Game/Widgets/BackgroundWidget.cs b/OpenRA.Game/Widgets/BackgroundWidget.cs index 4e59de80a4..7f8e8674c7 100644 --- a/OpenRA.Game/Widgets/BackgroundWidget.cs +++ b/OpenRA.Game/Widgets/BackgroundWidget.cs @@ -31,7 +31,7 @@ namespace OpenRA.Widgets return; } - WidgetUtils.DrawPanel(Background, Bounds, null); + WidgetUtils.DrawPanel(Background, Bounds); base.Draw(world); } } diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index 026c8fbfcb..316ecf4746 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -70,7 +70,7 @@ namespace OpenRA.Widgets } var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0); - WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", Bounds, null); + WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", Bounds); Game.chrome.renderer.BoldFont.DrawText(Text, new int2(Bounds.X + Bounds.Width / 2, Bounds.Y + Bounds.Height / 2) diff --git a/OpenRA.Game/Widgets/CheckboxWidget.cs b/OpenRA.Game/Widgets/CheckboxWidget.cs index ad3fc30a89..3415afc2ee 100644 --- a/OpenRA.Game/Widgets/CheckboxWidget.cs +++ b/OpenRA.Game/Widgets/CheckboxWidget.cs @@ -36,10 +36,8 @@ namespace OpenRA.Widgets return; } - WidgetUtils.DrawPanel("dialog3", - new Rectangle(Bounds.Location, - new Size(Bounds.Height, Bounds.Height)), - () => { }); + WidgetUtils.DrawPanel("dialog3", new Rectangle(Bounds.Location, + new Size(Bounds.Height, Bounds.Height))); Game.chrome.renderer.BoldFont.DrawText(Text, new float2(Bounds.Left + Bounds.Height * 2, Bounds.Top), Color.White); diff --git a/OpenRA.Game/Widgets/PostGameWidget.cs b/OpenRA.Game/Widgets/PostGameWidget.cs index 53d896cd24..f0b42aff41 100644 --- a/OpenRA.Game/Widgets/PostGameWidget.cs +++ b/OpenRA.Game/Widgets/PostGameWidget.cs @@ -35,7 +35,7 @@ namespace OpenRA.Widgets (Game.viewport.Width - size.X - 40) / 2, (Game.viewport.Height - size.Y - 10) / 2, size.X + 40, - size.Y + 13), null); + size.Y + 13)); Game.chrome.renderer.TitleFont.DrawText(s, new float2((Game.viewport.Width - size.X) / 2, diff --git a/OpenRA.Game/Widgets/WidgetUtils.cs b/OpenRA.Game/Widgets/WidgetUtils.cs index 88f51b0a56..a127d801fe 100644 --- a/OpenRA.Game/Widgets/WidgetUtils.cs +++ b/OpenRA.Game/Widgets/WidgetUtils.cs @@ -43,7 +43,7 @@ namespace OpenRA.Widgets Game.chrome.renderer.WorldSpriteRenderer.DrawSprite(s,pos,"chrome"); } - public static void DrawPanel(string collection, Rectangle Bounds, Action a) + public static void DrawPanel(string collection, Rectangle Bounds) { var images = new[] { "border-t", "border-b", "border-l", "border-r", "corner-tl", "corner-tr", "corner-bl", "corner-br", "background" }; var ss = images.Select(i => ChromeProvider.GetImage(Game.chrome.renderer, collection, i)).ToArray(); @@ -82,8 +82,6 @@ namespace OpenRA.Widgets DrawRGBA(ss[5], new float2(Bounds.Right - ss[5].size.X, Bounds.Top)); DrawRGBA(ss[6], new float2(Bounds.Left, Bounds.Bottom - ss[6].size.Y)); DrawRGBA(ss[7], new float2(Bounds.Right - ss[7].size.X, Bounds.Bottom - ss[7].size.Y)); - - if (a != null) a(); } public static void FillRectWithSprite(Rectangle r, Sprite s)