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,11 +19,15 @@ namespace OpenRA.Mods.RA.Widgets
{
public bool SplitOreAndCash = false;
public MoneyBinWidget() : base() { }
readonly World world;
[ObjectCreator.UseCtor]
public MoneyBinWidget( [ObjectCreator.Param] World world )
{
this.world = world;
}
public override void DrawInner( WorldRenderer wr )
{
var world = Game.world;
if( world.LocalPlayer == null ) return;
var playerResources = world.LocalPlayer.PlayerActor.Trait<PlayerResources>();