pass world into CheckSync. don't pass world into Widget.DrawInner
This commit is contained in:
@@ -14,7 +14,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public readonly string Background = "dialog";
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
WidgetUtils.DrawPanel(Background, RenderBounds);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Widgets
|
||||
return Depressed;
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var font = (Bold) ? Game.Renderer.BoldFont : Game.Renderer.RegularFont;
|
||||
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Widgets
|
||||
: base(widget) { }
|
||||
|
||||
public override Rectangle EventBounds { get { return Rectangle.Empty; } }
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var pos = RenderOrigin;
|
||||
var chatLogArea = new Rectangle(pos.X, pos.Y, Bounds.Width, Bounds.Height);
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Widgets
|
||||
bool composing = false;
|
||||
bool teamChat = false;
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
if (composing)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Widgets
|
||||
public bool Bold = false;
|
||||
public Func<bool> Checked = () => false;
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var font = Bold ? Game.Renderer.BoldFont : Game.Renderer.RegularFont;
|
||||
var pos = RenderOrigin;
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Widgets
|
||||
return new ColorBlockWidget(this);
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
WidgetUtils.FillRectWithColor(RenderBounds, GetColor());
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public override Widget Clone() { return new ImageWidget(this); }
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var name = GetImageName();
|
||||
var collection = GetImageCollection();
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Widgets
|
||||
GetBackground = other.GetBackground;
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var bg = GetBackground();
|
||||
|
||||
|
||||
@@ -44,8 +44,8 @@ namespace OpenRA.Widgets
|
||||
DownPressed = other.DownPressed;
|
||||
}
|
||||
|
||||
public override void DrawInner(World world) {}
|
||||
public override void Draw(World world)
|
||||
public override void DrawInner() {}
|
||||
public override void Draw()
|
||||
{
|
||||
if (!IsVisible())
|
||||
return;
|
||||
@@ -74,7 +74,7 @@ namespace OpenRA.Widgets
|
||||
Game.Renderer.EnableScissor(backgroundRect.X, backgroundRect.Y + HeaderHeight, backgroundRect.Width, backgroundRect.Height - HeaderHeight);
|
||||
|
||||
foreach (var child in Children)
|
||||
child.Draw(world);
|
||||
child.Draw();
|
||||
|
||||
Game.Renderer.DisableScissor();
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace OpenRA.Widgets
|
||||
static Sprite UnownedSpawn = null;
|
||||
static Sprite OwnedSpawn = null;
|
||||
|
||||
public override void DrawInner( World world )
|
||||
public override void DrawInner()
|
||||
{
|
||||
if (UnownedSpawn == null)
|
||||
UnownedSpawn = ChromeProvider.GetImage("spawnpoints", "unowned");
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public PerfGraphWidget() : base() { }
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var rect = RenderBounds;
|
||||
float2 origin = Game.viewport.Location + new float2(rect.Right, rect.Bottom);
|
||||
|
||||
@@ -93,7 +93,7 @@ namespace OpenRA.Widgets
|
||||
Text = Text.Replace("\r", "");
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var bg = GetBackground();
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace OpenRA.Widgets
|
||||
Sprite sprite = null;
|
||||
string cachedImage = null;
|
||||
int cachedFrame= -1;
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var image = GetImage();
|
||||
var frame = GetFrame();
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace OpenRA.Widgets
|
||||
}
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
if (!IsVisible())
|
||||
return;
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace OpenRA.Widgets
|
||||
base.Tick(world);
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
int margin = 5;
|
||||
var font = (Bold) ? Game.Renderer.BoldFont : Game.Renderer.RegularFont;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Drawing;
|
||||
@@ -20,13 +20,13 @@ namespace OpenRA.Widgets
|
||||
public TimerWidget ()
|
||||
{
|
||||
IsVisible = () => Game.Settings.Game.MatchTimer;
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
{
|
||||
var s = WorldUtils.FormatTime(Game.LocalTick);
|
||||
var size = Game.Renderer.TitleFont.Measure(s);
|
||||
Game.Renderer.TitleFont.DrawText(s, new float2(RenderBounds.Left - size.X / 2, RenderBounds.Top - 20), Color.White);
|
||||
}
|
||||
|
||||
public override void DrawInner()
|
||||
{
|
||||
var s = WorldUtils.FormatTime(Game.LocalTick);
|
||||
var size = Game.Renderer.TitleFont.Measure(s);
|
||||
Game.Renderer.TitleFont.DrawText(s, new float2(RenderBounds.Left - size.X / 2, RenderBounds.Top - 20), Color.White);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public ViewportScrollControllerWidget() : base() { }
|
||||
protected ViewportScrollControllerWidget(ViewportScrollControllerWidget widget) : base(widget) {}
|
||||
public override void DrawInner( World world ) {}
|
||||
public override void DrawInner() {}
|
||||
|
||||
public override bool HandleInputInner(MouseInput mi)
|
||||
{
|
||||
|
||||
@@ -6,11 +6,11 @@
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Support;
|
||||
|
||||
@@ -69,8 +69,8 @@ namespace OpenRA.Widgets
|
||||
overlaySprite.sheet.Texture.SetData(overlay);
|
||||
}
|
||||
|
||||
public override void DrawInner(World world)
|
||||
{
|
||||
public override void DrawInner()
|
||||
{
|
||||
if (video == null)
|
||||
return;
|
||||
|
||||
|
||||
@@ -269,15 +269,15 @@ namespace OpenRA.Widgets
|
||||
return false;
|
||||
}
|
||||
|
||||
public abstract void DrawInner( World world );
|
||||
public abstract void DrawInner();
|
||||
|
||||
public virtual void Draw(World world)
|
||||
public virtual void Draw()
|
||||
{
|
||||
if (IsVisible())
|
||||
{
|
||||
DrawInner( world );
|
||||
DrawInner();
|
||||
foreach (var child in Children)
|
||||
child.Draw(world);
|
||||
child.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,9 +344,9 @@ namespace OpenRA.Widgets
|
||||
++Viewport.TicksSinceLastMove;
|
||||
}
|
||||
|
||||
public static void DoDraw(World world)
|
||||
public static void DoDraw()
|
||||
{
|
||||
RootWidget.Draw(world);
|
||||
RootWidget.Draw();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,7 +355,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
public ContainerWidget(Widget other) : base(other) { }
|
||||
|
||||
public override void DrawInner( World world ) { }
|
||||
public override void DrawInner() { }
|
||||
|
||||
public override string GetCursor(int2 pos) { return null; }
|
||||
public override Widget Clone() { return new ContainerWidget(this); }
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Widgets
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public override void DrawInner( World world )
|
||||
public override void DrawInner()
|
||||
{
|
||||
var selbox = SelectionBox;
|
||||
if (selbox == null) return;
|
||||
|
||||
@@ -20,8 +20,9 @@ namespace OpenRA.Widgets
|
||||
{
|
||||
public int TooltipDelay = 10;
|
||||
public WorldTooltipWidget() : base() { }
|
||||
public override void DrawInner(World world)
|
||||
public override void DrawInner()
|
||||
{
|
||||
var world = Game.world;
|
||||
if (Viewport.TicksSinceLastMove < TooltipDelay || world == null || world.LocalPlayer == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user