mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 03:30:53 +01:00
Add tile overlay edge priority (#4341)
This commit is contained in:
@@ -61,11 +61,16 @@ public sealed class TileEdgeOverlay : Overlay
|
||||
|
||||
var neighborIndices = new Vector2i(tileRef.GridIndices.X + x, tileRef.GridIndices.Y + y);
|
||||
var neighborTile = grid.GetTileRef(neighborIndices);
|
||||
var neighborDef = _tileDefManager[neighborTile.Tile.TypeId];
|
||||
|
||||
// If it's the same tile then no edge to be drawn.
|
||||
if (tileRef.Tile.TypeId == neighborTile.Tile.TypeId)
|
||||
continue;
|
||||
|
||||
// Don't draw if the the neighbor tile edges should draw over us (or if we have the same priority)
|
||||
if (neighborDef.EdgeSprites.Count != 0 && neighborDef.EdgeSpritePriority >= tileDef.EdgeSpritePriority)
|
||||
continue;
|
||||
|
||||
var direction = new Vector2i(x, y).AsDirection();
|
||||
|
||||
// No edge tile
|
||||
|
||||
@@ -30,10 +30,16 @@ namespace Robust.Shared.Map
|
||||
ResPath? Sprite { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Possible sprites to use if we're neighboring another tile.
|
||||
/// Possible sprites to use if we're neighboring another tile.
|
||||
/// </summary>
|
||||
Dictionary<Direction, ResPath> EdgeSprites { get; }
|
||||
|
||||
/// <summary>
|
||||
/// When drawing adjacent tiles that both specify edge sprites, the one with the higher priority
|
||||
/// is always solely drawn.
|
||||
/// </summary>
|
||||
int EdgeSpritePriority { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Physics objects that are interacting on this tile are slowed down by this float.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user