remove refs to Game.world in widgets

This commit is contained in:
Bob
2010-10-12 02:11:16 +13:00
parent 09db76f89f
commit c974e61680
5 changed files with 32 additions and 17 deletions

View File

@@ -19,10 +19,15 @@ namespace OpenRA.Widgets
public class WorldTooltipWidget : Widget
{
public int TooltipDelay = 10;
public WorldTooltipWidget() : base() { }
readonly World world;
[ObjectCreator.UseCtor]
public WorldTooltipWidget( [ObjectCreator.Param] World world )
{
this.world = world;
}
public override void DrawInner( WorldRenderer wr )
{
var world = Game.world;
if (Viewport.TicksSinceLastMove < TooltipDelay || world == null || world.LocalPlayer == null)
return;