initial setup for decorating the PlaceBuilding OG

This commit is contained in:
Chris Forbes
2011-02-08 18:20:25 +13:00
parent 9d73299595
commit 3369373879
3 changed files with 22 additions and 3 deletions

View File

@@ -14,7 +14,23 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class RenderRangeCircleInfo : TraitInfo<RenderRangeCircle> { }
public interface IPlaceBuildingDecoration
{
void Render(WorldRenderer wr, World w, ActorInfo ai, int2 centerLocation);
}
class RenderRangeCircleInfo : TraitInfo<RenderRangeCircle>, IPlaceBuildingDecoration
{
public readonly string RangeCircleType;
public void Render(WorldRenderer wr, World w, ActorInfo ai, int2 centerLocation)
{
wr.DrawRangeCircle(
Color.FromArgb(128, Color.Yellow),
centerLocation, 3 /* hack: get this from the ActorInfo, but it's nontrivial currently */);
}
}
class RenderRangeCircle : IPreRenderSelection
{
public void RenderBeforeWorld(WorldRenderer wr, Actor self)