Fix IDE0039
This commit is contained in:
@@ -74,15 +74,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
anim.PlayRepeating(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequence));
|
||||
|
||||
var body = init.Actor.TraitInfo<BodyOrientationInfo>();
|
||||
Func<WRot> orientation = () => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
Func<WVec> offset = () => body.LocalToWorld(Offset.Rotate(orientation()));
|
||||
Func<int> zOffset = () =>
|
||||
WRot Orientation() => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
WVec Offset() => body.LocalToWorld(this.Offset.Rotate(Orientation()));
|
||||
int ZOffset()
|
||||
{
|
||||
var tmpOffset = offset();
|
||||
var tmpOffset = Offset();
|
||||
return tmpOffset.Y + tmpOffset.Z + 1;
|
||||
};
|
||||
}
|
||||
|
||||
yield return new SpriteActorPreview(anim, offset, zOffset, p);
|
||||
yield return new SpriteActorPreview(anim, Offset, ZOffset, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,15 +90,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
anim.PlayThen(OpeningSequence, () => anim.PlayRepeating(Sequence));
|
||||
|
||||
var body = init.Actor.TraitInfo<BodyOrientationInfo>();
|
||||
Func<WRot> orientation = () => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
Func<WVec> offset = () => body.LocalToWorld(Offset.Rotate(orientation()));
|
||||
Func<int> zOffset = () =>
|
||||
WRot Orientation() => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
WVec Offset() => body.LocalToWorld(this.Offset.Rotate(Orientation()));
|
||||
int ZOffset()
|
||||
{
|
||||
var tmpOffset = offset();
|
||||
var tmpOffset = Offset();
|
||||
return tmpOffset.Y + tmpOffset.Z + 1;
|
||||
};
|
||||
}
|
||||
|
||||
yield return new SpriteActorPreview(anim, offset, zOffset, p);
|
||||
yield return new SpriteActorPreview(anim, Offset, ZOffset, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
@@ -50,15 +49,15 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
anim.Play(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequence));
|
||||
|
||||
var facing = init.GetFacing();
|
||||
Func<WRot> orientation = () => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
Func<WVec> turretOffset = () => body.LocalToWorld(t.Offset.Rotate(orientation()));
|
||||
Func<int> zOffset = () =>
|
||||
WRot Orientation() => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
WVec TurretOffset() => body.LocalToWorld(t.Offset.Rotate(Orientation()));
|
||||
int ZOffset()
|
||||
{
|
||||
var tmpOffset = turretOffset();
|
||||
var tmpOffset = TurretOffset();
|
||||
return -(tmpOffset.Y + tmpOffset.Z) + 1;
|
||||
};
|
||||
}
|
||||
|
||||
yield return new SpriteActorPreview(anim, turretOffset, zOffset, p);
|
||||
yield return new SpriteActorPreview(anim, TurretOffset, ZOffset, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,18 +75,18 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
{
|
||||
rs = init.Self.Trait<RenderSprites>();
|
||||
|
||||
Func<bool> paused = () => IsTraitPaused &&
|
||||
bool Paused() => IsTraitPaused &&
|
||||
DefaultAnimation.CurrentSequence.Name == NormalizeSequence(init.Self, Info.Sequence);
|
||||
|
||||
Func<WVec> subtractDAT = null;
|
||||
if (info.ForceToGround)
|
||||
subtractDAT = () => new WVec(0, 0, -init.Self.World.Map.DistanceAboveTerrain(init.Self.CenterPosition).Length);
|
||||
|
||||
DefaultAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, paused);
|
||||
DefaultAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, Paused);
|
||||
rs.Add(new AnimationWithOffset(DefaultAnimation, subtractDAT, () => IsTraitDisabled), info.Palette, info.IsPlayerPalette);
|
||||
|
||||
// Cache the bounds from the default sequence to avoid flickering when the animation changes
|
||||
boundsAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, paused);
|
||||
boundsAnimation = new Animation(init.World, rs.GetImage(init.Self), baseFacing, Paused);
|
||||
boundsAnimation.PlayRepeating(info.Sequence);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,20 +55,20 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
anim.Play(RenderSprites.NormalizeSequence(anim, init.GetDamageState(), Sequence));
|
||||
|
||||
var facing = init.GetFacing();
|
||||
Func<WRot> orientation = () => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
Func<WVec> offset = () => body.LocalToWorld(t.Offset.Rotate(orientation()));
|
||||
Func<int> zOffset = () =>
|
||||
WRot Orientation() => body.QuantizeOrientation(WRot.FromYaw(facing()), facings);
|
||||
WVec Offset() => body.LocalToWorld(t.Offset.Rotate(Orientation()));
|
||||
int ZOffset()
|
||||
{
|
||||
var tmpOffset = offset();
|
||||
var tmpOffset = Offset();
|
||||
return -(tmpOffset.Y + tmpOffset.Z) + 1;
|
||||
};
|
||||
}
|
||||
|
||||
if (IsPlayerPalette)
|
||||
p = init.WorldRenderer.Palette(Palette + init.Get<OwnerInit>().InternalName);
|
||||
else if (Palette != null)
|
||||
p = init.WorldRenderer.Palette(Palette);
|
||||
|
||||
yield return new SpriteActorPreview(anim, offset, zOffset, p);
|
||||
yield return new SpriteActorPreview(anim, Offset, ZOffset, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
var model = init.World.ModelCache.GetModelSequence(image, Sequence);
|
||||
|
||||
var turretOrientation = t.PreviewOrientation(init, orientation, facings);
|
||||
Func<WVec> barrelOffset = () => body.LocalToWorld(t.Offset + LocalOffset.Rotate(turretOrientation()));
|
||||
Func<WRot> barrelOrientation = () => LocalOrientation.Rotate(turretOrientation());
|
||||
WVec BarrelOffset() => body.LocalToWorld(t.Offset + LocalOffset.Rotate(turretOrientation()));
|
||||
WRot BarrelOrientation() => LocalOrientation.Rotate(turretOrientation());
|
||||
|
||||
yield return new ModelAnimation(model, barrelOffset, barrelOrientation, () => false, () => 0, ShowShadow);
|
||||
yield return new ModelAnimation(model, BarrelOffset, BarrelOrientation, () => false, () => 0, ShowShadow);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user