Fix indentation in OrderEffects.
This commit is contained in:
@@ -14,56 +14,56 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Renders an effect at the order target locations.")]
|
||||
public class OrderEffectsInfo : TraitInfo
|
||||
{
|
||||
[Desc("The image to use.")]
|
||||
[FieldLoader.Require]
|
||||
public readonly string TerrainFlashImage;
|
||||
[Desc("Renders an effect at the order target locations.")]
|
||||
public class OrderEffectsInfo : TraitInfo
|
||||
{
|
||||
[Desc("The image to use.")]
|
||||
[FieldLoader.Require]
|
||||
public readonly string TerrainFlashImage;
|
||||
|
||||
[Desc("The sequence to use.")]
|
||||
[FieldLoader.Require]
|
||||
public readonly string TerrainFlashSequence;
|
||||
[Desc("The sequence to use.")]
|
||||
[FieldLoader.Require]
|
||||
public readonly string TerrainFlashSequence;
|
||||
|
||||
[Desc("The palette to use.")]
|
||||
public readonly string TerrainFlashPalette;
|
||||
[Desc("The palette to use.")]
|
||||
public readonly string TerrainFlashPalette;
|
||||
|
||||
public override object Create(ActorInitializer init)
|
||||
{
|
||||
return new OrderEffects(this);
|
||||
}
|
||||
}
|
||||
public override object Create(ActorInitializer init)
|
||||
{
|
||||
return new OrderEffects(this);
|
||||
}
|
||||
}
|
||||
|
||||
public class OrderEffects : INotifyOrderIssued
|
||||
{
|
||||
readonly OrderEffectsInfo info;
|
||||
public class OrderEffects : INotifyOrderIssued
|
||||
{
|
||||
readonly OrderEffectsInfo info;
|
||||
|
||||
public OrderEffects(OrderEffectsInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
public OrderEffects(OrderEffectsInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
bool INotifyOrderIssued.OrderIssued(World world, Target target)
|
||||
{
|
||||
if (target.Type == TargetType.Actor)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new FlashTarget(target.Actor)));
|
||||
return true;
|
||||
}
|
||||
bool INotifyOrderIssued.OrderIssued(World world, Target target)
|
||||
{
|
||||
if (target.Type == TargetType.Actor)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new FlashTarget(target.Actor)));
|
||||
return true;
|
||||
}
|
||||
|
||||
if (target.Type == TargetType.FrozenActor)
|
||||
{
|
||||
target.FrozenActor.Flash();
|
||||
return true;
|
||||
}
|
||||
if (target.Type == TargetType.FrozenActor)
|
||||
{
|
||||
target.FrozenActor.Flash();
|
||||
return true;
|
||||
}
|
||||
|
||||
if (target.Type == TargetType.Terrain)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new SpriteAnnotation(target.CenterPosition, world, info.TerrainFlashImage, info.TerrainFlashSequence, info.TerrainFlashPalette)));
|
||||
return true;
|
||||
}
|
||||
if (target.Type == TargetType.Terrain)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Add(new SpriteAnnotation(target.CenterPosition, world, info.TerrainFlashImage, info.TerrainFlashSequence, info.TerrainFlashPalette)));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user