From 847ce0d3a7400d8c2e4f1070ca43a90822789d53 Mon Sep 17 00:00:00 2001 From: Taryn Hill Date: Thu, 16 Jul 2015 19:19:28 -0500 Subject: [PATCH] Add some descriptions to BulletInfo. Unhardcode a sequence and a palette in Bullet. --- OpenRA.Mods.Common/Effects/Bullet.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index f6f3912c59..30236ec260 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -28,15 +28,21 @@ namespace OpenRA.Mods.Common.Effects [Desc("Maximum offset at the maximum range.")] public readonly WDist Inaccuracy = WDist.Zero; + [Desc("Image to display.")] public readonly string Image = null; - [SequenceReference("Image")] + [Desc("Loop this sequence of Image while this projectile is moving."), SequenceReference("Image")] public readonly string Sequence = "idle"; + [Desc("The palette used to draw this projectile.")] public readonly string Palette = "effect"; + [Desc("Does this projectile have a shadow?")] public readonly bool Shadow = false; + [Desc("Palette to use for this projectile's shadow if Shadow is true.")] + public readonly string ShadowPalette = "shadow"; + [Desc("Trail animation.")] public readonly string Trail = null; @@ -112,7 +118,7 @@ namespace OpenRA.Mods.Common.Effects if (!string.IsNullOrEmpty(info.Image)) { anim = new Animation(world, info.Image, GetEffectiveFacing); - anim.PlayRepeating("idle"); + anim.PlayRepeating(info.Sequence); } if (info.ContrailLength > 0) @@ -176,7 +182,7 @@ namespace OpenRA.Mods.Common.Effects if (info.Shadow) { var shadowPos = pos - new WVec(0, 0, pos.Z); - foreach (var r in anim.Render(shadowPos, wr.Palette("shadow"))) + foreach (var r in anim.Render(shadowPos, wr.Palette(info.ShadowPalette))) yield return r; }