Change animations to use the proper SequenceProvider

Remove references to the global "Game" and use the SequenceProvider
of the current world/map.
This commit is contained in:
Pavlos Touboulidis
2014-05-11 03:05:47 +03:00
parent 6eabc6adf5
commit b560268495
52 changed files with 132 additions and 117 deletions

View File

@@ -25,15 +25,15 @@ namespace OpenRA.Mods.RA.Render
class WithCrateBody : INotifyParachuteLanded
{
Actor self;
Animation anim;
readonly Actor self;
readonly Animation anim;
public WithCrateBody(Actor self, WithCrateBodyInfo info)
{
this.self = self;
var rs = self.Trait<RenderSprites>();
var images = info.XmasImages.Any() && DateTime.Today.Month == 12 ? info.XmasImages : info.Images;
anim = new Animation(images.Random(Game.CosmeticRandom));
anim = new Animation(self.World, images.Random(Game.CosmeticRandom));
anim.Play("idle");
rs.anims.Add("", anim);
}