Use explicit interfaces in WithBuildingPlaced(Overlay|Animation).
This commit is contained in:
@@ -35,26 +35,26 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>();
|
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingComplete(Actor self)
|
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = true;
|
buildComplete = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Sold(Actor self) { }
|
void INotifySold.Sold(Actor self) { }
|
||||||
public void Selling(Actor self)
|
void INotifySold.Selling(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = false;
|
buildComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeforeTransform(Actor self)
|
void INotifyTransform.BeforeTransform(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = false;
|
buildComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnTransform(Actor self) { }
|
void INotifyTransform.OnTransform(Actor self) { }
|
||||||
public void AfterTransform(Actor self) { }
|
void INotifyTransform.AfterTransform(Actor self) { }
|
||||||
|
|
||||||
public void BuildingPlaced(Actor self)
|
void INotifyBuildingPlaced.BuildingPlaced(Actor self)
|
||||||
{
|
{
|
||||||
if (buildComplete)
|
if (buildComplete)
|
||||||
wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self));
|
wsb.PlayCustomAnimation(self, info.Sequence, () => wsb.CancelCustomAnimation(self));
|
||||||
|
|||||||
@@ -55,32 +55,32 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingComplete(Actor self)
|
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = true;
|
buildComplete = true;
|
||||||
visible = false;
|
visible = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Sold(Actor self) { }
|
void INotifySold.Sold(Actor self) { }
|
||||||
public void Selling(Actor self)
|
void INotifySold.Selling(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = false;
|
buildComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BeforeTransform(Actor self)
|
void INotifyTransform.BeforeTransform(Actor self)
|
||||||
{
|
{
|
||||||
buildComplete = false;
|
buildComplete = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnTransform(Actor self) { }
|
void INotifyTransform.OnTransform(Actor self) { }
|
||||||
public void AfterTransform(Actor self) { }
|
void INotifyTransform.AfterTransform(Actor self) { }
|
||||||
|
|
||||||
public void DamageStateChanged(Actor self, AttackInfo e)
|
void INotifyDamageStateChanged.DamageStateChanged(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
overlay.ReplaceAnim(RenderSprites.NormalizeSequence(overlay, e.DamageState, overlay.CurrentSequence.Name));
|
overlay.ReplaceAnim(RenderSprites.NormalizeSequence(overlay, e.DamageState, overlay.CurrentSequence.Name));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void BuildingPlaced(Actor self)
|
void INotifyBuildingPlaced.BuildingPlaced(Actor self)
|
||||||
{
|
{
|
||||||
visible = true;
|
visible = true;
|
||||||
overlay.PlayThen(overlay.CurrentSequence.Name, () => visible = false);
|
overlay.PlayThen(overlay.CurrentSequence.Name, () => visible = false);
|
||||||
|
|||||||
Reference in New Issue
Block a user