Pass WorldRenderer to AnimationWithOffset.OffsetFunc.
This commit is contained in:
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA
|
||||
var anim = new Animation("fire", () => 0);
|
||||
anim.PlayRepeating(Info.Anim);
|
||||
rs.anims.Add("fire",
|
||||
new AnimationWithOffset(anim, () => new float2(0, -3), null));
|
||||
new AnimationWithOffset(anim, wr => new float2(0, -3), null));
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
anim.Play("turret");
|
||||
|
||||
anims.Add("turret_{0}".F(i++), new AnimationWithOffset(anim,
|
||||
() => PPos.FromWPosHackZ(WPos.Zero + t.Position(self)).ToFloat2(), null));
|
||||
wr => PPos.FromWPosHackZ(WPos.Zero + t.Position(self)).ToFloat2(), null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
var turret = new Turret(info.Offset);
|
||||
anims.Add("spinner", new AnimationWithOffset(
|
||||
spinnerAnim,
|
||||
() => turret.PxPosition(self, facing).ToFloat2(),
|
||||
wr => turret.PxPosition(self, facing).ToFloat2(),
|
||||
null ) { ZOffset = 1 } );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
anim.Play("turret");
|
||||
|
||||
anims.Add("turret_{0}".F(i++), new AnimationWithOffset(anim,
|
||||
() => TurretPosition(self, turret, facing), null));
|
||||
wr => TurretPosition(self, turret, facing), null));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
muzzleFlashes.Add("muzzle{0}".F(muzzleFlashes.Count), new AnimationWithOffset(
|
||||
muzzleFlash,
|
||||
() => PPos.FromWPosHackZ(WPos.Zero + a.MuzzleOffset(self, barrel)).ToFloat2(),
|
||||
wr => PPos.FromWPosHackZ(WPos.Zero + a.MuzzleOffset(self, barrel)).ToFloat2(),
|
||||
() => !isShowing));
|
||||
}
|
||||
}
|
||||
@@ -63,7 +63,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
{
|
||||
foreach (var a in muzzleFlashes.Values)
|
||||
if (a.DisableFunc == null || !a.DisableFunc())
|
||||
yield return a.Image(self, wr.Palette("effect"));
|
||||
yield return a.Image(self, wr, wr.Palette("effect"));
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Render
|
||||
var turret = new Turret(info.Offset);
|
||||
rs.anims.Add(info.Id, new AnimationWithOffset(
|
||||
rotorAnim,
|
||||
() => turret.PxPosition(self, facing).ToFloat2(),
|
||||
wr => turret.PxPosition(self, facing).ToFloat2(),
|
||||
null ) { ZOffset = 1 } );
|
||||
}
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA
|
||||
anim.PlayRepeating(info.Anim);
|
||||
|
||||
ru.anims.Add(info.AnimKey, new AnimationWithOffset(
|
||||
anim, () => pos - new float2(0, alt), null));
|
||||
anim, wr => pos - new float2(0, alt), null));
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
|
||||
Reference in New Issue
Block a user