Use original RA and TD footprint artwork.
This commit is contained in:
@@ -31,16 +31,16 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
[PaletteReference]
|
||||
public readonly string TargetOverlayPalette = TileSet.TerrainPaletteInternalName;
|
||||
|
||||
public readonly string OverlaySpriteGroup = "overlay";
|
||||
public readonly string FootprintImage = "overlay";
|
||||
|
||||
[SequenceReference("OverlaySpriteGroup", true)]
|
||||
public readonly string ValidTileSequencePrefix = "target-valid-";
|
||||
[SequenceReference("FootprintImage", true)]
|
||||
public readonly string ValidFootprintSequence = "target-valid";
|
||||
|
||||
[SequenceReference("OverlaySpriteGroup")]
|
||||
public readonly string InvalidTileSequence = "target-invalid";
|
||||
[SequenceReference("FootprintImage")]
|
||||
public readonly string InvalidFootprintSequence = "target-invalid";
|
||||
|
||||
[SequenceReference("OverlaySpriteGroup")]
|
||||
public readonly string SourceTileSequence = "target-select";
|
||||
[SequenceReference("FootprintImage")]
|
||||
public readonly string SourceFootprintSequence = "target-select";
|
||||
|
||||
public readonly bool KillCargo = true;
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
|
||||
var info = (ChronoshiftPowerInfo)power.Info;
|
||||
range = info.Range;
|
||||
tile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.SourceTileSequence).GetSprite(0);
|
||||
tile = world.Map.Rules.Sequences.GetSequence(info.FootprintImage, info.SourceFootprintSequence).GetSprite(0);
|
||||
}
|
||||
|
||||
protected override IEnumerable<Order> OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||
@@ -216,10 +216,15 @@ namespace OpenRA.Mods.Cnc.Traits
|
||||
var info = (ChronoshiftPowerInfo)power.Info;
|
||||
range = info.Range;
|
||||
|
||||
var tileset = world.Map.Tileset.ToLowerInvariant();
|
||||
validTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.ValidTileSequencePrefix + tileset).GetSprite(0);
|
||||
invalidTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.InvalidTileSequence).GetSprite(0);
|
||||
sourceTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.SourceTileSequence).GetSprite(0);
|
||||
var sequences = world.Map.Rules.Sequences;
|
||||
var tilesetValid = info.ValidFootprintSequence + "-" + world.Map.Tileset.ToLowerInvariant();
|
||||
if (sequences.HasSequence(info.FootprintImage, tilesetValid))
|
||||
validTile = sequences.GetSequence(info.FootprintImage, tilesetValid).GetSprite(0);
|
||||
else
|
||||
validTile = sequences.GetSequence(info.FootprintImage, info.ValidFootprintSequence).GetSprite(0);
|
||||
|
||||
invalidTile = sequences.GetSequence(info.FootprintImage, info.InvalidFootprintSequence).GetSprite(0);
|
||||
sourceTile = sequences.GetSequence(info.FootprintImage, info.SourceFootprintSequence).GetSprite(0);
|
||||
}
|
||||
|
||||
protected override IEnumerable<Order> OrderInner(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2019 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;
|
||||
|
||||
namespace OpenRA.Mods.Common.UpdateRules.Rules
|
||||
{
|
||||
public class RenameChronoshiftFootprint : UpdateRule
|
||||
{
|
||||
public override string Name { get { return "Rename footprint related ChronoshiftPower parameters"; } }
|
||||
public override string Description
|
||||
{
|
||||
get
|
||||
{
|
||||
return "The parameters that define the footprint tiles to use in ChronoshiftPower\n" +
|
||||
"are renamed to follow standard conventions.";
|
||||
}
|
||||
}
|
||||
|
||||
public override IEnumerable<string> UpdateActorNode(ModData modData, MiniYamlNode actorNode)
|
||||
{
|
||||
// Repairable isn't conditional or otherwise supports multiple traits, so LastChildMatching should be fine.
|
||||
foreach (var placeBuilding in actorNode.ChildrenMatching("ChronoshiftPower"))
|
||||
{
|
||||
placeBuilding.RenameChildrenMatching("OverlaySpriteGroup", "FootprintImage");
|
||||
placeBuilding.RenameChildrenMatching("InvalidTileSequencePrefix", "InvalidFootprintSequence");
|
||||
placeBuilding.RenameChildrenMatching("SourceTileSequencePrefix", "SourceFootprintSequence");
|
||||
foreach (var valid in placeBuilding.ChildrenMatching("ValidTileSequencePrefix"))
|
||||
{
|
||||
valid.RenameKey("ValidFootprintSequence");
|
||||
valid.Value.Value = valid.Value.Value.Substring(0, valid.Value.Value.Length - 1);
|
||||
}
|
||||
}
|
||||
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
@@ -268,24 +268,16 @@ pips:
|
||||
Offset: -3, 0
|
||||
|
||||
overlay:
|
||||
build-valid-desert:
|
||||
build-valid-snow:
|
||||
Start: 2
|
||||
build-valid-temperat:
|
||||
build-valid-winter:
|
||||
build-valid-jungle:
|
||||
Defaults: trans.icn
|
||||
AddExtension: False
|
||||
build-valid:
|
||||
build-invalid:
|
||||
Start: 1
|
||||
target-select:
|
||||
Start: 3
|
||||
target-valid-desert:
|
||||
target-valid-snow:
|
||||
Start: 2
|
||||
target-valid-temperat:
|
||||
target-valid-winter:
|
||||
target-valid-jungle:
|
||||
target-invalid:
|
||||
target-valid:
|
||||
target-select:
|
||||
Start: 1
|
||||
target-invalid:
|
||||
Start: 2
|
||||
|
||||
editor-overlay:
|
||||
copy: overlay
|
||||
|
||||
Binary file not shown.
@@ -529,22 +529,16 @@ minv:
|
||||
icon: jmin
|
||||
|
||||
overlay:
|
||||
build-valid-desert:
|
||||
build-valid-interior:
|
||||
build-valid-snow:
|
||||
Start: 2
|
||||
build-valid-temperat:
|
||||
Defaults: trans.icn
|
||||
AddExtension: False
|
||||
build-valid:
|
||||
build-invalid:
|
||||
Start: 1
|
||||
Start: 2
|
||||
target-valid:
|
||||
target-select:
|
||||
Start: 2
|
||||
target-valid-desert:
|
||||
target-valid-interior:
|
||||
target-valid-snow:
|
||||
Start: 2
|
||||
target-valid-temperat:
|
||||
target-invalid:
|
||||
Start: 1
|
||||
target-invalid:
|
||||
Start: 2
|
||||
|
||||
editor-overlay:
|
||||
copy: overlay
|
||||
|
||||
Reference in New Issue
Block a user