Refactor GameMapManager a bit (nukes mapforced) (#11513)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Closes https://github.com/space-wizards/space-station-14/issues/7192 Closes https://github.com/space-wizards/space-station-14/issues/6537 Closes https://github.com/space-wizards/space-station-14/issues/9579
This commit is contained in:
@@ -1,8 +1,11 @@
|
||||
using Content.Shared.GameTicking;
|
||||
using Content.Server.Station.Systems;
|
||||
using Content.Server.Station.Components;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Players;
|
||||
using System.Text;
|
||||
|
||||
namespace Content.Server.GameTicking
|
||||
{
|
||||
@@ -39,13 +42,33 @@ namespace Content.Server.GameTicking
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
var playerCount = $"{_playerManager.PlayerCount}";
|
||||
var map = _gameMapManager.GetSelectedMap();
|
||||
var mapName = map?.MapName ?? Loc.GetString("game-ticker-no-map-selected");
|
||||
|
||||
StringBuilder stationNames = new StringBuilder();
|
||||
if (_stationSystem.Stations.Count != 0)
|
||||
{
|
||||
foreach (EntityUid entUID in _stationSystem.Stations)
|
||||
{
|
||||
StationDataComponent? stationData = null;
|
||||
MetaDataComponent? metaData = null;
|
||||
if (Resolve(entUID, ref stationData, ref metaData, logMissing: true))
|
||||
{
|
||||
if (stationNames.Length > 0)
|
||||
stationNames.Append('\n');
|
||||
|
||||
stationNames.Append(metaData.EntityName);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
stationNames.Append(Loc.GetString("game-ticker-no-map-selected"));
|
||||
}
|
||||
|
||||
var gmTitle = Loc.GetString(Preset.ModeTitle);
|
||||
var desc = Loc.GetString(Preset.Description);
|
||||
return Loc.GetString("game-ticker-get-info-text",("roundId", RoundId), ("playerCount", playerCount),("mapName", mapName),("gmTitle", gmTitle),("desc", desc));
|
||||
return Loc.GetString("game-ticker-get-info-text",("roundId", RoundId), ("playerCount", playerCount),("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
|
||||
}
|
||||
|
||||
private TickerLobbyReadyEvent GetStatusSingle(ICommonSession player, PlayerGameStatus gameStatus)
|
||||
|
||||
Reference in New Issue
Block a user