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