Use original RA and TD footprint artwork.
This commit is contained in:
@@ -31,16 +31,16 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
[PaletteReference]
|
[PaletteReference]
|
||||||
public readonly string TargetOverlayPalette = TileSet.TerrainPaletteInternalName;
|
public readonly string TargetOverlayPalette = TileSet.TerrainPaletteInternalName;
|
||||||
|
|
||||||
public readonly string OverlaySpriteGroup = "overlay";
|
public readonly string FootprintImage = "overlay";
|
||||||
|
|
||||||
[SequenceReference("OverlaySpriteGroup", true)]
|
[SequenceReference("FootprintImage", true)]
|
||||||
public readonly string ValidTileSequencePrefix = "target-valid-";
|
public readonly string ValidFootprintSequence = "target-valid";
|
||||||
|
|
||||||
[SequenceReference("OverlaySpriteGroup")]
|
[SequenceReference("FootprintImage")]
|
||||||
public readonly string InvalidTileSequence = "target-invalid";
|
public readonly string InvalidFootprintSequence = "target-invalid";
|
||||||
|
|
||||||
[SequenceReference("OverlaySpriteGroup")]
|
[SequenceReference("FootprintImage")]
|
||||||
public readonly string SourceTileSequence = "target-select";
|
public readonly string SourceFootprintSequence = "target-select";
|
||||||
|
|
||||||
public readonly bool KillCargo = true;
|
public readonly bool KillCargo = true;
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
|
|
||||||
var info = (ChronoshiftPowerInfo)power.Info;
|
var info = (ChronoshiftPowerInfo)power.Info;
|
||||||
range = info.Range;
|
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)
|
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;
|
var info = (ChronoshiftPowerInfo)power.Info;
|
||||||
range = info.Range;
|
range = info.Range;
|
||||||
|
|
||||||
var tileset = world.Map.Tileset.ToLowerInvariant();
|
var sequences = world.Map.Rules.Sequences;
|
||||||
validTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.ValidTileSequencePrefix + tileset).GetSprite(0);
|
var tilesetValid = info.ValidFootprintSequence + "-" + world.Map.Tileset.ToLowerInvariant();
|
||||||
invalidTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.InvalidTileSequence).GetSprite(0);
|
if (sequences.HasSequence(info.FootprintImage, tilesetValid))
|
||||||
sourceTile = world.Map.Rules.Sequences.GetSequence(info.OverlaySpriteGroup, info.SourceTileSequence).GetSprite(0);
|
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)
|
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
|
Offset: -3, 0
|
||||||
|
|
||||||
overlay:
|
overlay:
|
||||||
build-valid-desert:
|
Defaults: trans.icn
|
||||||
build-valid-snow:
|
AddExtension: False
|
||||||
Start: 2
|
build-valid:
|
||||||
build-valid-temperat:
|
|
||||||
build-valid-winter:
|
|
||||||
build-valid-jungle:
|
|
||||||
build-invalid:
|
build-invalid:
|
||||||
Start: 1
|
|
||||||
target-select:
|
|
||||||
Start: 3
|
|
||||||
target-valid-desert:
|
|
||||||
target-valid-snow:
|
|
||||||
Start: 2
|
Start: 2
|
||||||
target-valid-temperat:
|
target-valid:
|
||||||
target-valid-winter:
|
target-select:
|
||||||
target-valid-jungle:
|
|
||||||
target-invalid:
|
|
||||||
Start: 1
|
Start: 1
|
||||||
|
target-invalid:
|
||||||
|
Start: 2
|
||||||
|
|
||||||
editor-overlay:
|
editor-overlay:
|
||||||
copy: overlay
|
copy: overlay
|
||||||
|
|||||||
Binary file not shown.
@@ -529,22 +529,16 @@ minv:
|
|||||||
icon: jmin
|
icon: jmin
|
||||||
|
|
||||||
overlay:
|
overlay:
|
||||||
build-valid-desert:
|
Defaults: trans.icn
|
||||||
build-valid-interior:
|
AddExtension: False
|
||||||
build-valid-snow:
|
build-valid:
|
||||||
Start: 2
|
|
||||||
build-valid-temperat:
|
|
||||||
build-invalid:
|
build-invalid:
|
||||||
Start: 1
|
Start: 2
|
||||||
|
target-valid:
|
||||||
target-select:
|
target-select:
|
||||||
Start: 2
|
|
||||||
target-valid-desert:
|
|
||||||
target-valid-interior:
|
|
||||||
target-valid-snow:
|
|
||||||
Start: 2
|
|
||||||
target-valid-temperat:
|
|
||||||
target-invalid:
|
|
||||||
Start: 1
|
Start: 1
|
||||||
|
target-invalid:
|
||||||
|
Start: 2
|
||||||
|
|
||||||
editor-overlay:
|
editor-overlay:
|
||||||
copy: overlay
|
copy: overlay
|
||||||
|
|||||||
Reference in New Issue
Block a user