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

@@ -25,9 +25,15 @@ namespace OpenRA.Mods.RA.Widgets
float? lastPowerDrainedPos;
string powerCollection;
readonly World world;
[ObjectCreator.UseCtor]
public PowerBinWidget( [ObjectCreator.Param] World world )
{
this.world = world;
}
public override void DrawInner( WorldRenderer wr )
{
var world = Game.world;
if( world.LocalPlayer == null ) return;
powerCollection = "power-" + world.LocalPlayer.Country.Race;