diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index bc61fea189..fae356a275 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -112,7 +112,7 @@ namespace OpenRA using (new PerfSample("tick_time")) { lastTime += Settings.Game.Timestep; - Widget.DoTick(world); + Widget.DoTick(); if( world.GameHasStarted && world.LocalPlayer != null ) ++Viewport.TicksSinceLastMove; Sound.Tick(); diff --git a/OpenRA.Game/Widgets/ChatDisplayWidget.cs b/OpenRA.Game/Widgets/ChatDisplayWidget.cs index 9d43b6a6bb..f846089519 100644 --- a/OpenRA.Game/Widgets/ChatDisplayWidget.cs +++ b/OpenRA.Game/Widgets/ChatDisplayWidget.cs @@ -75,7 +75,7 @@ namespace OpenRA.Widgets recentLines = new List(); } - public override void Tick (World world) + public override void Tick() { if (RemoveTime == 0) return; if (--ticksUntilRemove > 0) return; diff --git a/OpenRA.Game/Widgets/ListBoxWidget.cs b/OpenRA.Game/Widgets/ListBoxWidget.cs index f790646e1b..82f2fece67 100644 --- a/OpenRA.Game/Widgets/ListBoxWidget.cs +++ b/OpenRA.Game/Widgets/ListBoxWidget.cs @@ -86,7 +86,7 @@ namespace OpenRA.Widgets return EventBounds; } - public override void Tick (World world) + public override void Tick () { if (UpPressed && ListOffset <= 0) ListOffset += ScrollVelocity; if (DownPressed) ListOffset -= ScrollVelocity; diff --git a/OpenRA.Game/Widgets/ScrollingTextWidget.cs b/OpenRA.Game/Widgets/ScrollingTextWidget.cs index 3b490e9d3e..d56499038f 100755 --- a/OpenRA.Game/Widgets/ScrollingTextWidget.cs +++ b/OpenRA.Game/Widgets/ScrollingTextWidget.cs @@ -44,7 +44,7 @@ namespace OpenRA.Widgets GetBackground = other.GetBackground; } - public override void Tick(World world) + public override void Tick() { if (Text != "") { diff --git a/OpenRA.Game/Widgets/TextFieldWidget.cs b/OpenRA.Game/Widgets/TextFieldWidget.cs index 525f982d5a..b9858e2039 100644 --- a/OpenRA.Game/Widgets/TextFieldWidget.cs +++ b/OpenRA.Game/Widgets/TextFieldWidget.cs @@ -97,14 +97,14 @@ namespace OpenRA.Widgets int blinkCycle = 10; bool showCursor = true; - public override void Tick(World world) + public override void Tick() { if (--blinkCycle <= 0) { blinkCycle = 20; showCursor ^= true; } - base.Tick(world); + base.Tick(); } public override void DrawInner() diff --git a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs index b563eefd2f..3a49258929 100755 --- a/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs +++ b/OpenRA.Game/Widgets/ViewportScrollControllerWidget.cs @@ -122,7 +122,7 @@ namespace OpenRA.Widgets return false; } - public override void Tick(World world) + public override void Tick() { Edge = ScrollDirection.None; if (Game.Settings.Game.ViewportEdgeScroll && Game.HasInputFocus) diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 61f85c1808..c8718b421f 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -281,11 +281,11 @@ namespace OpenRA.Widgets } } - public virtual void Tick(World world) + public virtual void Tick() { if (IsVisible()) foreach (var child in Children) - child.Tick(world); + child.Tick(); } public void AddChild(Widget child) @@ -335,9 +335,9 @@ namespace OpenRA.Widgets return window; } - public static void DoTick(World world) + public static void DoTick() { - RootWidget.Tick(world); + RootWidget.Tick(); } public static void DoDraw() diff --git a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs index 477630c0ea..a369b759e2 100755 --- a/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs +++ b/OpenRA.Mods.RA/Widgets/BuildPaletteWidget.cs @@ -78,7 +78,7 @@ namespace OpenRA.Mods.RA.Widgets get { return new Rectangle((int)(paletteOrigin.X) - 24, (int)(paletteOrigin.Y), 215, 48 * numActualRows); } } - public override void Tick(World world) + public override void Tick() { VisibleQueues.Clear(); @@ -101,7 +101,7 @@ namespace OpenRA.Mods.RA.Widgets TickPaletteAnimation(world); - base.Tick(world); + base.Tick(); } void TickPaletteAnimation(World world) diff --git a/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs b/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs index d8ef3c57de..d516f07ec1 100755 --- a/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs +++ b/OpenRA.Mods.RA/Widgets/RadarBinWidget.cs @@ -121,7 +121,7 @@ namespace OpenRA.Mods.RA.Widgets public override void DrawInner() { - if( world.LocalPlayer == null ) return; + if( world == null || world.LocalPlayer == null ) return; radarCollection = "radar-" + world.LocalPlayer.Country.Race; @@ -155,13 +155,12 @@ namespace OpenRA.Mods.RA.Widgets Game.Renderer.DisableScissor(); } } - - } int updateTicks = 0; - public override void Tick(World w) + public override void Tick() { + var w = Game.world; if( world != w ) SetWorld( w );