Random station names! (#5548)

This commit is contained in:
Moony
2021-11-26 07:54:32 -06:00
committed by GitHub
parent 522cb3cf9c
commit f60484b15c
9 changed files with 83 additions and 10 deletions

View File

@@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Content.Server.Chat.Managers;
using Content.Shared.CCVar;
using Robust.Server.Maps;
using Robust.Server.Player;
using Robust.Shared.Configuration;
using Robust.Shared.IoC;
@@ -20,6 +21,7 @@ public class GameMapManager : IGameMapManager
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly IChatManager _chatManager = default!;
[Dependency] private readonly IMapLoader _mapLoader = default!;
private GameMapPrototype _currentMap = default!;
private bool _currentMapForced;
@@ -116,4 +118,12 @@ public class GameMapManager : IGameMapManager
{
return _prototypeManager.TryIndex(gameMap, out map);
}
}
public string GenerateMapName(GameMapPrototype gameMap)
{
if (gameMap.NameGenerator is not null && gameMap.MapNameTemplate is not null)
return gameMap.NameGenerator.FormatName(gameMap.MapNameTemplate);
else
return gameMap.MapName;
}
}