pass world into CheckSync. don't pass world into Widget.DrawInner

This commit is contained in:
Bob
2010-10-11 19:56:28 +13:00
parent ab1e930ba3
commit cb1deacbb2
32 changed files with 83 additions and 79 deletions

View File

@@ -47,11 +47,11 @@ namespace OpenRA.Mods.RA.Widgets
public readonly string BuildPaletteClose = "bleep13.aud";
public readonly string TabClick = "ramenu1.aud";
readonly World world;
[ObjectCreator.UseCtor]
public BuildPaletteWidget( [ObjectCreator.Param] World world )
readonly World world;
[ObjectCreator.UseCtor]
public BuildPaletteWidget( [ObjectCreator.Param] World world )
{
this.world = world;
this.world = world;
}
public override void Initialize()
@@ -176,7 +176,7 @@ namespace OpenRA.Mods.RA.Widgets
int paletteHeight = 0;
int numActualRows = 0;
public override void DrawInner(World world)
public override void DrawInner()
{
if (!IsVisible()) return;
// todo: fix

View File

@@ -21,8 +21,9 @@ namespace OpenRA.Mods.RA.Widgets
public MoneyBinWidget() : base() { }
public override void DrawInner(World world)
public override void DrawInner()
{
var world = Game.world;
if( world.LocalPlayer == null ) return;
var playerResources = world.LocalPlayer.PlayerActor.Trait<PlayerResources>();

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets
GetLongDesc = () => LongDesc;
}
public override void DrawInner (World world)
public override void DrawInner()
{
var image = ChromeProvider.GetImage(Image + "-button", GetImage());
var rect = new Rectangle(RenderBounds.X, RenderBounds.Y, (int)image.size.X, (int)image.size.Y);

View File

@@ -25,8 +25,9 @@ namespace OpenRA.Mods.RA.Widgets
float? lastPowerDrainedPos;
string powerCollection;
public override void DrawInner(World world)
public override void DrawInner()
{
var world = Game.world;
if( world.LocalPlayer == null ) return;
powerCollection = "power-" + world.LocalPlayer.Country.Race;

View File

@@ -119,7 +119,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(World world)
public override void DrawInner()
{
if( world.LocalPlayer == null ) return;

View File

@@ -63,8 +63,9 @@ namespace OpenRA.Mods.RA.Widgets
return false;
}
public override void DrawInner(World world)
{
public override void DrawInner()
{
var world = Game.world;
buttons.Clear();
if( world.LocalPlayer == null ) return;