remove unused RenderSprite trait fields
This commit is contained in:
@@ -34,7 +34,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
sealed class WithResourceLevelOverlay : ConditionalTrait<WithResourceLevelOverlayInfo>, INotifyOwnerChanged, INotifyDamageStateChanged
|
||||
{
|
||||
readonly AnimationWithOffset anim;
|
||||
readonly RenderSprites rs;
|
||||
readonly WithSpriteBody wsb;
|
||||
|
||||
PlayerResources playerResources;
|
||||
@@ -42,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public WithResourceLevelOverlay(Actor self, WithResourceLevelOverlayInfo info)
|
||||
: base(info)
|
||||
{
|
||||
rs = self.Trait<RenderSprites>();
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
wsb = self.Trait<WithSpriteBody>();
|
||||
playerResources = self.Owner.PlayerActor.Trait<PlayerResources>();
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class WithSpriteBarrel : ConditionalTrait<WithSpriteBarrelInfo>
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
readonly RenderSprites rs;
|
||||
readonly Actor self;
|
||||
readonly Armament armament;
|
||||
readonly Turreted turreted;
|
||||
@@ -80,7 +79,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
turreted = self.TraitsImplementing<Turreted>()
|
||||
.First(tt => tt.Name == armament.Info.Turret);
|
||||
|
||||
rs = self.Trait<RenderSprites>();
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
DefaultAnimation = new Animation(self.World, rs.GetImage(self), () => turreted.WorldOrientation.Yaw);
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, Info.Sequence));
|
||||
rs.Add(new AnimationWithOffset(
|
||||
|
||||
@@ -64,7 +64,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class WithSpriteBody : PausableConditionalTrait<WithSpriteBodyInfo>, INotifyDamageStateChanged, IAutoMouseBounds
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
readonly RenderSprites rs;
|
||||
readonly Animation boundsAnimation;
|
||||
|
||||
public WithSpriteBody(ActorInitializer init, WithSpriteBodyInfo info)
|
||||
@@ -73,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
protected WithSpriteBody(ActorInitializer init, WithSpriteBodyInfo info, Func<WAngle> baseFacing)
|
||||
: base(info)
|
||||
{
|
||||
rs = init.Self.Trait<RenderSprites>();
|
||||
var rs = init.Self.Trait<RenderSprites>();
|
||||
|
||||
bool Paused() => IsTraitPaused &&
|
||||
DefaultAnimation.CurrentSequence.Name == NormalizeSequence(init.Self, Info.Sequence);
|
||||
|
||||
@@ -75,7 +75,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public class WithSpriteTurret : ConditionalTrait<WithSpriteTurretInfo>, INotifyDamageStateChanged
|
||||
{
|
||||
public readonly Animation DefaultAnimation;
|
||||
readonly RenderSprites rs;
|
||||
readonly BodyOrientation body;
|
||||
readonly Turreted t;
|
||||
readonly Armament[] arms;
|
||||
@@ -83,7 +82,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
public WithSpriteTurret(Actor self, WithSpriteTurretInfo info)
|
||||
: base(info)
|
||||
{
|
||||
rs = self.Trait<RenderSprites>();
|
||||
var rs = self.Trait<RenderSprites>();
|
||||
body = self.Trait<BodyOrientation>();
|
||||
t = self.TraitsImplementing<Turreted>()
|
||||
.First(tt => tt.Name == info.Turret);
|
||||
|
||||
Reference in New Issue
Block a user