diff --git a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj index 4db1d506a1..ebd268e57f 100644 --- a/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj +++ b/OpenRA.Mods.Cnc/OpenRA.Mods.Cnc.csproj @@ -1,4 +1,4 @@ - + Debug @@ -63,6 +63,7 @@ + diff --git a/OpenRA.Mods.Cnc/WithRoof.cs b/OpenRA.Mods.Cnc/WithRoof.cs new file mode 100644 index 0000000000..1928cfdac8 --- /dev/null +++ b/OpenRA.Mods.Cnc/WithRoof.cs @@ -0,0 +1,33 @@ +#region Copyright & License Information +/* + * Copyright 2007-2010 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see LICENSE. + */ +#endregion + +using System.Collections.Generic; +using System.Linq; +using OpenRA.Traits; +using OpenRA.Graphics; + +namespace OpenRA.Mods.Cnc +{ + class WithRoofInfo : ITraitInfo + { + public object Create(ActorInitializer init) { return new WithRoof(init.self); } + } + + class WithRoof + { + public WithRoof(Actor self) + { + var rs = self.Trait(); + var roof = new Animation(rs.GetImage(self), () => self.Trait().Facing); + roof.Play("roof"); + rs.anims.Add( "roof", new RenderSimple.AnimationWithOffset( roof ) { ZOffset = 24 } ); + } + } +} diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index abd3058b66..fa5eeac1b3 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -645,7 +645,7 @@ LST: RevealsShroud: Range: 7 RenderUnit: - BelowUnits: + WithRoof: RenderCargo: # -Selectable: Cargo: