mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-10 15:35:54 +00:00
Door link fix
This commit is contained in:
parent
8c20e6f342
commit
cae1f99949
5 changed files with 86 additions and 33 deletions
|
|
@ -15,7 +15,7 @@ public partial class Minimap : CanvasLayer
|
|||
private List<RogueliteRoom> SpawnedRooms => RoomManager.SpawnedRooms;
|
||||
|
||||
private List<RoomConnection> Connections => RoomManager.Connections;
|
||||
|
||||
|
||||
[Export] public int CellSize { get; private set; } = 16;
|
||||
[Export] public Vector2 Padding { get; private set; } = new Vector2(20, 20);
|
||||
|
||||
|
|
@ -91,20 +91,32 @@ public partial class Minimap : CanvasLayer
|
|||
|
||||
RenderingServer.CanvasItemAddRect(_canvasItemRid, new Rect2(drawPos, drawSize), color);
|
||||
}
|
||||
|
||||
DrawRoomConnections(Connections, min, offset);
|
||||
|
||||
DrawRoomConnections( Connections, min, offset);
|
||||
//DrawDebugGrid();
|
||||
}
|
||||
|
||||
|
||||
private void DrawDebugGrid()
|
||||
{
|
||||
foreach (var room in SpawnedRooms)
|
||||
{
|
||||
var rect = new Rect2(room.GridPosition * RoomManager.TileSize * RoomManager.RoomSizeInTiles, RoomManager.TileSize * RoomManager.RoomSizeInTiles);
|
||||
|
||||
RenderingServer.CanvasItemAddRect(_canvasItemRid, rect, new Color(0, 120,0, 125));
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawRoomConnections(List<RoomConnection> connections, Vector2I minGrid, Vector2 baseOffset)
|
||||
{
|
||||
int spacing = (int)Separation;
|
||||
|
||||
|
||||
foreach (var connection in connections)
|
||||
{
|
||||
// Skip if either room is missing
|
||||
if (!RoomGrid.ContainsKey(connection.From) || !RoomGrid.ContainsKey(connection.To))
|
||||
continue;
|
||||
|
||||
|
||||
// Convert grid coordinates to local minimap grid (relative to min)
|
||||
Vector2I fromGrid = connection.From - minGrid;
|
||||
Vector2I toGrid = connection.To - minGrid;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue