Change IPostRenderSelection and IPlaceBuildingDecoration to return renderables.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
||||
* Copyright 2007-2014 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,
|
||||
@@ -8,6 +8,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Graphics;
|
||||
@@ -62,20 +63,19 @@ namespace OpenRA.Mods.RA.Buildings
|
||||
return self.Owner == self.World.RenderPlayer || (allyBuildRadius && self.Owner.IsAlliedWith(self.World.RenderPlayer));
|
||||
}
|
||||
|
||||
// Range circle
|
||||
public void RenderAfterWorld(WorldRenderer wr)
|
||||
public IEnumerable<IRenderable> RenderAfterWorld(WorldRenderer wr)
|
||||
{
|
||||
// Visible to player and allies
|
||||
if (!ValidRenderPlayer())
|
||||
return;
|
||||
yield break;
|
||||
|
||||
new RangeCircleRenderable(
|
||||
yield return new RangeCircleRenderable(
|
||||
self.CenterPosition,
|
||||
WRange.FromCells(Info.Range),
|
||||
0,
|
||||
Color.FromArgb(128, Ready() ? Color.White : Color.Red),
|
||||
Color.FromArgb(96, Color.Black)
|
||||
).Render(wr);
|
||||
);
|
||||
}
|
||||
|
||||
// Selection bar
|
||||
|
||||
Reference in New Issue
Block a user