Remove custom palettes from building placement previews.
This commit is contained in:
@@ -25,12 +25,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Enable the building's idle animation.")]
|
[Desc("Enable the building's idle animation.")]
|
||||||
public readonly bool Animated = true;
|
public readonly bool Animated = true;
|
||||||
|
|
||||||
[PaletteReference(nameof(OverridePaletteIsPlayerPalette))]
|
[Desc("Custom opacity to apply to the actor preview.")]
|
||||||
[Desc("Custom palette name.")]
|
public readonly float PreviewAlpha = 1f;
|
||||||
public readonly string OverridePalette = null;
|
|
||||||
|
|
||||||
[Desc("Custom palette is a player palette BaseName.")]
|
|
||||||
public readonly bool OverridePaletteIsPlayerPalette = true;
|
|
||||||
|
|
||||||
[Desc("Footprint types to draw underneath the actor preview.")]
|
[Desc("Footprint types to draw underneath the actor preview.")]
|
||||||
public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild;
|
public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild;
|
||||||
@@ -54,7 +50,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public class ActorPreviewPlaceBuildingPreviewPreview : FootprintPlaceBuildingPreviewPreview
|
public class ActorPreviewPlaceBuildingPreviewPreview : FootprintPlaceBuildingPreviewPreview
|
||||||
{
|
{
|
||||||
readonly ActorPreviewPlaceBuildingPreviewInfo info;
|
readonly ActorPreviewPlaceBuildingPreviewInfo info;
|
||||||
readonly PaletteReference palette;
|
|
||||||
readonly IActorPreview[] preview;
|
readonly IActorPreview[] preview;
|
||||||
|
|
||||||
public ActorPreviewPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init)
|
public ActorPreviewPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init)
|
||||||
@@ -65,12 +60,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
preview = actorInfo.TraitInfos<IRenderActorPreviewInfo>()
|
preview = actorInfo.TraitInfos<IRenderActorPreviewInfo>()
|
||||||
.SelectMany(rpi => rpi.RenderPreview(previewInit))
|
.SelectMany(rpi => rpi.RenderPreview(previewInit))
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.OverridePalette))
|
|
||||||
{
|
|
||||||
var ownerName = init.Get<OwnerInit>().InternalName;
|
|
||||||
palette = wr.Palette(info.OverridePaletteIsPlayerPalette ? info.OverridePalette + ownerName : info.OverridePalette);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void TickInner()
|
protected override void TickInner()
|
||||||
@@ -88,15 +77,17 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var previewRenderables = preview
|
var previewRenderables = preview
|
||||||
.SelectMany(p => p.Render(wr, centerPosition));
|
.SelectMany(p => p.Render(wr, centerPosition));
|
||||||
|
|
||||||
if (palette != null)
|
|
||||||
previewRenderables = previewRenderables.Select(a => !a.IsDecoration && a is IPalettedRenderable ? ((IPalettedRenderable)a).WithPalette(palette) : a);
|
|
||||||
|
|
||||||
if (info.FootprintUnderPreview != PlaceBuildingCellType.None)
|
if (info.FootprintUnderPreview != PlaceBuildingCellType.None)
|
||||||
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintUnderPreview))
|
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintUnderPreview))
|
||||||
yield return r;
|
yield return r;
|
||||||
|
|
||||||
foreach (var r in previewRenderables.OrderBy(WorldRenderer.RenderableZPositionComparisonKey))
|
foreach (var r in previewRenderables.OrderBy(WorldRenderer.RenderableZPositionComparisonKey))
|
||||||
yield return r;
|
{
|
||||||
|
if (info.PreviewAlpha < 1f && r is IModifyableRenderable mr)
|
||||||
|
yield return mr.WithAlpha(mr.Alpha * info.PreviewAlpha);
|
||||||
|
else
|
||||||
|
yield return r;
|
||||||
|
}
|
||||||
|
|
||||||
if (info.FootprintOverPreview != PlaceBuildingCellType.None)
|
if (info.FootprintOverPreview != PlaceBuildingCellType.None)
|
||||||
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview))
|
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview))
|
||||||
|
|||||||
@@ -25,9 +25,11 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Palette to use for rendering the placement sprite.")]
|
[Desc("Palette to use for rendering the placement sprite.")]
|
||||||
public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
||||||
|
|
||||||
[PaletteReference]
|
[Desc("Custom opacity to apply to the placement sprite.")]
|
||||||
[Desc("Palette to use for rendering the placement sprite for line build segments.")]
|
public readonly float FootprintAlpha = 1f;
|
||||||
public readonly string LineBuildSegmentPalette = TileSet.TerrainPaletteInternalName;
|
|
||||||
|
[Desc("Custom opacity to apply to the line-build placement sprite.")]
|
||||||
|
public readonly float LineBuildFootprintAlpha = 1f;
|
||||||
|
|
||||||
protected virtual IPlaceBuildingPreview CreatePreview(WorldRenderer wr, ActorInfo ai, TypeDictionary init)
|
protected virtual IPlaceBuildingPreview CreatePreview(WorldRenderer wr, ActorInfo ai, TypeDictionary init)
|
||||||
{
|
{
|
||||||
@@ -52,12 +54,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
readonly Sprite buildOk;
|
readonly Sprite buildOk;
|
||||||
readonly Sprite buildBlocked;
|
readonly Sprite buildBlocked;
|
||||||
|
|
||||||
protected static bool HasFlag(PlaceBuildingCellType value, PlaceBuildingCellType flag)
|
|
||||||
{
|
|
||||||
// PERF: Enum.HasFlag is slower and requires allocations.
|
|
||||||
return (value & flag) == value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public FootprintPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, FootprintPlaceBuildingPreviewInfo info, TypeDictionary init)
|
public FootprintPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, FootprintPlaceBuildingPreviewInfo info, TypeDictionary init)
|
||||||
{
|
{
|
||||||
actorInfo = ai;
|
actorInfo = ai;
|
||||||
@@ -81,19 +77,18 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected virtual IEnumerable<IRenderable> RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint,
|
protected virtual IEnumerable<IRenderable> RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint,
|
||||||
PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild)
|
PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild)
|
||||||
{
|
{
|
||||||
var cellPalette = wr.Palette(info.Palette);
|
var palette = wr.Palette(info.Palette);
|
||||||
var linePalette = wr.Palette(info.LineBuildSegmentPalette);
|
|
||||||
var topLeftPos = wr.World.Map.CenterOfCell(topLeft);
|
var topLeftPos = wr.World.Map.CenterOfCell(topLeft);
|
||||||
foreach (var c in footprint)
|
foreach (var c in footprint)
|
||||||
{
|
{
|
||||||
if ((c.Value & filter) == 0)
|
if ((c.Value & filter) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var tile = HasFlag(c.Value, PlaceBuildingCellType.Invalid) ? buildBlocked : buildOk;
|
var tile = (c.Value & PlaceBuildingCellType.Invalid) != 0 ? buildBlocked : buildOk;
|
||||||
var pal = HasFlag(c.Value, PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette;
|
|
||||||
var pos = wr.World.Map.CenterOfCell(c.Key);
|
var pos = wr.World.Map.CenterOfCell(c.Key);
|
||||||
var offset = new WVec(0, 0, topLeftPos.Z - pos.Z);
|
var offset = new WVec(0, 0, topLeftPos.Z - pos.Z);
|
||||||
yield return new SpriteRenderable(tile, pos, offset, -511, pal, 1f, true, TintModifiers.IgnoreWorldTint);
|
var alpha = (c.Value & PlaceBuildingCellType.LineBuild) != 0 ? info.LineBuildFootprintAlpha : info.FootprintAlpha;
|
||||||
|
yield return new SpriteRenderable(tile, pos, offset, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -107,8 +102,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
protected virtual IEnumerable<IRenderable> RenderInner(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint)
|
protected virtual IEnumerable<IRenderable> RenderInner(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint)
|
||||||
{
|
{
|
||||||
foreach (var r in RenderFootprint(wr, topLeft, footprint))
|
return RenderFootprint(wr, topLeft, footprint);
|
||||||
yield return r;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IRenderable> IPlaceBuildingPreview.Render(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint)
|
IEnumerable<IRenderable> IPlaceBuildingPreview.Render(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint)
|
||||||
|
|||||||
@@ -25,12 +25,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Sequence name to use.")]
|
[Desc("Sequence name to use.")]
|
||||||
public readonly string Sequence = "idle";
|
public readonly string Sequence = "idle";
|
||||||
|
|
||||||
[PaletteReference(nameof(SequencePaletteIsPlayerPalette))]
|
[Desc("Custom opacity to apply to the sequence sprite.")]
|
||||||
[Desc("Custom palette name.")]
|
public readonly float SequenceAlpha = 1f;
|
||||||
public readonly string SequencePalette = null;
|
|
||||||
|
|
||||||
[Desc("Custom palette is a player palette BaseName.")]
|
|
||||||
public readonly bool SequencePaletteIsPlayerPalette = true;
|
|
||||||
|
|
||||||
[Desc("Footprint types to draw underneath the actor preview.")]
|
[Desc("Footprint types to draw underneath the actor preview.")]
|
||||||
public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild;
|
public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild;
|
||||||
@@ -65,12 +61,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
var faction = init.Get<FactionInit>().Value;
|
var faction = init.Get<FactionInit>().Value;
|
||||||
|
|
||||||
var rsi = ai.TraitInfo<RenderSpritesInfo>();
|
var rsi = ai.TraitInfo<RenderSpritesInfo>();
|
||||||
|
palette = wr.Palette(rsi.Palette ?? rsi.PlayerPalette + ownerName);
|
||||||
if (!string.IsNullOrEmpty(info.SequencePalette))
|
|
||||||
palette = wr.Palette(info.SequencePaletteIsPlayerPalette ? info.SequencePalette + ownerName : info.SequencePalette);
|
|
||||||
else
|
|
||||||
palette = wr.Palette(rsi.Palette ?? rsi.PlayerPalette + ownerName);
|
|
||||||
|
|
||||||
preview = new Animation(wr.World, rsi.GetImage(ai, wr.World.Map.Rules.Sequences, faction));
|
preview = new Animation(wr.World, rsi.GetImage(ai, wr.World.Map.Rules.Sequences, faction));
|
||||||
preview.PlayRepeating(info.Sequence);
|
preview.PlayRepeating(info.Sequence);
|
||||||
}
|
}
|
||||||
@@ -88,7 +79,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
var centerPosition = wr.World.Map.CenterOfCell(topLeft) + centerOffset;
|
var centerPosition = wr.World.Map.CenterOfCell(topLeft) + centerOffset;
|
||||||
foreach (var r in preview.Render(centerPosition, WVec.Zero, 0, palette))
|
foreach (var r in preview.Render(centerPosition, WVec.Zero, 0, palette))
|
||||||
yield return r;
|
{
|
||||||
|
if (info.SequenceAlpha < 1f && r is IModifyableRenderable mr)
|
||||||
|
yield return mr.WithAlpha(mr.Alpha * info.SequenceAlpha);
|
||||||
|
else
|
||||||
|
yield return r;
|
||||||
|
}
|
||||||
|
|
||||||
if (info.FootprintOverPreview != PlaceBuildingCellType.None)
|
if (info.FootprintOverPreview != PlaceBuildingCellType.None)
|
||||||
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview))
|
foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview))
|
||||||
|
|||||||
@@ -22,6 +22,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Palette to use for rendering the placement sprite.")]
|
[Desc("Palette to use for rendering the placement sprite.")]
|
||||||
public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
public readonly string Palette = TileSet.TerrainPaletteInternalName;
|
||||||
|
|
||||||
|
[Desc("Custom opacity to apply to the placement sprite.")]
|
||||||
|
public readonly float FootprintAlpha = 1f;
|
||||||
|
|
||||||
[Desc("Sequence image where the selection overlay types are defined.")]
|
[Desc("Sequence image where the selection overlay types are defined.")]
|
||||||
public readonly string Image = "editor-overlay";
|
public readonly string Image = "editor-overlay";
|
||||||
|
|
||||||
@@ -89,12 +92,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (CopyRegion != null)
|
if (CopyRegion != null)
|
||||||
foreach (var c in CopyRegion)
|
foreach (var c in CopyRegion)
|
||||||
yield return new SpriteRenderable(copySprite, wr.World.Map.CenterOfCell(c),
|
yield return new SpriteRenderable(copySprite, wr.World.Map.CenterOfCell(c),
|
||||||
WVec.Zero, -511, palette, 1f, true, TintModifiers.IgnoreWorldTint);
|
WVec.Zero, -511, palette, 1f, info.FootprintAlpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
|
||||||
|
|
||||||
if (PasteRegion != null)
|
if (PasteRegion != null)
|
||||||
foreach (var c in PasteRegion)
|
foreach (var c in PasteRegion)
|
||||||
yield return new SpriteRenderable(pasteSprite, wr.World.Map.CenterOfCell(c),
|
yield return new SpriteRenderable(pasteSprite, wr.World.Map.CenterOfCell(c),
|
||||||
WVec.Zero, -511, palette, 1f, true, TintModifiers.IgnoreWorldTint);
|
WVec.Zero, -511, palette, 1f, info.FootprintAlpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IRenderAboveShroud.SpatiallyPartitionable { get { return false; } }
|
bool IRenderAboveShroud.SpatiallyPartitionable { get { return false; } }
|
||||||
|
|||||||
@@ -0,0 +1,77 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2020 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, either version 3 of
|
||||||
|
* the License, or (at your option) any later version. For more
|
||||||
|
* information, see COPYING.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||||
|
{
|
||||||
|
public class RemovePlaceBuildingPalette : UpdateRule
|
||||||
|
{
|
||||||
|
public override string Name { get { return "*PlaceBuildingPreview palette overrides have been removed."; } }
|
||||||
|
|
||||||
|
public override string Description
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return "The palette overrides on the ActorPreviewPlaceBuildingPreview, FootprintPlaceBuildingPreview\n" +
|
||||||
|
"SequencePlaceBuildingPreview, and D2kActorPreviewPlaceBuildingPreview traits have been removed.\n" +
|
||||||
|
"New Alpha and LineBuildSegmentAlpha properties have been added in their place.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
readonly List<string> locations = new List<string>();
|
||||||
|
|
||||||
|
public override IEnumerable<string> AfterUpdate(ModData modData)
|
||||||
|
{
|
||||||
|
if (locations.Any())
|
||||||
|
yield return "The *Palette fields have been removed from the *PlaceBuildingPreview traits.\n" +
|
||||||
|
"You may wish to inspect the following definitions and define new Alpha or\n" +
|
||||||
|
"LineBuildSegmentAlpha properties as appropriate to recreate transparency effects:\n" +
|
||||||
|
UpdateUtils.FormatMessageList(locations);
|
||||||
|
|
||||||
|
locations.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
|
||||||
|
{
|
||||||
|
var removed = 0;
|
||||||
|
foreach (var node in actorNode.ChildrenMatching("ActorPreviewPlaceBuildingPreview"))
|
||||||
|
{
|
||||||
|
removed += node.RemoveNodes("OverridePalette");
|
||||||
|
removed += node.RemoveNodes("OverridePaletteIsPlayerPalette");
|
||||||
|
removed += node.RemoveNodes("LineBuildSegmentPalette");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var node in actorNode.ChildrenMatching("D2kActorPreviewPlaceBuildingPreview"))
|
||||||
|
{
|
||||||
|
removed += node.RemoveNodes("OverridePalette");
|
||||||
|
removed += node.RemoveNodes("OverridePaletteIsPlayerPalette");
|
||||||
|
removed += node.RemoveNodes("LineBuildSegmentPalette");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var node in actorNode.ChildrenMatching("FootprintPlaceBuildingPreview"))
|
||||||
|
removed += node.RemoveNodes("LineBuildSegmentPalette");
|
||||||
|
|
||||||
|
foreach (var node in actorNode.ChildrenMatching("SequencePlaceBuildingPreview"))
|
||||||
|
{
|
||||||
|
removed += node.RemoveNodes("SequencePalette");
|
||||||
|
removed += node.RemoveNodes("SequencePaletteIsPlayerPalette");
|
||||||
|
removed += node.RemoveNodes("LineBuildSegmentPalette");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (removed > 0)
|
||||||
|
locations.Add("{0} ({1})".F(actorNode.Key, actorNode.Location.Filename));
|
||||||
|
|
||||||
|
yield break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -88,6 +88,7 @@ namespace OpenRA.Mods.Common.UpdateRules
|
|||||||
new RemovePlayerHighlightPalette(),
|
new RemovePlayerHighlightPalette(),
|
||||||
new ReplaceWithColoredOverlayPalette(),
|
new ReplaceWithColoredOverlayPalette(),
|
||||||
new RemoveRenderSpritesScale(),
|
new RemoveRenderSpritesScale(),
|
||||||
|
new RemovePlaceBuildingPalette(),
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -72,8 +72,7 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
protected override IEnumerable<IRenderable> RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint,
|
protected override IEnumerable<IRenderable> RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary<CPos, PlaceBuildingCellType> footprint,
|
||||||
PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild)
|
PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild)
|
||||||
{
|
{
|
||||||
var cellPalette = wr.Palette(info.Palette);
|
var palette = wr.Palette(info.Palette);
|
||||||
var linePalette = wr.Palette(info.LineBuildSegmentPalette);
|
|
||||||
var topLeftPos = wr.World.Map.CenterOfCell(topLeft);
|
var topLeftPos = wr.World.Map.CenterOfCell(topLeft);
|
||||||
|
|
||||||
var candidateSafeTiles = unpathableCells.Update(topLeft);
|
var candidateSafeTiles = unpathableCells.Update(topLeft);
|
||||||
@@ -82,14 +81,14 @@ namespace OpenRA.Mods.D2k.Traits
|
|||||||
if ((c.Value & filter) == 0)
|
if ((c.Value & filter) == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
var tile = HasFlag(c.Value, PlaceBuildingCellType.Invalid) ? buildBlocked :
|
var tile = (c.Value & PlaceBuildingCellType.Invalid) != 0 ? buildBlocked :
|
||||||
(checkUnsafeTiles && candidateSafeTiles.Contains(c.Key) && info.UnsafeTerrainTypes.Contains(wr.World.Map.GetTerrainInfo(c.Key).Type))
|
(checkUnsafeTiles && candidateSafeTiles.Contains(c.Key) && info.UnsafeTerrainTypes.Contains(wr.World.Map.GetTerrainInfo(c.Key).Type))
|
||||||
? buildUnsafe : buildOk;
|
? buildUnsafe : buildOk;
|
||||||
|
|
||||||
var pal = HasFlag(c.Value, PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette;
|
|
||||||
var pos = wr.World.Map.CenterOfCell(c.Key);
|
var pos = wr.World.Map.CenterOfCell(c.Key);
|
||||||
var offset = new WVec(0, 0, topLeftPos.Z - pos.Z);
|
var offset = new WVec(0, 0, topLeftPos.Z - pos.Z);
|
||||||
yield return new SpriteRenderable(tile, pos, offset, -511, pal, 1f, true, TintModifiers.IgnoreWorldTint);
|
var alpha = (c.Value & PlaceBuildingCellType.LineBuild) != 0 ? info.LineBuildFootprintAlpha : info.FootprintAlpha;
|
||||||
|
yield return new SpriteRenderable(tile, pos, offset, -511, palette, 1f, alpha, float3.Ones, TintModifiers.IgnoreWorldTint, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
^Palettes:
|
^Palettes:
|
||||||
-PlayerColorPalette:
|
-PlayerColorPalette:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
IndexedPlayerPalette:
|
IndexedPlayerPalette:
|
||||||
BasePalette: terrain
|
BasePalette: terrain
|
||||||
RemapIndex: 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191
|
RemapIndex: 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191
|
||||||
@@ -16,10 +15,6 @@
|
|||||||
GDI: 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191
|
GDI: 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191
|
||||||
Nod: 161, 200, 201, 202, 204, 205, 206, 12, 201, 202, 203, 204, 205, 115, 198, 114
|
Nod: 161, 200, 201, 202, 204, 205, 206, 12, 201, 202, 203, 204, 205, 115, 198, 114
|
||||||
Neutral: 192, 164, 132, 155, 133, 197, 112, 12, 163, 132, 155, 133, 134, 197, 154, 198
|
Neutral: 192, 164, 132, 155, 133, 197, 112, 12, 163, 132, 155, 133, 134, 197, 154, 198
|
||||||
PaletteFromPlayerPaletteWithAlpha@Placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
Alpha: 0.65
|
|
||||||
BasePalette: player
|
|
||||||
|
|
||||||
^Vehicle:
|
^Vehicle:
|
||||||
RenderSprites:
|
RenderSprites:
|
||||||
|
|||||||
@@ -679,7 +679,7 @@
|
|||||||
Dimensions: 1,1
|
Dimensions: 1,1
|
||||||
Footprint: x
|
Footprint: x
|
||||||
ActorPreviewPlaceBuildingPreview:
|
ActorPreviewPlaceBuildingPreview:
|
||||||
OverridePalette: placebuilding
|
PreviewAlpha: 0.65
|
||||||
SoundOnDamageTransition:
|
SoundOnDamageTransition:
|
||||||
DamagedSounds: xplobig4.aud
|
DamagedSounds: xplobig4.aud
|
||||||
DestroyedSounds: crumble.aud, xplobig4.aud
|
DestroyedSounds: crumble.aud, xplobig4.aud
|
||||||
@@ -850,7 +850,7 @@
|
|||||||
BuildSounds: hvydoor1.aud
|
BuildSounds: hvydoor1.aud
|
||||||
TerrainTypes: Clear,Road
|
TerrainTypes: Clear,Road
|
||||||
FootprintPlaceBuildingPreview:
|
FootprintPlaceBuildingPreview:
|
||||||
LineBuildSegmentPalette: placelinesegment
|
LineBuildFootprintAlpha: 0.65
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
Adjacent: 4
|
Adjacent: 4
|
||||||
|
|||||||
@@ -110,11 +110,3 @@
|
|||||||
RotationPaletteEffect@water:
|
RotationPaletteEffect@water:
|
||||||
ExcludePalettes: effect, chrome
|
ExcludePalettes: effect, chrome
|
||||||
RotationBase: 32
|
RotationBase: 32
|
||||||
PaletteFromPaletteWithAlpha@placelinesegment:
|
|
||||||
Name: placelinesegment
|
|
||||||
BasePalette: terrain
|
|
||||||
Alpha: 0.65
|
|
||||||
PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
Alpha: 0.65
|
|
||||||
BasePalette: player
|
|
||||||
|
|||||||
@@ -516,7 +516,7 @@ WEAP:
|
|||||||
-ActorPreviewPlaceBuildingPreview:
|
-ActorPreviewPlaceBuildingPreview:
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: place
|
Sequence: place
|
||||||
SequencePalette: placebuilding
|
SequenceAlpha: 0.65
|
||||||
|
|
||||||
HPAD:
|
HPAD:
|
||||||
Inherits: ^BaseBuilding
|
Inherits: ^BaseBuilding
|
||||||
@@ -925,7 +925,7 @@ SAM:
|
|||||||
-ActorPreviewPlaceBuildingPreview:
|
-ActorPreviewPlaceBuildingPreview:
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: place
|
Sequence: place
|
||||||
SequencePalette: placebuilding
|
SequenceAlpha: 0.65
|
||||||
|
|
||||||
OBLI:
|
OBLI:
|
||||||
Inherits: ^Defense
|
Inherits: ^Defense
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
-PlayerColorPalette:
|
-PlayerColorPalette:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@deviatorgas:
|
-PaletteFromPlayerPaletteWithAlpha@deviatorgas:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@cloak:
|
-PaletteFromPlayerPaletteWithAlpha@cloak:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
IndexedPlayerPalette:
|
IndexedPlayerPalette:
|
||||||
BasePalette: d2k
|
BasePalette: d2k
|
||||||
BaseName: player
|
BaseName: player
|
||||||
@@ -26,7 +25,3 @@
|
|||||||
BaseName: cloak
|
BaseName: cloak
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
Alpha: 0.55
|
Alpha: 0.55
|
||||||
PaletteFromPlayerPaletteWithAlpha@Placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
BasePalette: player
|
|
||||||
Alpha: 0.65
|
|
||||||
|
|||||||
@@ -421,7 +421,7 @@
|
|||||||
ConcretePrerequisites: global-auto-concrete
|
ConcretePrerequisites: global-auto-concrete
|
||||||
D2kActorPreviewPlaceBuildingPreview:
|
D2kActorPreviewPlaceBuildingPreview:
|
||||||
RequiresPrerequisites: !global-auto-concrete
|
RequiresPrerequisites: !global-auto-concrete
|
||||||
OverridePalette: placebuilding
|
PreviewAlpha: 0.65
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
Adjacent: 3
|
Adjacent: 3
|
||||||
|
|||||||
@@ -71,11 +71,3 @@
|
|||||||
BaseName: cloak
|
BaseName: cloak
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
Alpha: 0.55
|
Alpha: 0.55
|
||||||
PaletteFromPaletteWithAlpha@placelinesegment:
|
|
||||||
Name: placelinesegment
|
|
||||||
BasePalette: terrain
|
|
||||||
Alpha: 0.65
|
|
||||||
PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
BasePalette: player
|
|
||||||
Alpha: 0.65
|
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ wall:
|
|||||||
BuildSounds: CHUNG.WAV
|
BuildSounds: CHUNG.WAV
|
||||||
TerrainTypes: Rock, Concrete
|
TerrainTypes: Rock, Concrete
|
||||||
FootprintPlaceBuildingPreview:
|
FootprintPlaceBuildingPreview:
|
||||||
LineBuildSegmentPalette: placelinesegment
|
LineBuildFootprintAlpha: 0.65
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
Adjacent: 7
|
Adjacent: 7
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
^Palettes:
|
^Palettes:
|
||||||
-PlayerColorPalette:
|
-PlayerColorPalette:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@cloak:
|
-PaletteFromPlayerPaletteWithAlpha@cloak:
|
||||||
-PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
IndexedPlayerPalette:
|
IndexedPlayerPalette:
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
BaseName: player
|
BaseName: player
|
||||||
@@ -24,7 +23,3 @@
|
|||||||
BaseName: cloak
|
BaseName: cloak
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
Alpha: 0.55
|
Alpha: 0.55
|
||||||
PaletteFromPlayerPaletteWithAlpha@Placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
BasePalette: player
|
|
||||||
Alpha: 0.65
|
|
||||||
|
|||||||
@@ -652,7 +652,7 @@
|
|||||||
BuildSounds: placbldg.aud, build5.aud
|
BuildSounds: placbldg.aud, build5.aud
|
||||||
UndeploySounds: cashturn.aud
|
UndeploySounds: cashturn.aud
|
||||||
ActorPreviewPlaceBuildingPreview:
|
ActorPreviewPlaceBuildingPreview:
|
||||||
OverridePalette: placebuilding
|
PreviewAlpha: 0.65
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
SoundOnDamageTransition:
|
SoundOnDamageTransition:
|
||||||
@@ -760,7 +760,7 @@
|
|||||||
TerrainTypes: Clear,Road
|
TerrainTypes: Clear,Road
|
||||||
UndeploySounds: cashturn.aud
|
UndeploySounds: cashturn.aud
|
||||||
FootprintPlaceBuildingPreview:
|
FootprintPlaceBuildingPreview:
|
||||||
LineBuildSegmentPalette: placelinesegment
|
LineBuildFootprintAlpha: 0.65
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
Adjacent: 7
|
Adjacent: 7
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ WEAF:
|
|||||||
-ActorPreviewPlaceBuildingPreview:
|
-ActorPreviewPlaceBuildingPreview:
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: place
|
Sequence: place
|
||||||
SequencePalette: placebuilding
|
SequenceAlpha: 0.65
|
||||||
|
|
||||||
DOMF:
|
DOMF:
|
||||||
Inherits: ^FakeBuilding
|
Inherits: ^FakeBuilding
|
||||||
|
|||||||
@@ -94,14 +94,6 @@
|
|||||||
ChronoshiftPaletteEffect:
|
ChronoshiftPaletteEffect:
|
||||||
FlashPaletteEffect@NUKE:
|
FlashPaletteEffect@NUKE:
|
||||||
Type: Nuke
|
Type: Nuke
|
||||||
PaletteFromPaletteWithAlpha@placelinesegment:
|
|
||||||
Name: placelinesegment
|
|
||||||
BasePalette: terrain
|
|
||||||
Alpha: 0.65
|
|
||||||
PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
BasePalette: player
|
|
||||||
Alpha: 0.65
|
|
||||||
IndexedPalette@CIV2:
|
IndexedPalette@CIV2:
|
||||||
Name: civilian2
|
Name: civilian2
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
|
|||||||
@@ -1103,7 +1103,7 @@ WEAP:
|
|||||||
-ActorPreviewPlaceBuildingPreview:
|
-ActorPreviewPlaceBuildingPreview:
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: place
|
Sequence: place
|
||||||
SequencePalette: placebuilding
|
SequenceAlpha: 0.65
|
||||||
|
|
||||||
FACT:
|
FACT:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
@@ -1290,7 +1290,7 @@ PROC:
|
|||||||
-ActorPreviewPlaceBuildingPreview:
|
-ActorPreviewPlaceBuildingPreview:
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: idle
|
Sequence: idle
|
||||||
SequencePalette: placebuilding
|
SequenceAlpha: 0.65
|
||||||
WithResourceStoragePipsDecoration:
|
WithResourceStoragePipsDecoration:
|
||||||
Position: BottomLeft
|
Position: BottomLeft
|
||||||
Margin: 4, 3
|
Margin: 4, 3
|
||||||
|
|||||||
@@ -324,9 +324,10 @@
|
|||||||
TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement
|
TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement
|
||||||
UndeploySounds: cashturn.aud
|
UndeploySounds: cashturn.aud
|
||||||
ActorPreviewPlaceBuildingPreview:
|
ActorPreviewPlaceBuildingPreview:
|
||||||
Palette: placefootprint
|
Palette: ra
|
||||||
LineBuildSegmentPalette: placelinesegment
|
FootprintAlpha: 0.7
|
||||||
OverridePalette: placebuilding
|
LineBuildFootprintAlpha: 0.5
|
||||||
|
PreviewAlpha: 0.55
|
||||||
FootprintUnderPreview: Valid, LineBuild, Invalid
|
FootprintUnderPreview: Valid, LineBuild, Invalid
|
||||||
FootprintOverPreview: None
|
FootprintOverPreview: None
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
@@ -483,8 +484,9 @@
|
|||||||
TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement
|
TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement
|
||||||
UndeploySounds: cashturn.aud
|
UndeploySounds: cashturn.aud
|
||||||
FootprintPlaceBuildingPreview:
|
FootprintPlaceBuildingPreview:
|
||||||
Palette: placefootprint
|
Palette: ra
|
||||||
LineBuildSegmentPalette: placelinesegment
|
FootprintAlpha: 0.7
|
||||||
|
LineBuildFootprintAlpha: 0.5
|
||||||
RequiresBuildableArea:
|
RequiresBuildableArea:
|
||||||
AreaTypes: building
|
AreaTypes: building
|
||||||
Adjacent: 7
|
Adjacent: 7
|
||||||
@@ -533,8 +535,9 @@
|
|||||||
UndeploySounds: cashturn.aud
|
UndeploySounds: cashturn.aud
|
||||||
SequencePlaceBuildingPreview:
|
SequencePlaceBuildingPreview:
|
||||||
Sequence: place
|
Sequence: place
|
||||||
SequencePalette: placebuilding
|
Palette: ra
|
||||||
Palette: placefootprint
|
FootprintAlpha: 0.7
|
||||||
|
SequenceAlpha: 0.55
|
||||||
KillsSelf:
|
KillsSelf:
|
||||||
RemoveInstead: true
|
RemoveInstead: true
|
||||||
RenderSprites:
|
RenderSprites:
|
||||||
|
|||||||
@@ -129,18 +129,6 @@
|
|||||||
PlayerColorPalette:
|
PlayerColorPalette:
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
RemapIndex: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
|
RemapIndex: 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
|
||||||
PaletteFromPaletteWithAlpha@placebuilding:
|
|
||||||
Name: placefootprint
|
|
||||||
BasePalette: ra
|
|
||||||
Alpha: 0.7
|
|
||||||
PaletteFromPaletteWithAlpha@placelinesegment:
|
|
||||||
Name: placelinesegment
|
|
||||||
BasePalette: ra
|
|
||||||
Alpha: 0.5
|
|
||||||
PaletteFromPlayerPaletteWithAlpha@placebuilding:
|
|
||||||
BaseName: placebuilding
|
|
||||||
BasePalette: player
|
|
||||||
Alpha: 0.55
|
|
||||||
PaletteFromPlayerPaletteWithAlpha@cloak:
|
PaletteFromPlayerPaletteWithAlpha@cloak:
|
||||||
BaseName: cloak
|
BaseName: cloak
|
||||||
BasePalette: player
|
BasePalette: player
|
||||||
|
|||||||
@@ -378,6 +378,7 @@ EditorWorld:
|
|||||||
EditorCursorLayer:
|
EditorCursorLayer:
|
||||||
EditorResourceLayer:
|
EditorResourceLayer:
|
||||||
EditorSelectionLayer:
|
EditorSelectionLayer:
|
||||||
Palette: placefootprint
|
Palette: ra
|
||||||
|
FootprintAlpha: 0.7
|
||||||
LoadWidgetAtGameStart:
|
LoadWidgetAtGameStart:
|
||||||
EditorActionManager:
|
EditorActionManager:
|
||||||
|
|||||||
Reference in New Issue
Block a user