Change IPostRenderSelection and IPlaceBuildingDecoration to return renderables.
This commit is contained in:
@@ -9,6 +9,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.RA.Activities;
|
||||
@@ -23,13 +24,14 @@ namespace OpenRA.Mods.RA.Render
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RenderBuilding(init, this);}
|
||||
|
||||
public void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
|
||||
public IEnumerable<IRenderable> Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition)
|
||||
{
|
||||
if (!ai.Traits.Get<BuildingInfo>().RequiresBaseProvider)
|
||||
return;
|
||||
yield break;
|
||||
|
||||
foreach (var a in w.ActorsWithTrait<BaseProvider>())
|
||||
a.Trait.RenderAfterWorld(wr);
|
||||
foreach (var r in a.Trait.RenderAfterWorld(wr))
|
||||
yield return r;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user