clean up PlayerResources trait lookup in MoneyBinWidget
This commit is contained in:
@@ -18,18 +18,19 @@ namespace OpenRA.Mods.RA.Widgets
|
||||
class MoneyBinWidget : Widget
|
||||
{
|
||||
readonly World world;
|
||||
readonly PlayerResources playerResources;
|
||||
|
||||
[ObjectCreator.UseCtor]
|
||||
public MoneyBinWidget( [ObjectCreator.Param] World world )
|
||||
{
|
||||
this.world = world;
|
||||
playerResources = world.LocalPlayer.PlayerActor.Trait<PlayerResources>();
|
||||
}
|
||||
|
||||
public override void Draw()
|
||||
{
|
||||
if( world.LocalPlayer == null ) return;
|
||||
|
||||
var playerResources = world.LocalPlayer.PlayerActor.Trait<PlayerResources>();
|
||||
|
||||
var digitCollection = "digits-" + world.LocalPlayer.Country.Race;
|
||||
var chromeCollection = "chrome-" + world.LocalPlayer.Country.Race;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user