put AnimationWithOffset in its own file
This commit is contained in:
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
var anim = new Animation("fire", () => 0);
|
||||
anim.PlayRepeating(self.Info.Traits.Get<BurnsInfo>().Anim);
|
||||
self.Trait<RenderSimple>().anims.Add("fire",
|
||||
new RenderSimple.AnimationWithOffset(anim, () => new float2(0, -3), null));
|
||||
new AnimationWithOffset(anim, () => new float2(0, -3), null));
|
||||
}
|
||||
|
||||
if (--ticks <= 0)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
: base(init, info)
|
||||
{
|
||||
roof = new Animation(GetImage(init.self));
|
||||
var offset = new RenderSimple.AnimationWithOffset( roof ) { ZOffset = 24 };
|
||||
var offset = new AnimationWithOffset( roof ) { ZOffset = 24 };
|
||||
offset.DisableFunc = () => !buildComplete;
|
||||
anims.Add("roof", offset);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
class WithMuzzleFlash : INotifyAttack, IRender, ITick
|
||||
{
|
||||
Dictionary<string, RenderSimple.AnimationWithOffset> muzzleFlashes = new Dictionary<string, RenderSimple.AnimationWithOffset>();
|
||||
Dictionary<string, AnimationWithOffset> muzzleFlashes = new Dictionary<string, AnimationWithOffset>();
|
||||
bool isShowing;
|
||||
|
||||
public WithMuzzleFlash(Actor self)
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
var muzzleFlash = new Animation(render.GetImage(self), getFacing);
|
||||
muzzleFlash.Play("muzzle");
|
||||
|
||||
muzzleFlashes.Add("muzzle{0}".F(muzzleFlashes.Count), new RenderSimple.AnimationWithOffset(
|
||||
muzzleFlashes.Add("muzzle{0}".F(muzzleFlashes.Count), new AnimationWithOffset(
|
||||
muzzleFlash,
|
||||
() => Combat.GetBarrelPosition(self, facing, turret, barrel),
|
||||
() => !isShowing));
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
rotorAnim = new Animation(rs.GetImage(self));
|
||||
rotorAnim.PlayRepeating("rotor");
|
||||
rs.anims.Add(info.Id, new RenderSimple.AnimationWithOffset(
|
||||
rs.anims.Add(info.Id, new AnimationWithOffset(
|
||||
rotorAnim,
|
||||
() => Combat.GetTurretPosition( self, facing, new Turret(info.Offset)),
|
||||
null ) { ZOffset = 1 } );
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
var rs = self.Trait<RenderSimple>();
|
||||
|
||||
anim = new Animation("smoke_m");
|
||||
rs.anims.Add("smoke", new RenderSimple.AnimationWithOffset(
|
||||
rs.anims.Add("smoke", new AnimationWithOffset(
|
||||
anim, null, () => !isSmoking));
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace OpenRA.Mods.RA
|
||||
var anim = new Animation(ru.GetImage(self), () => (int)facing);
|
||||
anim.PlayRepeating(info.Anim);
|
||||
|
||||
ru.anims.Add(info.AnimKey, new RenderSimple.AnimationWithOffset(
|
||||
ru.anims.Add(info.AnimKey, new AnimationWithOffset(
|
||||
anim, () => pos - new float2(0, alt), null));
|
||||
|
||||
info = null;
|
||||
|
||||
Reference in New Issue
Block a user