diff --git a/OpenRA.Game/InputHandler.cs b/OpenRA.Game/InputHandler.cs index 93d963e50c..5f9339be0d 100755 --- a/OpenRA.Game/InputHandler.cs +++ b/OpenRA.Game/InputHandler.cs @@ -37,7 +37,7 @@ namespace OpenRA { Sync.CheckSyncUnchanged( world, () => { - Widget.HandleKeyPress( input ); + Widget.DoHandleKeyPress( input ); } ); } @@ -45,7 +45,7 @@ namespace OpenRA { Sync.CheckSyncUnchanged( world, () => { - Widget.HandleInput( input ); + Widget.DoHandleInput( input ); } ); } } diff --git a/OpenRA.Game/Widgets/BackgroundWidget.cs b/OpenRA.Game/Widgets/BackgroundWidget.cs index f1a9cd4167..da6d30c141 100644 --- a/OpenRA.Game/Widgets/BackgroundWidget.cs +++ b/OpenRA.Game/Widgets/BackgroundWidget.cs @@ -15,7 +15,7 @@ namespace OpenRA.Widgets public readonly string Background = "dialog"; public readonly bool ClickThrough = false; - public override void DrawInner() + public override void Draw() { WidgetUtils.DrawPanel(Background, RenderBounds); } diff --git a/OpenRA.Game/Widgets/ButtonWidget.cs b/OpenRA.Game/Widgets/ButtonWidget.cs index 010cf34340..d118aab5ed 100644 --- a/OpenRA.Game/Widgets/ButtonWidget.cs +++ b/OpenRA.Game/Widgets/ButtonWidget.cs @@ -59,7 +59,7 @@ namespace OpenRA.Widgets return base.LoseFocus(mi); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.KeyName != Key || e.Event != KeyInputEvent.Down) return false; @@ -107,7 +107,7 @@ namespace OpenRA.Widgets public override int2 ChildOrigin { get { return RenderOrigin + ((Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0)); } } - public override void DrawInner() + public override void Draw() { var rb = RenderBounds; var disabled = IsDisabled(); diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Game/Widgets/ChatDisplayWidget.cs index ef3e10fb21..e9cef33a35 100644 --- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs +++ b/OpenRA.Game/Widgets/ChatDisplayWidget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Widgets : base(widget) { } public override Rectangle EventBounds { get { return Rectangle.Empty; } } - public override void DrawInner() + public override void Draw() { var pos = RenderOrigin; var chatLogArea = new Rectangle(pos.X, pos.Y, Bounds.Width, Bounds.Height); diff --git a/OpenRA.Game/Widgets/ChatEntryWidget.cs b/OpenRA.Game/Widgets/ChatEntryWidget.cs index 66bc4557aa..9ef4f19ed2 100755 --- a/OpenRA.Game/Widgets/ChatEntryWidget.cs +++ b/OpenRA.Game/Widgets/ChatEntryWidget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Widgets this.orderManager = orderManager; } - public override void DrawInner() + public override void Draw() { if (composing) { @@ -51,7 +51,7 @@ namespace OpenRA.Widgets return composing ? false : base.LoseFocus(mi); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.Event == KeyInputEvent.Up) return false; @@ -108,7 +108,7 @@ namespace OpenRA.Widgets return false; } - return base.HandleKeyPressInner(e); + return false; } } } diff --git a/OpenRA.Game/Widgets/CheckboxWidget.cs b/OpenRA.Game/Widgets/CheckboxWidget.cs index 551682abef..c08e0cb3f4 100644 --- a/OpenRA.Game/Widgets/CheckboxWidget.cs +++ b/OpenRA.Game/Widgets/CheckboxWidget.cs @@ -41,7 +41,7 @@ namespace OpenRA.Widgets HasPressedState = other.HasPressedState; } - public override void DrawInner() + public override void Draw() { var disabled = IsDisabled(); var font = Game.Renderer.Fonts[Font]; diff --git a/OpenRA.Game/Widgets/ColorBlockWidget.cs b/OpenRA.Game/Widgets/ColorBlockWidget.cs index 604d26ac17..c6bcbccf49 100644 --- a/OpenRA.Game/Widgets/ColorBlockWidget.cs +++ b/OpenRA.Game/Widgets/ColorBlockWidget.cs @@ -34,7 +34,7 @@ namespace OpenRA.Widgets return new ColorBlockWidget(this); } - public override void DrawInner() + public override void Draw() { WidgetUtils.FillRectWithColor(RenderBounds, GetColor()); } diff --git a/OpenRA.Game/Widgets/DropDownButtonWidget.cs b/OpenRA.Game/Widgets/DropDownButtonWidget.cs index 681ae0eea6..b9c11b1012 100644 --- a/OpenRA.Game/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Game/Widgets/DropDownButtonWidget.cs @@ -30,9 +30,9 @@ namespace OpenRA.Widgets { } - public override void DrawInner() + public override void Draw() { - base.DrawInner(); + base.Draw(); var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0); var image = ChromeProvider.GetImage("scrollbar", IsDisabled() ? "down_pressed" : "down_arrow"); @@ -130,7 +130,6 @@ namespace OpenRA.Widgets return true; } - public override void DrawInner() { } public override string GetCursor(int2 pos) { return null; } public override Widget Clone() { return new MaskWidget(this); } } diff --git a/OpenRA.Game/Widgets/ImageWidget.cs b/OpenRA.Game/Widgets/ImageWidget.cs index 72a667b3f8..594beb69a4 100644 --- a/OpenRA.Game/Widgets/ImageWidget.cs +++ b/OpenRA.Game/Widgets/ImageWidget.cs @@ -38,7 +38,7 @@ namespace OpenRA.Widgets public override Widget Clone() { return new ImageWidget(this); } - public override void DrawInner() + public override void Draw() { var name = GetImageName(); var collection = GetImageCollection(); diff --git a/OpenRA.Game/Widgets/LabelWidget.cs b/OpenRA.Game/Widgets/LabelWidget.cs index 2353a3a019..8377557bd8 100644 --- a/OpenRA.Game/Widgets/LabelWidget.cs +++ b/OpenRA.Game/Widgets/LabelWidget.cs @@ -53,7 +53,7 @@ namespace OpenRA.Widgets GetContrastColor = other.GetContrastColor; } - public override void DrawInner() + public override void Draw() { SpriteFont font = Game.Renderer.Fonts[Font]; var text = GetText(); diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Game/Widgets/MapPreviewWidget.cs index 9526d76844..8d026c8d6f 100644 --- a/OpenRA.Game/Widgets/MapPreviewWidget.cs +++ b/OpenRA.Game/Widgets/MapPreviewWidget.cs @@ -54,7 +54,7 @@ namespace OpenRA.Widgets Rectangle MapRect; float PreviewScale = 0; - public override void DrawInner() + public override void Draw() { var map = Map(); if( map == null ) return; diff --git a/OpenRA.Game/Widgets/PerfGraphWidget.cs b/OpenRA.Game/Widgets/PerfGraphWidget.cs index 9eae321d48..498feb31a0 100644 --- a/OpenRA.Game/Widgets/PerfGraphWidget.cs +++ b/OpenRA.Game/Widgets/PerfGraphWidget.cs @@ -18,7 +18,7 @@ namespace OpenRA.Widgets { public PerfGraphWidget() : base() { } - public override void DrawInner() + public override void Draw() { var rect = RenderBounds; float2 origin = Game.viewport.Location + new float2(rect.Right, rect.Bottom); diff --git a/OpenRA.Game/Widgets/ProgressBarWidget.cs b/OpenRA.Game/Widgets/ProgressBarWidget.cs index 914fc12807..cde32cc8ea 100644 --- a/OpenRA.Game/Widgets/ProgressBarWidget.cs +++ b/OpenRA.Game/Widgets/ProgressBarWidget.cs @@ -29,7 +29,7 @@ namespace OpenRA.Widgets Percentage = widget.Percentage; } - public override void DrawInner() + public override void Draw() { var rb = RenderBounds; WidgetUtils.DrawPanel("progressbar-bg", rb); diff --git a/OpenRA.Game/Widgets/ScrollItem.cs b/OpenRA.Game/Widgets/ScrollItem.cs index c3799cf51a..e3ea0aea3b 100644 --- a/OpenRA.Game/Widgets/ScrollItem.cs +++ b/OpenRA.Game/Widgets/ScrollItem.cs @@ -32,7 +32,7 @@ namespace OpenRA.Widgets public Func IsSelected = () => false; - public override void DrawInner() + public override void Draw() { var state = IsSelected() ? "scrollitem-selected" : RenderBounds.Contains(Viewport.LastMousePos) ? "scrollitem-hover" : diff --git a/OpenRA.Game/Widgets/ScrollPanelWidget.cs b/OpenRA.Game/Widgets/ScrollPanelWidget.cs index e4a1f05391..7aeb31c0ad 100644 --- a/OpenRA.Game/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Game/Widgets/ScrollPanelWidget.cs @@ -56,8 +56,7 @@ namespace OpenRA.Widgets base.AddChild(child); } - public override void DrawInner() {} - public override void Draw() + public override void DrawOuter() { if (!IsVisible()) return; @@ -101,7 +100,7 @@ namespace OpenRA.Widgets Game.Renderer.EnableScissor(backgroundRect.X + 1, backgroundRect.Y + 1, backgroundRect.Width - 2, backgroundRect.Height - 2); foreach (var child in Children) - child.Draw(); + child.DrawOuter(); Game.Renderer.DisableScissor(); } diff --git a/OpenRA.Game/Widgets/ScrollingTextWidget.cs b/OpenRA.Game/Widgets/ScrollingTextWidget.cs index 580cc03ea2..aa74ab01a5 100755 --- a/OpenRA.Game/Widgets/ScrollingTextWidget.cs +++ b/OpenRA.Game/Widgets/ScrollingTextWidget.cs @@ -96,7 +96,7 @@ namespace OpenRA.Widgets Text = Text.Replace("\r", ""); } - public override void DrawInner() + public override void Draw() { var bg = GetBackground(); diff --git a/OpenRA.Game/Widgets/ShpImageWidget.cs b/OpenRA.Game/Widgets/ShpImageWidget.cs index 216aaf4217..96fab8f71f 100644 --- a/OpenRA.Game/Widgets/ShpImageWidget.cs +++ b/OpenRA.Game/Widgets/ShpImageWidget.cs @@ -52,7 +52,7 @@ namespace OpenRA.Widgets Sprite sprite = null; string cachedImage = null; int cachedFrame= -1; - public override void DrawInner() + public override void Draw() { var image = GetImage(); var frame = GetFrame(); diff --git a/OpenRA.Game/Widgets/SliderWidget.cs b/OpenRA.Game/Widgets/SliderWidget.cs index 1a2b9f8ff7..1288e9b7f1 100755 --- a/OpenRA.Game/Widgets/SliderWidget.cs +++ b/OpenRA.Game/Widgets/SliderWidget.cs @@ -174,7 +174,7 @@ namespace OpenRA.Widgets } } - public override void DrawInner() + public override void Draw() { if (!IsVisible()) return; diff --git a/OpenRA.Game/Widgets/TextFieldWidget.cs b/OpenRA.Game/Widgets/TextFieldWidget.cs index 9baae3ace4..b8748e5136 100644 --- a/OpenRA.Game/Widgets/TextFieldWidget.cs +++ b/OpenRA.Game/Widgets/TextFieldWidget.cs @@ -104,7 +104,7 @@ namespace OpenRA.Widgets return minIndex; } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (IsDisabled()) return false; @@ -189,11 +189,9 @@ namespace OpenRA.Widgets blinkCycle = 20; showCursor ^= true; } - - base.Tick(); } - public override void DrawInner() + public override void Draw() { var apparentText = GetApparentText(); var font = Game.Renderer.Fonts[Font]; diff --git a/OpenRA.Game/Widgets/TimerWidget.cs b/OpenRA.Game/Widgets/TimerWidget.cs index aca410290b..9ad267d181 100644 --- a/OpenRA.Game/Widgets/TimerWidget.cs +++ b/OpenRA.Game/Widgets/TimerWidget.cs @@ -22,7 +22,7 @@ namespace OpenRA.Widgets IsVisible = () => Game.Settings.Game.MatchTimer; } - public override void DrawInner() + public override void Draw() { var s = WidgetUtils.FormatTime(Game.LocalTick); var size = Game.Renderer.Fonts["Title"].Measure(s); diff --git a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs index 5988e6d472..93f2a1f87a 100755 --- a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs @@ -32,7 +32,6 @@ namespace OpenRA.Widgets public ViewportScrollControllerWidget() : base() { } protected ViewportScrollControllerWidget(ViewportScrollControllerWidget widget) : base(widget) {} - public override void DrawInner() {} public override bool HandleMouseInput(MouseInput mi) { @@ -114,7 +113,7 @@ namespace OpenRA.Widgets return base.LoseFocus(mi); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { switch (e.KeyName) { diff --git a/OpenRA.Game/Widgets/VqaPlayerWidget.cs b/OpenRA.Game/Widgets/VqaPlayerWidget.cs index b1058673bc..874a43c3bf 100644 --- a/OpenRA.Game/Widgets/VqaPlayerWidget.cs +++ b/OpenRA.Game/Widgets/VqaPlayerWidget.cs @@ -76,7 +76,7 @@ namespace OpenRA.Widgets overlaySprite.sheet.Texture.SetData(overlay); } - public override void DrawInner() + public override void Draw() { if (video == null) return; @@ -104,7 +104,7 @@ namespace OpenRA.Widgets Game.Renderer.RgbaSpriteRenderer.DrawSprite(overlaySprite, videoOrigin, videoSize); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.Event == KeyInputEvent.Down) { diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 50ff9765b4..ec08e5ae84 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -29,33 +29,6 @@ namespace OpenRA.Widgets static Stack WindowList = new Stack(); public static Widget SelectedWidget; - public static bool HandleInput(MouseInput mi) - { - bool handled = false; - if (SelectedWidget != null && SelectedWidget.HandleMouseInputOuter(mi)) - handled = true; - - if (!handled && RootWidget.HandleMouseInputOuter(mi)) - handled = true; - - if (mi.Event == MouseInputEvent.Move) - { - Viewport.LastMousePos = mi.Location; - Viewport.TicksSinceLastMove = 0; - } - return handled; - } - - public static bool HandleKeyPress(KeyInput e) - { - if (SelectedWidget != null) - return SelectedWidget.HandleKeyPressOuter(e); - - if (RootWidget.HandleKeyPressOuter(e)) - return true; - return false; - } - public static void CloseWindow() { if (WindowList.Count > 0) @@ -85,12 +58,39 @@ namespace OpenRA.Widgets public static void DoTick() { - RootWidget.Tick(); + RootWidget.TickOuter(); } public static void DoDraw() { - RootWidget.Draw(); + RootWidget.DrawOuter(); + } + + public static bool DoHandleInput(MouseInput mi) + { + bool handled = false; + if (SelectedWidget != null && SelectedWidget.HandleMouseInputOuter(mi)) + handled = true; + + if (!handled && RootWidget.HandleMouseInputOuter(mi)) + handled = true; + + if (mi.Event == MouseInputEvent.Move) + { + Viewport.LastMousePos = mi.Location; + Viewport.TicksSinceLastMove = 0; + } + return handled; + } + + public static bool DoHandleKeyPress(KeyInput e) + { + if (SelectedWidget != null) + return SelectedWidget.HandleKeyPressOuter(e); + + if (RootWidget.HandleKeyPressOuter(e)) + return true; + return false; } public static void ResetAll() @@ -252,6 +252,7 @@ namespace OpenRA.Widgets return EventBounds.Contains(pos) ? GetCursor(pos) : null; } + public virtual bool HandleMouseInput(MouseInput mi) { return false; } public bool HandleMouseInputOuter(MouseInput mi) { // Are we able to handle this event? @@ -266,8 +267,7 @@ namespace OpenRA.Widgets return HandleMouseInput(mi); } - public virtual bool HandleMouseInput(MouseInput mi) { return false; } - public virtual bool HandleKeyPressInner(KeyInput e) { return false; } + public virtual bool HandleKeyPress(KeyInput e) { return false; } public virtual bool HandleKeyPressOuter(KeyInput e) { if (!IsVisible()) @@ -279,28 +279,31 @@ namespace OpenRA.Widgets return true; // Do any widgety behavior (enter text etc) - var handled = HandleKeyPressInner(e); + var handled = HandleKeyPress(e); return handled; } - public abstract void DrawInner(); - - public virtual void Draw() + public virtual void Draw() {} + public virtual void DrawOuter() { if (IsVisible()) { - DrawInner(); + Draw(); foreach (var child in Children) - child.Draw(); + child.DrawOuter(); } } - public virtual void Tick() + public virtual void Tick() {} + public virtual void TickOuter() { if (IsVisible()) + { + Tick(); foreach (var child in Children) - child.Tick(); + child.TickOuter(); + } } public virtual void AddChild(Widget child) @@ -308,25 +311,25 @@ namespace OpenRA.Widgets child.Parent = this; Children.Add(child); } - + public virtual void RemoveChild(Widget child) { Children.Remove(child); child.Removed(); } - + public virtual void RemoveChildren() { while (Children.Count > 0) RemoveChild(Children[Children.Count-1]); } - + public virtual void Removed() { foreach (var c in Children.OfType().Reverse()) c.Removed(); } - + public Widget GetWidget(string id) { if (this.Id == id) @@ -354,7 +357,6 @@ namespace OpenRA.Widgets public ContainerWidget(ContainerWidget other) : base(other) { } - public override void DrawInner() { } public override string GetCursor(int2 pos) { return null; } public override Widget Clone() { return new ContainerWidget(this); } } diff --git a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs index a95c88fa28..4d5bb3a0d5 100644 --- a/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs +++ b/OpenRA.Game/Widgets/WorldInteractionControllerWidget.cs @@ -31,7 +31,7 @@ namespace OpenRA.Widgets this.worldRenderer = worldRenderer; } - public override void DrawInner() + public override void Draw() { var selbox = SelectionBox; if (selbox == null) @@ -128,7 +128,7 @@ namespace OpenRA.Widgets } ); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.Event == KeyInputEvent.Down) { diff --git a/OpenRA.Mods.Cnc/Widgets/PowerBarWidget.cs b/OpenRA.Mods.Cnc/Widgets/PowerBarWidget.cs index 1447119937..19e703dfc7 100755 --- a/OpenRA.Mods.Cnc/Widgets/PowerBarWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/PowerBarWidget.cs @@ -28,7 +28,7 @@ namespace OpenRA.Mods.Cnc.Widgets pm = world.LocalPlayer.PlayerActor.Trait(); } - public override void DrawInner() + public override void Draw() { float powerScaleBy = 100; var maxPower = Math.Max(pm.PowerProvided, pm.PowerDrained); diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs index 86bbdd2dec..84e90e3a88 100755 --- a/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/ProductionPaletteWidget.cs @@ -82,8 +82,6 @@ namespace OpenRA.Mods.Cnc.Widgets if (CurrentQueue != null) RefreshIcons(); - - base.Tick(); } public override bool HandleMouseInput(MouseInput mi) @@ -171,7 +169,7 @@ namespace OpenRA.Mods.Cnc.Widgets eventBounds = Icons.Keys.Aggregate(Rectangle.Union); } - public override void DrawInner() + public override void Draw() { if (CurrentQueue == null) return; diff --git a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs index 386b036ca5..8a63971e42 100755 --- a/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/ProductionTabsWidget.cs @@ -100,7 +100,7 @@ namespace OpenRA.Mods.Cnc.Widgets IsVisible = () => queueGroup != null && Groups[queueGroup].Tabs.Count > 0; } - public override void DrawInner() + public override void Draw() { var rb = RenderBounds; leftButtonRect = new Rectangle(rb.X, rb.Y, ArrowWidth, rb.Height); @@ -180,7 +180,6 @@ namespace OpenRA.Mods.Cnc.Widgets { if (leftPressed) Scroll(1); if (rightPressed) Scroll(-1); - base.Tick(); } public override bool LoseFocus(MouseInput mi) @@ -230,7 +229,7 @@ namespace OpenRA.Mods.Cnc.Widgets return (leftPressed || rightPressed); } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.Event != KeyInputEvent.Down) return false; if (e.KeyName == "tab") diff --git a/OpenRA.Mods.Cnc/Widgets/SiloBarWidget.cs b/OpenRA.Mods.Cnc/Widgets/SiloBarWidget.cs index 7ae2123501..ac114cf9dc 100755 --- a/OpenRA.Mods.Cnc/Widgets/SiloBarWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/SiloBarWidget.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Cnc.Widgets pr = world.LocalPlayer.PlayerActor.Trait(); } - public override void DrawInner() + public override void Draw() { float scaleBy = 100; var max = Math.Max(pr.OreCapacity, pr.Ore); diff --git a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs index f6e1249293..b0af4d386a 100755 --- a/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/SupportPowersWidget.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Cnc.Widgets eventBounds = (Icons.Count == 0) ? Rectangle.Empty : Icons.Keys.Aggregate(Rectangle.Union); } - public override void DrawInner() + public override void Draw() { var overlayFont = Game.Renderer.Fonts["TinyBold"]; var holdOffset = new float2(32,24) - overlayFont.Measure("On Hold") / 2; @@ -101,7 +101,6 @@ namespace OpenRA.Mods.Cnc.Widgets public override void Tick () { - base.Tick(); RefreshIcons(); } diff --git a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs index 33524b5882..df8e3b1528 100755 --- a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs @@ -101,8 +101,6 @@ namespace OpenRA.Mods.RA.Widgets CurrentQueue = VisibleQueues.FirstOrDefault(); TickPaletteAnimation(world); - - base.Tick(); } void TickPaletteAnimation(World world) @@ -145,7 +143,7 @@ namespace OpenRA.Mods.RA.Widgets CurrentQueue = queue; } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (e.Event == KeyInputEvent.Up) return false; if (e.KeyName == "tab") @@ -175,7 +173,7 @@ namespace OpenRA.Mods.RA.Widgets return true; } - public override void DrawInner() + public override void Draw() { if (!IsVisible()) return; // todo: fix diff --git a/OpenRA.Mods.RA/Widgets/GameInitInfoWidget.cs b/OpenRA.Mods.RA/Widgets/GameInitInfoWidget.cs index 77fd3b6792..14cc0ad35d 100755 --- a/OpenRA.Mods.RA/Widgets/GameInitInfoWidget.cs +++ b/OpenRA.Mods.RA/Widgets/GameInitInfoWidget.cs @@ -21,7 +21,5 @@ namespace OpenRA.Mods.RA.Widgets public string InstallMode = ""; public string ResolvedPackagePath { get { return PackagePath.Replace("^", Platform.SupportDir); } } - - public override void DrawInner() {} } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Widgets/MoneyBinWidget.cs b/OpenRA.Mods.RA/Widgets/MoneyBinWidget.cs index 710a89cfaa..8291f10d2f 100755 --- a/OpenRA.Mods.RA/Widgets/MoneyBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/MoneyBinWidget.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Widgets this.world = world; } - public override void DrawInner() + public override void Draw() { if( world.LocalPlayer == null ) return; diff --git a/OpenRA.Mods.RA/Widgets/OrderButtonWidget.cs b/OpenRA.Mods.RA/Widgets/OrderButtonWidget.cs index 6fbc08892c..da9624dacb 100755 --- a/OpenRA.Mods.RA/Widgets/OrderButtonWidget.cs +++ b/OpenRA.Mods.RA/Widgets/OrderButtonWidget.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets GetLongDesc = () => LongDesc; } - public override void DrawInner() + public override void Draw() { var image = ChromeProvider.GetImage(Image + "-button", GetImage()); var rect = new Rectangle(RenderBounds.X, RenderBounds.Y, (int)image.size.X, (int)image.size.Y); diff --git a/OpenRA.Mods.RA/Widgets/PowerBinWidget.cs b/OpenRA.Mods.RA/Widgets/PowerBinWidget.cs index 2ef5be3a49..7d052ed3a2 100755 --- a/OpenRA.Mods.RA/Widgets/PowerBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/PowerBinWidget.cs @@ -32,7 +32,7 @@ namespace OpenRA.Mods.RA.Widgets this.world = world; } - public override void DrawInner() + public override void Draw() { if( world.LocalPlayer == null ) return; diff --git a/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs b/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs index 9487a7df63..1595b5236a 100755 --- a/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs @@ -124,7 +124,7 @@ namespace OpenRA.Mods.RA.Widgets get { return new Rectangle((int)mapRect.X, (int)mapRect.Y, (int)mapRect.Width, (int)mapRect.Height);} } - public override void DrawInner() + public override void Draw() { if( world == null || world.LocalPlayer == null ) return; diff --git a/OpenRA.Mods.RA/Widgets/RadarWidget.cs b/OpenRA.Mods.RA/Widgets/RadarWidget.cs index 1756caefd8..ea3710b86b 100755 --- a/OpenRA.Mods.RA/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.RA/Widgets/RadarWidget.cs @@ -123,7 +123,7 @@ namespace OpenRA.Mods.RA.Widgets get { return new Rectangle((int)mapRect.X, (int)mapRect.Y, (int)mapRect.Width, (int)mapRect.Height);} } - public override void DrawInner() + public override void Draw() { if( world == null || world.LocalPlayer == null ) return; diff --git a/OpenRA.Mods.RA/Widgets/SidebarButtonWidget.cs b/OpenRA.Mods.RA/Widgets/SidebarButtonWidget.cs index e9f0f42b97..5c14e54685 100644 --- a/OpenRA.Mods.RA/Widgets/SidebarButtonWidget.cs +++ b/OpenRA.Mods.RA/Widgets/SidebarButtonWidget.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA this.world = widget.world; } - public override void DrawInner() + public override void Draw() { var state = Depressed ? "pressed" : RenderBounds.Contains(Viewport.LastMousePos) ? "hover" : "normal"; diff --git a/OpenRA.Mods.RA/Widgets/SpecialPowerBinWidget.cs b/OpenRA.Mods.RA/Widgets/SpecialPowerBinWidget.cs index fcf90d9804..662d8dbf93 100755 --- a/OpenRA.Mods.RA/Widgets/SpecialPowerBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/SpecialPowerBinWidget.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.RA.Widgets return false; } - public override void DrawInner() + public override void Draw() { buttons.Clear(); diff --git a/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs b/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs index 83c4e22462..8d837f6ad5 100644 --- a/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs +++ b/OpenRA.Mods.RA/Widgets/StrategicProgressWidget.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA.Widgets b.Stances[a] == Stance.Ally; } - public override void DrawInner() + public override void Draw() { if (!Initialised) Init(); diff --git a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs index 8706596a79..31f64e9953 100644 --- a/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldCommandWidget.cs @@ -35,11 +35,9 @@ namespace OpenRA.Mods.RA.Widgets OrderManager = orderManager; } - public override void DrawInner() { } - public override string GetCursor(int2 pos) { return null; } - public override bool HandleKeyPressInner(KeyInput e) + public override bool HandleKeyPress(KeyInput e) { if (World == null) return false; if (World.LocalPlayer == null) return false; diff --git a/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs b/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs index 4276be228c..10c233cc71 100755 --- a/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Widgets this.world = world; } - public override void DrawInner() + public override void Draw() { if (Viewport.TicksSinceLastMove < TooltipDelay || world == null) return;