diff --git a/OpenRA.Game/Widgets/DropDownButtonWidget.cs b/OpenRA.Game/Widgets/DropDownButtonWidget.cs index f91e06e0ac..3d6e510e77 100644 --- a/OpenRA.Game/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Game/Widgets/DropDownButtonWidget.cs @@ -84,66 +84,6 @@ namespace OpenRA.Widgets Widget.RootWidget.AddChild(panel); } - [Obsolete] public static void ShowDropPanel(Widget w, Widget panel, IEnumerable dismissAfter, Func onDismiss) - { - // Mask to prevent any clicks from being sent to other widgets - var fullscreenMask = new ContainerWidget(); - fullscreenMask.Bounds = new Rectangle(0, 0, Game.viewport.Width, Game.viewport.Height); - Widget.RootWidget.AddChild(fullscreenMask); - - Action HideDropDown = () => - { - Widget.RootWidget.RemoveChild(fullscreenMask); - Widget.RootWidget.RemoveChild(panel); - }; - - HideDropDown += () => Game.BeforeGameStart -= HideDropDown; - Game.BeforeGameStart += HideDropDown; - - fullscreenMask.OnMouseDown = mi => - { - if (onDismiss()) HideDropDown(); - return true; - }; - fullscreenMask.OnMouseUp = mi => true; - - var oldBounds = panel.Bounds; - panel.Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, oldBounds.Width, oldBounds.Height); - panel.OnMouseUp = mi => true; - - foreach (var ww in dismissAfter) - { - var origMouseUp = ww.OnMouseUp; - ww.OnMouseUp = mi => { var result = origMouseUp(mi); if (onDismiss()) HideDropDown(); return result; }; - } - Widget.RootWidget.AddChild(panel); - } - - [Obsolete] public static void ShowDropDown(Widget w, IEnumerable ts, Func ft) - { - var dropDown = new ScrollPanelWidget(); - dropDown.Bounds = new Rectangle(w.RenderOrigin.X, w.RenderOrigin.Y + w.Bounds.Height, w.Bounds.Width, 100); - dropDown.ItemSpacing = 1; - - List items = new List(); - List dismissAfter = new List(); - foreach (var t in ts) - { - var ww = ft(t, dropDown.Bounds.Width - dropDown.ScrollbarWidth); - dismissAfter.Add(ww); - ww.OnMouseMove = mi => items.Do(lw => - { - lw.Background = null; ww.Background = "dialog2"; - }); - - dropDown.AddChild(ww); - items.Add(ww); - } - - dropDown.Bounds.Height = Math.Min(150, dropDown.ContentHeight); - ShowDropPanel(w, dropDown, dismissAfter, () => true); - } - public void ShowDropDown(string panelTemplate, int height, List options, Func setupItem) { var substitutions = new Dictionary() {{ "DROPDOWN_WIDTH", Bounds.Width }}; diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Game/Widgets/LabelWidget.cs index 810208690d..0d1a12eef2 100644 --- a/OpenRA.Game/Widgets/LabelWidget.cs +++ b/OpenRA.Game/Widgets/LabelWidget.cs @@ -19,7 +19,6 @@ namespace OpenRA.Widgets public enum TextAlign { Left, Center, Right } public enum TextVAlign { Top, Middle, Bottom } public string Text = null; - [Obsolete] public string Background = null; public TextAlign Align = TextAlign.Left; public TextVAlign VAlign = TextVAlign.Middle; public string Font = "Regular"; @@ -28,13 +27,11 @@ namespace OpenRA.Widgets public Color ContrastColor = Color.Black; public bool WordWrap = false; public Func GetText; - [Obsolete] public Func GetBackground; public LabelWidget() : base() { GetText = () => Text; - GetBackground = () => Background; } protected LabelWidget(LabelWidget other) @@ -48,16 +45,10 @@ namespace OpenRA.Widgets ContrastColor = other.ContrastColor; WordWrap = other.WordWrap; GetText = other.GetText; - GetBackground = other.GetBackground; } public override void DrawInner() - { - var bg = GetBackground(); - - if (bg != null) - WidgetUtils.DrawPanel(bg, RenderBounds ); - + { SpriteFont font = Game.Renderer.Fonts[Font]; var text = GetText(); if (text == null) diff --git a/mods/ra/chrome/serverbrowser.yaml b/mods/ra/chrome/serverbrowser.yaml index 02b2806ec6..81e13e9eaf 100644 --- a/mods/ra/chrome/serverbrowser.yaml +++ b/mods/ra/chrome/serverbrowser.yaml @@ -127,7 +127,6 @@ Background@JOINSERVER_BG: Y:PARENT_BOTTOM / 2 - HEIGHT Width:150 Height:30 - Background:dialog4 Text:Fetching games... Align:Center Container@SERVER_INFO: