Add `roof' to lst

This commit is contained in:
Paul Chote
2010-10-15 19:28:46 +13:00
parent 4206d2e131
commit 01cf5c21a7
3 changed files with 36 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -63,6 +63,7 @@
<Compile Include="RenderGunboat.cs" /> <Compile Include="RenderGunboat.cs" />
<Compile Include="RenderCargo.cs" /> <Compile Include="RenderCargo.cs" />
<Compile Include="CncLoadScreen.cs" /> <Compile Include="CncLoadScreen.cs" />
<Compile Include="WithRoof.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj"> <ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">

View File

@@ -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<RenderSimple>();
var roof = new Animation(rs.GetImage(self), () => self.Trait<IFacing>().Facing);
roof.Play("roof");
rs.anims.Add( "roof", new RenderSimple.AnimationWithOffset( roof ) { ZOffset = 24 } );
}
}
}

View File

@@ -645,7 +645,7 @@ LST:
RevealsShroud: RevealsShroud:
Range: 7 Range: 7
RenderUnit: RenderUnit:
BelowUnits: WithRoof:
RenderCargo: RenderCargo:
# -Selectable: # -Selectable:
Cargo: Cargo: