From 83055f0a17ac06ca694f63511d0dfcd4b4a70b50 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Tue, 13 Dec 2011 22:30:51 +1300 Subject: [PATCH] convert RootWidget prop back to field, now that it has trivial get/set --- OpenRA.Game/Widgets/Widget.cs | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 16db233caf..6dbfb67803 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -19,13 +19,8 @@ namespace OpenRA.Widgets { public abstract class Widget { - public static Widget RootWidget - { - get { return rootWidget; } - set { rootWidget = value; } - } + public static Widget RootWidget = new ContainerWidget(); - static Widget rootWidget = new ContainerWidget(); static Stack WindowList = new Stack(); public static Widget SelectedWidget; public static Widget MouseOverWidget; @@ -35,7 +30,7 @@ namespace OpenRA.Widgets if (WindowList.Count > 0) RootWidget.RemoveChild(WindowList.Pop()); if (WindowList.Count > 0) - rootWidget.AddChild(WindowList.Peek()); + RootWidget.AddChild(WindowList.Peek()); } public static Widget OpenWindow(string id) @@ -45,9 +40,9 @@ namespace OpenRA.Widgets public static Widget OpenWindow(string id, WidgetArgs args) { - var window = Game.modData.WidgetLoader.LoadWidget(args, rootWidget, id); + var window = Game.modData.WidgetLoader.LoadWidget(args, RootWidget, id); if (WindowList.Count > 0) - rootWidget.RemoveChild(WindowList.Peek()); + RootWidget.RemoveChild(WindowList.Peek()); WindowList.Push(window); return window; }