diff --git a/OpenRA.Mods.Common/Traits/Buildings/ActorPreviewPlaceBuildingPreview.cs b/OpenRA.Mods.Common/Traits/Buildings/ActorPreviewPlaceBuildingPreview.cs index f46e410bf5..6fb225dea7 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/ActorPreviewPlaceBuildingPreview.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/ActorPreviewPlaceBuildingPreview.cs @@ -25,12 +25,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Enable the building's idle animation.")] public readonly bool Animated = true; - [PaletteReference(nameof(OverridePaletteIsPlayerPalette))] - [Desc("Custom palette name.")] - public readonly string OverridePalette = null; - - [Desc("Custom palette is a player palette BaseName.")] - public readonly bool OverridePaletteIsPlayerPalette = true; + [Desc("Custom opacity to apply to the actor preview.")] + public readonly float PreviewAlpha = 1f; [Desc("Footprint types to draw underneath the actor preview.")] public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild; @@ -54,7 +50,6 @@ namespace OpenRA.Mods.Common.Traits public class ActorPreviewPlaceBuildingPreviewPreview : FootprintPlaceBuildingPreviewPreview { readonly ActorPreviewPlaceBuildingPreviewInfo info; - readonly PaletteReference palette; readonly IActorPreview[] preview; public ActorPreviewPlaceBuildingPreviewPreview(WorldRenderer wr, ActorInfo ai, ActorPreviewPlaceBuildingPreviewInfo info, TypeDictionary init) @@ -65,12 +60,6 @@ namespace OpenRA.Mods.Common.Traits preview = actorInfo.TraitInfos() .SelectMany(rpi => rpi.RenderPreview(previewInit)) .ToArray(); - - if (!string.IsNullOrEmpty(info.OverridePalette)) - { - var ownerName = init.Get().InternalName; - palette = wr.Palette(info.OverridePaletteIsPlayerPalette ? info.OverridePalette + ownerName : info.OverridePalette); - } } protected override void TickInner() @@ -88,15 +77,17 @@ namespace OpenRA.Mods.Common.Traits var previewRenderables = preview .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) foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintUnderPreview)) yield return r; 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) foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview)) diff --git a/OpenRA.Mods.Common/Traits/Buildings/FootprintPlaceBuildingPreview.cs b/OpenRA.Mods.Common/Traits/Buildings/FootprintPlaceBuildingPreview.cs index 949d21bbb9..ccc11d64c9 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FootprintPlaceBuildingPreview.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FootprintPlaceBuildingPreview.cs @@ -25,9 +25,11 @@ namespace OpenRA.Mods.Common.Traits [Desc("Palette to use for rendering the placement sprite.")] public readonly string Palette = TileSet.TerrainPaletteInternalName; - [PaletteReference] - [Desc("Palette to use for rendering the placement sprite for line build segments.")] - public readonly string LineBuildSegmentPalette = TileSet.TerrainPaletteInternalName; + [Desc("Custom opacity to apply to the placement sprite.")] + public readonly float FootprintAlpha = 1f; + + [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) { @@ -52,12 +54,6 @@ namespace OpenRA.Mods.Common.Traits readonly Sprite buildOk; 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) { actorInfo = ai; @@ -81,19 +77,18 @@ namespace OpenRA.Mods.Common.Traits protected virtual IEnumerable RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary footprint, PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild) { - var cellPalette = wr.Palette(info.Palette); - var linePalette = wr.Palette(info.LineBuildSegmentPalette); + var palette = wr.Palette(info.Palette); var topLeftPos = wr.World.Map.CenterOfCell(topLeft); foreach (var c in footprint) { if ((c.Value & filter) == 0) continue; - var tile = HasFlag(c.Value, PlaceBuildingCellType.Invalid) ? buildBlocked : buildOk; - var pal = HasFlag(c.Value, PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette; + var tile = (c.Value & PlaceBuildingCellType.Invalid) != 0 ? buildBlocked : buildOk; var pos = wr.World.Map.CenterOfCell(c.Key); 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 RenderInner(WorldRenderer wr, CPos topLeft, Dictionary footprint) { - foreach (var r in RenderFootprint(wr, topLeft, footprint)) - yield return r; + return RenderFootprint(wr, topLeft, footprint); } IEnumerable IPlaceBuildingPreview.Render(WorldRenderer wr, CPos topLeft, Dictionary footprint) diff --git a/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs b/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs index 29e38463aa..3392c09ed2 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/SequencePlaceBuildingPreview.cs @@ -25,12 +25,8 @@ namespace OpenRA.Mods.Common.Traits [Desc("Sequence name to use.")] public readonly string Sequence = "idle"; - [PaletteReference(nameof(SequencePaletteIsPlayerPalette))] - [Desc("Custom palette name.")] - public readonly string SequencePalette = null; - - [Desc("Custom palette is a player palette BaseName.")] - public readonly bool SequencePaletteIsPlayerPalette = true; + [Desc("Custom opacity to apply to the sequence sprite.")] + public readonly float SequenceAlpha = 1f; [Desc("Footprint types to draw underneath the actor preview.")] public readonly PlaceBuildingCellType FootprintUnderPreview = PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild; @@ -65,12 +61,7 @@ namespace OpenRA.Mods.Common.Traits var faction = init.Get().Value; var rsi = ai.TraitInfo(); - - if (!string.IsNullOrEmpty(info.SequencePalette)) - palette = wr.Palette(info.SequencePaletteIsPlayerPalette ? info.SequencePalette + ownerName : info.SequencePalette); - else - palette = wr.Palette(rsi.Palette ?? rsi.PlayerPalette + ownerName); - + palette = wr.Palette(rsi.Palette ?? rsi.PlayerPalette + ownerName); preview = new Animation(wr.World, rsi.GetImage(ai, wr.World.Map.Rules.Sequences, faction)); preview.PlayRepeating(info.Sequence); } @@ -88,7 +79,12 @@ namespace OpenRA.Mods.Common.Traits var centerPosition = wr.World.Map.CenterOfCell(topLeft) + centerOffset; 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) foreach (var r in RenderFootprint(wr, topLeft, footprint, info.FootprintOverPreview)) diff --git a/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs b/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs index 52522dd53f..43171dca7d 100644 --- a/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/EditorSelectionLayer.cs @@ -22,6 +22,9 @@ namespace OpenRA.Mods.Common.Traits [Desc("Palette to use for rendering the placement sprite.")] 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.")] public readonly string Image = "editor-overlay"; @@ -89,12 +92,12 @@ namespace OpenRA.Mods.Common.Traits if (CopyRegion != null) foreach (var c in CopyRegion) 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) foreach (var c in PasteRegion) 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; } } diff --git a/OpenRA.Mods.Common/UpdateRules/Rules/20201213/RemovePlaceBuildingPalette.cs b/OpenRA.Mods.Common/UpdateRules/Rules/20201213/RemovePlaceBuildingPalette.cs new file mode 100644 index 0000000000..bfe37d3425 --- /dev/null +++ b/OpenRA.Mods.Common/UpdateRules/Rules/20201213/RemovePlaceBuildingPalette.cs @@ -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 locations = new List(); + + public override IEnumerable 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 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; + } + } +} diff --git a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs index 16f2fa3caa..cfbb2b5122 100644 --- a/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs +++ b/OpenRA.Mods.Common/UpdateRules/UpdatePath.cs @@ -88,6 +88,7 @@ namespace OpenRA.Mods.Common.UpdateRules new RemovePlayerHighlightPalette(), new ReplaceWithColoredOverlayPalette(), new RemoveRenderSpritesScale(), + new RemovePlaceBuildingPalette(), }) }; diff --git a/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs b/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs index 8829a0ea05..36bc46ad74 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/D2kActorPreviewPlaceBuildingPreview.cs @@ -72,8 +72,7 @@ namespace OpenRA.Mods.D2k.Traits protected override IEnumerable RenderFootprint(WorldRenderer wr, CPos topLeft, Dictionary footprint, PlaceBuildingCellType filter = PlaceBuildingCellType.Invalid | PlaceBuildingCellType.Valid | PlaceBuildingCellType.LineBuild) { - var cellPalette = wr.Palette(info.Palette); - var linePalette = wr.Palette(info.LineBuildSegmentPalette); + var palette = wr.Palette(info.Palette); var topLeftPos = wr.World.Map.CenterOfCell(topLeft); var candidateSafeTiles = unpathableCells.Update(topLeft); @@ -82,14 +81,14 @@ namespace OpenRA.Mods.D2k.Traits if ((c.Value & filter) == 0) 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)) ? buildUnsafe : buildOk; - var pal = HasFlag(c.Value, PlaceBuildingCellType.LineBuild) ? linePalette : cellPalette; var pos = wr.World.Map.CenterOfCell(c.Key); 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); } } } diff --git a/mods/cnc/rules/campaign-palettes.yaml b/mods/cnc/rules/campaign-palettes.yaml index 138a1bed66..c03156ef9a 100644 --- a/mods/cnc/rules/campaign-palettes.yaml +++ b/mods/cnc/rules/campaign-palettes.yaml @@ -1,6 +1,5 @@ ^Palettes: -PlayerColorPalette: - -PaletteFromPlayerPaletteWithAlpha@placebuilding: IndexedPlayerPalette: BasePalette: terrain 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 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 - PaletteFromPlayerPaletteWithAlpha@Placebuilding: - BaseName: placebuilding - Alpha: 0.65 - BasePalette: player ^Vehicle: RenderSprites: diff --git a/mods/cnc/rules/defaults.yaml b/mods/cnc/rules/defaults.yaml index 6879d0f98f..e120a93b2f 100644 --- a/mods/cnc/rules/defaults.yaml +++ b/mods/cnc/rules/defaults.yaml @@ -679,7 +679,7 @@ Dimensions: 1,1 Footprint: x ActorPreviewPlaceBuildingPreview: - OverridePalette: placebuilding + PreviewAlpha: 0.65 SoundOnDamageTransition: DamagedSounds: xplobig4.aud DestroyedSounds: crumble.aud, xplobig4.aud @@ -850,7 +850,7 @@ BuildSounds: hvydoor1.aud TerrainTypes: Clear,Road FootprintPlaceBuildingPreview: - LineBuildSegmentPalette: placelinesegment + LineBuildFootprintAlpha: 0.65 RequiresBuildableArea: AreaTypes: building Adjacent: 4 diff --git a/mods/cnc/rules/palettes.yaml b/mods/cnc/rules/palettes.yaml index 193981de15..1bccf018f0 100644 --- a/mods/cnc/rules/palettes.yaml +++ b/mods/cnc/rules/palettes.yaml @@ -110,11 +110,3 @@ RotationPaletteEffect@water: ExcludePalettes: effect, chrome RotationBase: 32 - PaletteFromPaletteWithAlpha@placelinesegment: - Name: placelinesegment - BasePalette: terrain - Alpha: 0.65 - PaletteFromPlayerPaletteWithAlpha@placebuilding: - BaseName: placebuilding - Alpha: 0.65 - BasePalette: player diff --git a/mods/cnc/rules/structures.yaml b/mods/cnc/rules/structures.yaml index 8c8b923f3f..5b7c3c9d21 100644 --- a/mods/cnc/rules/structures.yaml +++ b/mods/cnc/rules/structures.yaml @@ -516,7 +516,7 @@ WEAP: -ActorPreviewPlaceBuildingPreview: SequencePlaceBuildingPreview: Sequence: place - SequencePalette: placebuilding + SequenceAlpha: 0.65 HPAD: Inherits: ^BaseBuilding @@ -925,7 +925,7 @@ SAM: -ActorPreviewPlaceBuildingPreview: SequencePlaceBuildingPreview: Sequence: place - SequencePalette: placebuilding + SequenceAlpha: 0.65 OBLI: Inherits: ^Defense diff --git a/mods/d2k/rules/campaign-palettes.yaml b/mods/d2k/rules/campaign-palettes.yaml index f85d4a81a0..140ea3f3f2 100644 --- a/mods/d2k/rules/campaign-palettes.yaml +++ b/mods/d2k/rules/campaign-palettes.yaml @@ -2,7 +2,6 @@ -PlayerColorPalette: -PaletteFromPlayerPaletteWithAlpha@deviatorgas: -PaletteFromPlayerPaletteWithAlpha@cloak: - -PaletteFromPlayerPaletteWithAlpha@placebuilding: IndexedPlayerPalette: BasePalette: d2k BaseName: player @@ -26,7 +25,3 @@ BaseName: cloak BasePalette: player Alpha: 0.55 - PaletteFromPlayerPaletteWithAlpha@Placebuilding: - BaseName: placebuilding - BasePalette: player - Alpha: 0.65 diff --git a/mods/d2k/rules/defaults.yaml b/mods/d2k/rules/defaults.yaml index 5858993d92..dc7698e3ce 100644 --- a/mods/d2k/rules/defaults.yaml +++ b/mods/d2k/rules/defaults.yaml @@ -421,7 +421,7 @@ ConcretePrerequisites: global-auto-concrete D2kActorPreviewPlaceBuildingPreview: RequiresPrerequisites: !global-auto-concrete - OverridePalette: placebuilding + PreviewAlpha: 0.65 RequiresBuildableArea: AreaTypes: building Adjacent: 3 diff --git a/mods/d2k/rules/palettes.yaml b/mods/d2k/rules/palettes.yaml index c29e609a49..6939a6f5c1 100644 --- a/mods/d2k/rules/palettes.yaml +++ b/mods/d2k/rules/palettes.yaml @@ -71,11 +71,3 @@ BaseName: cloak BasePalette: player Alpha: 0.55 - PaletteFromPaletteWithAlpha@placelinesegment: - Name: placelinesegment - BasePalette: terrain - Alpha: 0.65 - PaletteFromPlayerPaletteWithAlpha@placebuilding: - BaseName: placebuilding - BasePalette: player - Alpha: 0.65 diff --git a/mods/d2k/rules/structures.yaml b/mods/d2k/rules/structures.yaml index 54b86ab740..78795b0017 100644 --- a/mods/d2k/rules/structures.yaml +++ b/mods/d2k/rules/structures.yaml @@ -670,7 +670,7 @@ wall: BuildSounds: CHUNG.WAV TerrainTypes: Rock, Concrete FootprintPlaceBuildingPreview: - LineBuildSegmentPalette: placelinesegment + LineBuildFootprintAlpha: 0.65 RequiresBuildableArea: AreaTypes: building Adjacent: 7 diff --git a/mods/ra/rules/campaign-palettes.yaml b/mods/ra/rules/campaign-palettes.yaml index 7775ed160f..005e27625f 100644 --- a/mods/ra/rules/campaign-palettes.yaml +++ b/mods/ra/rules/campaign-palettes.yaml @@ -1,7 +1,6 @@ ^Palettes: -PlayerColorPalette: -PaletteFromPlayerPaletteWithAlpha@cloak: - -PaletteFromPlayerPaletteWithAlpha@placebuilding: IndexedPlayerPalette: BasePalette: player BaseName: player @@ -24,7 +23,3 @@ BaseName: cloak BasePalette: player Alpha: 0.55 - PaletteFromPlayerPaletteWithAlpha@Placebuilding: - BaseName: placebuilding - BasePalette: player - Alpha: 0.65 diff --git a/mods/ra/rules/defaults.yaml b/mods/ra/rules/defaults.yaml index ca0195b899..b289f0d202 100644 --- a/mods/ra/rules/defaults.yaml +++ b/mods/ra/rules/defaults.yaml @@ -652,7 +652,7 @@ BuildSounds: placbldg.aud, build5.aud UndeploySounds: cashturn.aud ActorPreviewPlaceBuildingPreview: - OverridePalette: placebuilding + PreviewAlpha: 0.65 RequiresBuildableArea: AreaTypes: building SoundOnDamageTransition: @@ -760,7 +760,7 @@ TerrainTypes: Clear,Road UndeploySounds: cashturn.aud FootprintPlaceBuildingPreview: - LineBuildSegmentPalette: placelinesegment + LineBuildFootprintAlpha: 0.65 RequiresBuildableArea: AreaTypes: building Adjacent: 7 diff --git a/mods/ra/rules/fakes.yaml b/mods/ra/rules/fakes.yaml index 93b24d268c..62d3e88120 100644 --- a/mods/ra/rules/fakes.yaml +++ b/mods/ra/rules/fakes.yaml @@ -191,7 +191,7 @@ WEAF: -ActorPreviewPlaceBuildingPreview: SequencePlaceBuildingPreview: Sequence: place - SequencePalette: placebuilding + SequenceAlpha: 0.65 DOMF: Inherits: ^FakeBuilding diff --git a/mods/ra/rules/palettes.yaml b/mods/ra/rules/palettes.yaml index d2da6bd035..d822e10c67 100644 --- a/mods/ra/rules/palettes.yaml +++ b/mods/ra/rules/palettes.yaml @@ -94,14 +94,6 @@ ChronoshiftPaletteEffect: FlashPaletteEffect@NUKE: Type: Nuke - PaletteFromPaletteWithAlpha@placelinesegment: - Name: placelinesegment - BasePalette: terrain - Alpha: 0.65 - PaletteFromPlayerPaletteWithAlpha@placebuilding: - BaseName: placebuilding - BasePalette: player - Alpha: 0.65 IndexedPalette@CIV2: Name: civilian2 BasePalette: player diff --git a/mods/ra/rules/structures.yaml b/mods/ra/rules/structures.yaml index 7f18f2a89b..646398648e 100644 --- a/mods/ra/rules/structures.yaml +++ b/mods/ra/rules/structures.yaml @@ -1103,7 +1103,7 @@ WEAP: -ActorPreviewPlaceBuildingPreview: SequencePlaceBuildingPreview: Sequence: place - SequencePalette: placebuilding + SequenceAlpha: 0.65 FACT: Inherits: ^Building @@ -1290,7 +1290,7 @@ PROC: -ActorPreviewPlaceBuildingPreview: SequencePlaceBuildingPreview: Sequence: idle - SequencePalette: placebuilding + SequenceAlpha: 0.65 WithResourceStoragePipsDecoration: Position: BottomLeft Margin: 4, 3 diff --git a/mods/ts/rules/defaults.yaml b/mods/ts/rules/defaults.yaml index e4cc0c1947..b1d8c7222a 100644 --- a/mods/ts/rules/defaults.yaml +++ b/mods/ts/rules/defaults.yaml @@ -324,9 +324,10 @@ TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement UndeploySounds: cashturn.aud ActorPreviewPlaceBuildingPreview: - Palette: placefootprint - LineBuildSegmentPalette: placelinesegment - OverridePalette: placebuilding + Palette: ra + FootprintAlpha: 0.7 + LineBuildFootprintAlpha: 0.5 + PreviewAlpha: 0.55 FootprintUnderPreview: Valid, LineBuild, Invalid FootprintOverPreview: None RequiresBuildableArea: @@ -483,8 +484,9 @@ TerrainTypes: Clear, Rough, Road, DirtRoad, Green, Sand, Pavement UndeploySounds: cashturn.aud FootprintPlaceBuildingPreview: - Palette: placefootprint - LineBuildSegmentPalette: placelinesegment + Palette: ra + FootprintAlpha: 0.7 + LineBuildFootprintAlpha: 0.5 RequiresBuildableArea: AreaTypes: building Adjacent: 7 @@ -533,8 +535,9 @@ UndeploySounds: cashturn.aud SequencePlaceBuildingPreview: Sequence: place - SequencePalette: placebuilding - Palette: placefootprint + Palette: ra + FootprintAlpha: 0.7 + SequenceAlpha: 0.55 KillsSelf: RemoveInstead: true RenderSprites: diff --git a/mods/ts/rules/palettes.yaml b/mods/ts/rules/palettes.yaml index 77fda5e617..e65125c41d 100644 --- a/mods/ts/rules/palettes.yaml +++ b/mods/ts/rules/palettes.yaml @@ -129,18 +129,6 @@ PlayerColorPalette: BasePalette: player 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: BaseName: cloak BasePalette: player diff --git a/mods/ts/rules/world.yaml b/mods/ts/rules/world.yaml index 0102fc2a3f..5beb7e664f 100644 --- a/mods/ts/rules/world.yaml +++ b/mods/ts/rules/world.yaml @@ -378,6 +378,7 @@ EditorWorld: EditorCursorLayer: EditorResourceLayer: EditorSelectionLayer: - Palette: placefootprint + Palette: ra + FootprintAlpha: 0.7 LoadWidgetAtGameStart: EditorActionManager: