Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Player Palette support for Bullet, Missile and GravityBomb. #14818

Merged
merged 1 commit into from Feb 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion OpenRA.Mods.Common/Projectiles/Bullet.cs
Expand Up @@ -40,6 +40,9 @@ public class BulletInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
[Desc("The palette used to draw this projectile.")]
[PaletteReference] public readonly string Palette = "effect";

[Desc("Palette is a player palette BaseName")]
public readonly bool IsPlayerPalette = false;

[Desc("Does this projectile have a shadow?")]
public readonly bool Shadow = false;

Expand Down Expand Up @@ -277,7 +280,7 @@ public IEnumerable<IRenderable> Render(WorldRenderer wr)
yield return r;
}

var palette = wr.Palette(info.Palette);
var palette = wr.Palette(info.Palette + (info.IsPlayerPalette ? args.SourceActor.Owner.InternalName : ""));
foreach (var r in anim.Render(pos, palette))
yield return r;
}
Expand Down
6 changes: 5 additions & 1 deletion OpenRA.Mods.Common/Projectiles/GravityBomb.cs
Expand Up @@ -28,8 +28,12 @@ public class GravityBombInfo : IProjectileInfo
[Desc("Sequence to play when launched. Skipped if null or empty.")]
[SequenceReference("Image")] public readonly string OpenSequence = null;

[Desc("The palette used to draw this projectile.")]
[PaletteReference] public readonly string Palette = "effect";

[Desc("Palette is a player palette BaseName")]
public readonly bool IsPlayerPalette = false;

public readonly bool Shadow = false;

[PaletteReference] public readonly string ShadowPalette = "shadow";
Expand Down Expand Up @@ -104,7 +108,7 @@ public IEnumerable<IRenderable> Render(WorldRenderer wr)
yield return r;
}

var palette = wr.Palette(info.Palette);
var palette = wr.Palette(info.Palette + (info.IsPlayerPalette ? args.SourceActor.Owner.InternalName : ""));
foreach (var r in anim.Render(pos, palette))
yield return r;
}
Expand Down
5 changes: 4 additions & 1 deletion OpenRA.Mods.Common/Projectiles/Missile.cs
Expand Up @@ -34,6 +34,9 @@ public class MissileInfo : IProjectileInfo, IRulesetLoaded<WeaponInfo>
[Desc("Palette used to render the projectile sequence.")]
[PaletteReference] public readonly string Palette = "effect";

[Desc("Palette is a player palette BaseName")]
public readonly bool IsPlayerPalette = false;

[Desc("Should the projectile's shadow be rendered?")]
public readonly bool Shadow = false;

Expand Down Expand Up @@ -911,7 +914,7 @@ public IEnumerable<IRenderable> Render(WorldRenderer wr)
yield return r;
}

var palette = wr.Palette(info.Palette);
var palette = wr.Palette(info.Palette + (info.IsPlayerPalette ? args.SourceActor.Owner.InternalName : ""));
foreach (var r in anim.Render(pos, palette))
yield return r;
}
Expand Down