Add lobby ready count to game ticker info during pregame (#12157)
* add lobby ready count to game ticker info * Update Resources/Locale/en-US/game-ticking/game-ticker.ftl Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com> * simplify get info loc Co-authored-by: Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
using System.Linq;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Content.Server.Station.Systems;
|
using Content.Server.Station.Systems;
|
||||||
using Content.Server.Station.Components;
|
using Content.Server.Station.Components;
|
||||||
@@ -42,8 +43,9 @@ namespace Content.Server.GameTicking
|
|||||||
{
|
{
|
||||||
return string.Empty;
|
return string.Empty;
|
||||||
}
|
}
|
||||||
|
|
||||||
var playerCount = $"{_playerManager.PlayerCount}";
|
var playerCount = $"{_playerManager.PlayerCount}";
|
||||||
|
var readyCount = _playerGameStatuses.Values.Count(x => x == PlayerGameStatus.ReadyToPlay);
|
||||||
|
|
||||||
StringBuilder stationNames = new StringBuilder();
|
StringBuilder stationNames = new StringBuilder();
|
||||||
if (_stationSystem.Stations.Count != 0)
|
if (_stationSystem.Stations.Count != 0)
|
||||||
@@ -65,10 +67,11 @@ namespace Content.Server.GameTicking
|
|||||||
{
|
{
|
||||||
stationNames.Append(Loc.GetString("game-ticker-no-map-selected"));
|
stationNames.Append(Loc.GetString("game-ticker-no-map-selected"));
|
||||||
}
|
}
|
||||||
|
|
||||||
var gmTitle = Loc.GetString(Preset.ModeTitle);
|
var gmTitle = Loc.GetString(Preset.ModeTitle);
|
||||||
var desc = Loc.GetString(Preset.Description);
|
var desc = Loc.GetString(Preset.Description);
|
||||||
return Loc.GetString("game-ticker-get-info-text",("roundId", RoundId), ("playerCount", playerCount),("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
|
return Loc.GetString(RunLevel == GameRunLevel.PreRoundLobby ? "game-ticker-get-info-preround-text" : "game-ticker-get-info-text",
|
||||||
|
("roundId", RoundId), ("playerCount", playerCount), ("readyCount", readyCount), ("mapName", stationNames.ToString()),("gmTitle", gmTitle),("desc", desc));
|
||||||
}
|
}
|
||||||
|
|
||||||
private TickerLobbyReadyEvent GetStatusSingle(ICommonSession player, PlayerGameStatus gameStatus)
|
private TickerLobbyReadyEvent GetStatusSingle(ICommonSession player, PlayerGameStatus gameStatus)
|
||||||
@@ -169,6 +172,8 @@ namespace Content.Server.GameTicking
|
|||||||
_playerGameStatuses[player.UserId] = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
_playerGameStatuses[player.UserId] = ready ? PlayerGameStatus.ReadyToPlay : PlayerGameStatus.NotReadyToPlay;
|
||||||
RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
|
RaiseNetworkEvent(GetStatusMsg(player), player.ConnectedClient);
|
||||||
RaiseNetworkEvent(GetStatusSingle(player, status));
|
RaiseNetworkEvent(GetStatusSingle(player, status));
|
||||||
|
// update server info to reflect new ready count
|
||||||
|
UpdateInfoText();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -243,6 +243,7 @@ namespace Content.Server.GameTicking
|
|||||||
ReqWindowAttentionAll();
|
ReqWindowAttentionAll();
|
||||||
UpdateLateJoinStatus();
|
UpdateLateJoinStatus();
|
||||||
AnnounceRound();
|
AnnounceRound();
|
||||||
|
UpdateInfoText();
|
||||||
|
|
||||||
#if EXCEPTION_TOLERANCE
|
#if EXCEPTION_TOLERANCE
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,15 @@ game-ticker-get-info-text = Hi and welcome to [color=white]Space Station 14![/co
|
|||||||
The current map is: [color=white]{$mapName}[/color]
|
The current map is: [color=white]{$mapName}[/color]
|
||||||
The current game mode is: [color=white]{$gmTitle}[/color]
|
The current game mode is: [color=white]{$gmTitle}[/color]
|
||||||
>[color=yellow]{$desc}[/color]
|
>[color=yellow]{$desc}[/color]
|
||||||
|
game-ticker-get-info-preround-text = Hi and welcome to [color=white]Space Station 14![/color]
|
||||||
|
The current round is: [color=white]#{$roundId}[/color]
|
||||||
|
The current player count is: [color=white]{$playerCount}[/color] ([color=white]{$readyCount}[/color] {$readyCount ->
|
||||||
|
[one] is
|
||||||
|
*[other] are
|
||||||
|
} ready)
|
||||||
|
The current map is: [color=white]{$mapName}[/color]
|
||||||
|
The current game mode is: [color=white]{$gmTitle}[/color]
|
||||||
|
>[color=yellow]{$desc}[/color]
|
||||||
game-ticker-no-map-selected = [color=yellow]Map not yet selected![/color]
|
game-ticker-no-map-selected = [color=yellow]Map not yet selected![/color]
|
||||||
game-ticker-player-no-jobs-available-when-joining = When attempting to join to the game, no jobs were available.
|
game-ticker-player-no-jobs-available-when-joining = When attempting to join to the game, no jobs were available.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user