Files
OpenRA/OpenRa.Game/Traits/RenderBuildingWarFactory.cs
Bob 707ba7d957 Locked frame times; SAM, GUN, AGUN work again.
- all frames are 40ms long. (except something in the sidebar, which should really be PlayFetchIndex anyway)
    - SAM, GUN, and AGUN no longer crash the game when built. (Turreted used Mobile, which those buildings don't have)
2009-10-20 00:57:50 +13:00

43 lines
906 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRa.Game.Graphics;
using IjwFramework.Types;
namespace OpenRa.Game.Traits
{
class RenderWarFactory : RenderBuilding
{
public Animation roof;
bool doneBuilding;
public RenderWarFactory(Actor self)
: base(self)
{
roof = new Animation(self.unitInfo.Image ?? self.unitInfo.Name);
anim.PlayThen("make", () =>
{
doneBuilding = true;
anim.Play("idle");
roof.Play("idle-top");
});
}
public override IEnumerable<Pair<Sprite, float2>> Render(Actor self)
{
if (doneBuilding)
return base.Render(self).Concat(
new[] { Pair.New(roof.Image, 24f * (float2)self.Location) });
else
return base.Render(self);
}
public override void Tick(Actor self, Game game)
{
base.Tick(self, game);
roof.Tick();
}
}
}