Fix deviator gas blending.
This commit is contained in:
@@ -644,6 +644,7 @@
|
||||
<Compile Include="Traits\World\EditorResourceLayer.cs" />
|
||||
<Compile Include="Widgets\EditorViewportControllerWidget.cs" />
|
||||
<Compile Include="Traits\World\PaletteFromPaletteWithAlpha.cs" />
|
||||
<Compile Include="Traits\World\PaletteFromPlayerPaletteWithAlpha.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2015 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
[Desc("Create player palettes by applying alpha transparency to another player palette.")]
|
||||
class PaletteFromPlayerPaletteWithAlphaInfo : ITraitInfo
|
||||
{
|
||||
[Desc("The prefix for the resulting player palettes")]
|
||||
public readonly string BaseName = null;
|
||||
|
||||
[Desc("The name of the player palette to base off.")]
|
||||
public readonly string BasePalette = null;
|
||||
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
[Desc("Alpha component that is applied to the base palette.")]
|
||||
public readonly float Alpha = 1.0f;
|
||||
|
||||
[Desc("Premultiply color by the alpha component.")]
|
||||
public readonly bool Premultiply = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PaletteFromPlayerPaletteWithAlpha(this); }
|
||||
}
|
||||
|
||||
class PaletteFromPlayerPaletteWithAlpha : ILoadsPlayerPalettes
|
||||
{
|
||||
readonly PaletteFromPlayerPaletteWithAlphaInfo info;
|
||||
|
||||
public PaletteFromPlayerPaletteWithAlpha(PaletteFromPlayerPaletteWithAlphaInfo info) { this.info = info; }
|
||||
|
||||
public void LoadPlayerPalettes(WorldRenderer wr, string playerName, HSLColor color, bool replaceExisting)
|
||||
{
|
||||
var remap = new AlphaPaletteRemap(info.Alpha, info.Premultiply);
|
||||
var pal = new ImmutablePalette(wr.Palette(info.BasePalette + playerName).Palette, remap);
|
||||
wr.AddPalette(info.BaseName + playerName, pal, info.AllowModifiers, replaceExisting);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -80,5 +80,10 @@
|
||||
PlayerColorPalette:
|
||||
BasePalette: d2k
|
||||
RemapIndex: 255, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, 242, 241, 240
|
||||
PaletteFromPlayerPaletteWithAlpha@deviatorgas:
|
||||
BaseName: deviatorgas
|
||||
BasePalette: player
|
||||
Alpha: 0.68
|
||||
Premultiply: false
|
||||
PlayerHighlightPalette:
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ explosion:
|
||||
deviator: DATA.R8
|
||||
Start: 3512
|
||||
Length: 23
|
||||
BlendMode: SoftAdditive
|
||||
BlendMode: Alpha
|
||||
Tick: 80
|
||||
corpse: DATA.R8
|
||||
Start: 430
|
||||
@@ -95,7 +95,6 @@ deviator_trail:
|
||||
Start: 3535
|
||||
Length: 5
|
||||
Tick: 80
|
||||
BlendMode: SoftAdditive
|
||||
|
||||
laserfire:
|
||||
idle: DATA.R8
|
||||
|
||||
@@ -396,7 +396,7 @@ NerveGasMissile:
|
||||
Inaccuracy: 1c96
|
||||
Image: MISSILE
|
||||
Trail: deviator_trail
|
||||
TrailPalette: player
|
||||
TrailPalette: deviatorgas
|
||||
TrailUsePlayerPalette: true
|
||||
TrailInterval: 1
|
||||
Warhead@1Dam: SpreadDamage
|
||||
@@ -411,7 +411,7 @@ NerveGasMissile:
|
||||
SmudgeType: SandCrater, RockCrater
|
||||
Warhead@3Eff: CreateEffect
|
||||
Explosion: deviator
|
||||
ExplosionPalette: player
|
||||
ExplosionPalette: deviatorgas
|
||||
UsePlayerPalette: true
|
||||
ImpactSound: EXPLSML2.WAV
|
||||
Warhead@4OwnerChange: ChangeOwner
|
||||
|
||||
Reference in New Issue
Block a user