don't pass world to Widget.Tick, either
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace OpenRA.Widgets
|
||||
recentLines = new List<ChatLine>();
|
||||
}
|
||||
|
||||
public override void Tick (World world)
|
||||
public override void Tick()
|
||||
{
|
||||
if (RemoveTime == 0) return;
|
||||
if (--ticksUntilRemove > 0) return;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRA.Widgets
|
||||
GetBackground = other.GetBackground;
|
||||
}
|
||||
|
||||
public override void Tick(World world)
|
||||
public override void Tick()
|
||||
{
|
||||
if (Text != "")
|
||||
{
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user