Add IActorPreviewInitModifier interface.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user