Added a directory to station maps (#31156)

* Added directory to station maps

* Add null checks to map directory sorting/filtering

* Reworked station map directory to be more readable and responsive
This commit is contained in:
TGRCDev
2024-09-21 00:33:22 -07:00
committed by GitHub
parent 29e56becb8
commit d32c42f754
6 changed files with 152 additions and 7 deletions

View File

@@ -24,9 +24,16 @@ public sealed class StationMapBoundUserInterface : BoundUserInterface
_window = this.CreateWindow<StationMapWindow>();
_window.Title = EntMan.GetComponent<MetaDataComponent>(Owner).EntityName;
string stationName = string.Empty;
if(EntMan.TryGetComponent<MetaDataComponent>(gridUid, out var gridMetaData))
{
stationName = gridMetaData.EntityName;
}
if (EntMan.TryGetComponent<StationMapComponent>(Owner, out var comp) && comp.ShowLocation)
_window.Set(gridUid, Owner);
_window.Set(stationName, gridUid, Owner);
else
_window.Set(gridUid, null);
_window.Set(stationName, gridUid, null);
}
}