Tiles Name->ID, DisplayName->Name (#5991)
This commit is contained in:
@@ -34,7 +34,7 @@ namespace Content.Shared.Construction.Conditions
|
||||
var tile = tileFound.Value.Tile.GetContentTileDefinition();
|
||||
foreach (var targetTile in TargetTiles)
|
||||
{
|
||||
if (tile.Name == targetTile) {
|
||||
if (tile.ID == targetTile) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Content.Shared.Entry
|
||||
var prototypeList = new List<ContentTileDefinition>();
|
||||
foreach (var tileDef in _prototypeManager.EnumeratePrototypes<ContentTileDefinition>())
|
||||
{
|
||||
if (tileDef.Name == "space")
|
||||
if (tileDef.ID == "space")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ namespace Content.Shared.Entry
|
||||
|
||||
// Sort ordinal to ensure it's consistent client and server.
|
||||
// So that tile IDs match up.
|
||||
prototypeList.Sort((a, b) => string.Compare(a.Name, b.Name, StringComparison.Ordinal));
|
||||
prototypeList.Sort((a, b) => string.Compare(a.ID, b.ID, StringComparison.Ordinal));
|
||||
|
||||
foreach (var tileDef in prototypeList)
|
||||
{
|
||||
|
||||
@@ -4,7 +4,6 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
|
||||
using Robust.Shared.ViewVariables;
|
||||
using System.Collections.Generic;
|
||||
using Content.Shared.Atmos;
|
||||
|
||||
@@ -14,9 +13,6 @@ namespace Content.Shared.Maps
|
||||
[Prototype("tile")]
|
||||
public sealed class ContentTileDefinition : IPrototype, IInheritingPrototype, ITileDefinition
|
||||
{
|
||||
[ViewVariables]
|
||||
string IPrototype.ID => Name;
|
||||
|
||||
[DataField("parent", customTypeSerializer:typeof(PrototypeIdSerializer<ContentTileDefinition>))]
|
||||
public string? Parent { get; private set; }
|
||||
|
||||
@@ -26,11 +22,11 @@ namespace Content.Shared.Maps
|
||||
|
||||
public string Path => "/Textures/Tiles/";
|
||||
|
||||
[DataField("name", required: true)] public string Name { get; } = string.Empty;
|
||||
[DataField("id", required: true)] public string ID { get; } = string.Empty;
|
||||
|
||||
public ushort TileId { get; private set; }
|
||||
|
||||
[DataField("display_name")] public string DisplayName { get; } = string.Empty;
|
||||
[DataField("name")] public string Name { get; } = string.Empty;
|
||||
|
||||
[DataField("texture")] public string SpriteName { get; } = string.Empty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user