Add IActorPreviewInitModifier interface.

This commit is contained in:
Paul Chote
2016-06-10 16:34:12 +01:00
parent 970caf38c6
commit eb5b50185c
5 changed files with 49 additions and 3 deletions

View File

@@ -83,7 +83,7 @@ namespace OpenRA.Mods.Common.Traits.Render
}
}
public class RenderSprites : IRender, ITick, INotifyOwnerChanged, INotifyEffectiveOwnerChanged
public class RenderSprites : IRender, ITick, INotifyOwnerChanged, INotifyEffectiveOwnerChanged, IActorPreviewInitModifier
{
class AnimationWrapper
{
@@ -231,5 +231,11 @@ namespace OpenRA.Mods.Common.Traits.Render
.Select(a => (a.Animation.Animation.Image.Size.XY * info.Scale).ToInt2())
.FirstOrDefault();
}
void IActorPreviewInitModifier.ModifyActorPreviewInit(Actor self, TypeDictionary inits)
{
if (!inits.Contains<FactionInit>())
inits.Add(new FactionInit(faction));
}
}
}