Remove hardcoded references to HideBibPreviewInit.
This commit is contained in:
committed by
RoosterDragon
parent
b2c3a55c12
commit
2a2bd676a3
@@ -204,7 +204,6 @@ namespace OpenRA.Mods.Common.Orders
|
||||
{
|
||||
new FactionInit(faction),
|
||||
new OwnerInit(queue.Actor.Owner),
|
||||
new HideBibPreviewInit()
|
||||
};
|
||||
|
||||
foreach (var api in actor.TraitInfos<IActorPreviewInitInfo>())
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public class BibInfo : ITraitInfo, Requires<BuildingInfo>, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>
|
||||
public class BibInfo : ITraitInfo, Requires<BuildingInfo>, IRenderActorPreviewSpritesInfo, IActorPreviewInitInfo, Requires<RenderSpritesInfo>
|
||||
{
|
||||
[SequenceReference] public readonly string Sequence = "bib";
|
||||
[PaletteReference] public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
||||
@@ -64,6 +64,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
yield return new SpriteActorPreview(anim, () => offset, () => -(offset.Y + centerOffset.Y + 512), p, rs.Scale);
|
||||
}
|
||||
}
|
||||
|
||||
IEnumerable<object> IActorPreviewInitInfo.ActorPreviewInits(ActorInfo ai, ActorPreviewType type)
|
||||
{
|
||||
yield return new HideBibPreviewInit();
|
||||
}
|
||||
}
|
||||
|
||||
public class Bib : INotifyAddedToWorld, INotifyRemovedFromWorld
|
||||
@@ -120,7 +125,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
public class HideBibPreviewInit : IActorInit<bool>, ISuppressInitExport
|
||||
class HideBibPreviewInit : IActorInit<bool>, ISuppressInitExport
|
||||
{
|
||||
[FieldFromYamlKey] readonly bool value = true;
|
||||
public HideBibPreviewInit() { }
|
||||
|
||||
@@ -30,7 +30,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var actor = world.Map.Rules.Actors[actorType];
|
||||
|
||||
var td = new TypeDictionary();
|
||||
td.Add(new HideBibPreviewInit());
|
||||
td.Add(new OwnerInit(world.WorldActor.Owner));
|
||||
td.Add(new FactionInit(world.WorldActor.Owner.PlayerReference.Faction));
|
||||
foreach (var api in actor.TraitInfos<IActorPreviewInitInfo>())
|
||||
|
||||
@@ -106,7 +106,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var td = new TypeDictionary();
|
||||
td.Add(new FacingInit(92));
|
||||
td.Add(new TurretFacingInit(92));
|
||||
td.Add(new HideBibPreviewInit());
|
||||
td.Add(new OwnerInit(selectedOwner.Name));
|
||||
td.Add(new FactionInit(selectedOwner.Faction));
|
||||
foreach (var api in actor.TraitInfos<IActorPreviewInitInfo>())
|
||||
|
||||
Reference in New Issue
Block a user