Add current station time to game lobby (#9665)
Co-authored-by: Kara <lunarautomaton6@gmail.com>
This commit is contained in:
@@ -32,6 +32,7 @@ namespace Content.Client.GameTicking.Managers
|
|||||||
[ViewVariables] public bool DisallowedLateJoin { get; private set; }
|
[ViewVariables] public bool DisallowedLateJoin { get; private set; }
|
||||||
[ViewVariables] public string? ServerInfoBlob { get; private set; }
|
[ViewVariables] public string? ServerInfoBlob { get; private set; }
|
||||||
[ViewVariables] public TimeSpan StartTime { get; private set; }
|
[ViewVariables] public TimeSpan StartTime { get; private set; }
|
||||||
|
[ViewVariables] public TimeSpan RoundStartTimeSpan { get; private set; }
|
||||||
[ViewVariables] public new bool Paused { get; private set; }
|
[ViewVariables] public new bool Paused { get; private set; }
|
||||||
[ViewVariables] public Dictionary<NetUserId, LobbyPlayerStatus> Status { get; private set; } = new();
|
[ViewVariables] public Dictionary<NetUserId, LobbyPlayerStatus> Status { get; private set; } = new();
|
||||||
[ViewVariables] public IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>> JobsAvailable => _jobsAvailable;
|
[ViewVariables] public IReadOnlyDictionary<EntityUid, Dictionary<string, uint?>> JobsAvailable => _jobsAvailable;
|
||||||
@@ -87,6 +88,7 @@ namespace Content.Client.GameTicking.Managers
|
|||||||
private void LobbyStatus(TickerLobbyStatusEvent message)
|
private void LobbyStatus(TickerLobbyStatusEvent message)
|
||||||
{
|
{
|
||||||
StartTime = message.StartTime;
|
StartTime = message.StartTime;
|
||||||
|
RoundStartTimeSpan = message.RoundStartTimeSpan;
|
||||||
IsGameStarted = message.IsRoundStarted;
|
IsGameStarted = message.IsRoundStarted;
|
||||||
AreWeReady = message.YouAreReady;
|
AreWeReady = message.YouAreReady;
|
||||||
LobbySong = message.LobbySong;
|
LobbySong = message.LobbySong;
|
||||||
|
|||||||
@@ -136,6 +136,7 @@ namespace Content.Client.Lobby
|
|||||||
if (gameTicker.IsGameStarted)
|
if (gameTicker.IsGameStarted)
|
||||||
{
|
{
|
||||||
_lobby.StartTime.Text = string.Empty;
|
_lobby.StartTime.Text = string.Empty;
|
||||||
|
_lobby.StationTime.Text = Loc.GetString("lobby-state-player-status-station-time", ("stationTime", _gameTiming.RealTime.Subtract(_gameTicker.RoundStartTimeSpan).ToString("hh\\:mm")));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,6 +160,7 @@ namespace Content.Client.Lobby
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_lobby.StationTime.Text = Loc.GetString("lobby-state-player-status-station-time", ("stationTime", TimeSpan.Zero.ToString("hh\\:mm")));
|
||||||
_lobby.StartTime.Text = Loc.GetString("lobby-state-round-start-countdown-text", ("timeLeft", text));
|
_lobby.StartTime.Text = Loc.GetString("lobby-state-round-start-countdown-text", ("timeLeft", text));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,7 @@
|
|||||||
<!-- Server info -->
|
<!-- Server info -->
|
||||||
<hudUi:NanoHeading Text="{Loc 'ui-lobby-server-info-block'}" />
|
<hudUi:NanoHeading Text="{Loc 'ui-lobby-server-info-block'}" />
|
||||||
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false" Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left"/>
|
<info:ServerInfo Name="ServerInfo" Access="Public" MinSize="0 30" VerticalExpand="false" Margin="3 3 3 3" MaxWidth="400" HorizontalAlignment="Left"/>
|
||||||
|
<Label Name="StationTime" Access="Public" FontColorOverride="{x:Static maths:Color.LightGray}" Margin="3 3 3 3" HorizontalAlignment="Left"/>
|
||||||
<ui:HSpacer Spacing="5"/>
|
<ui:HSpacer Spacing="5"/>
|
||||||
<lobbyUi:LobbyCharacterPreviewPanel Name="CharacterPreview" Access="Public"></lobbyUi:LobbyCharacterPreviewPanel>
|
<lobbyUi:LobbyCharacterPreviewPanel Name="CharacterPreview" Access="Public"></lobbyUi:LobbyCharacterPreviewPanel>
|
||||||
<ui:HSpacer Spacing="5"/>
|
<ui:HSpacer Spacing="5"/>
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ namespace Content.Server.GameTicking
|
|||||||
private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
|
private TickerLobbyStatusEvent GetStatusMsg(IPlayerSession session)
|
||||||
{
|
{
|
||||||
_playersInLobby.TryGetValue(session, out var status);
|
_playersInLobby.TryGetValue(session, out var status);
|
||||||
return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground,status == LobbyPlayerStatus.Ready, _roundStartTime, Paused);
|
return new TickerLobbyStatusEvent(RunLevel != GameRunLevel.PreRoundLobby, LobbySong, LobbyBackground,status == LobbyPlayerStatus.Ready, _roundStartTime, _roundStartTimeSpan, Paused);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SendStatusToAll()
|
private void SendStatusToAll()
|
||||||
|
|||||||
@@ -45,15 +45,17 @@ namespace Content.Shared.GameTicking
|
|||||||
public bool YouAreReady { get; }
|
public bool YouAreReady { get; }
|
||||||
// UTC.
|
// UTC.
|
||||||
public TimeSpan StartTime { get; }
|
public TimeSpan StartTime { get; }
|
||||||
|
public TimeSpan RoundStartTimeSpan { get; }
|
||||||
public bool Paused { get; }
|
public bool Paused { get; }
|
||||||
|
|
||||||
public TickerLobbyStatusEvent(bool isRoundStarted, string? lobbySong, string? lobbyBackground, bool youAreReady, TimeSpan startTime, bool paused)
|
public TickerLobbyStatusEvent(bool isRoundStarted, string? lobbySong, string? lobbyBackground, bool youAreReady, TimeSpan startTime, TimeSpan roundStartTimeSpan, bool paused)
|
||||||
{
|
{
|
||||||
IsRoundStarted = isRoundStarted;
|
IsRoundStarted = isRoundStarted;
|
||||||
LobbySong = lobbySong;
|
LobbySong = lobbySong;
|
||||||
LobbyBackground = lobbyBackground;
|
LobbyBackground = lobbyBackground;
|
||||||
YouAreReady = youAreReady;
|
YouAreReady = youAreReady;
|
||||||
StartTime = startTime;
|
StartTime = startTime;
|
||||||
|
RoundStartTimeSpan = roundStartTimeSpan;
|
||||||
Paused = paused;
|
Paused = paused;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ lobby-state-ready-button-ready-up-state = Ready Up
|
|||||||
lobby-state-player-status-not-ready = Not Ready
|
lobby-state-player-status-not-ready = Not Ready
|
||||||
lobby-state-player-status-ready = Ready
|
lobby-state-player-status-ready = Ready
|
||||||
lobby-state-player-status-observer = Observer
|
lobby-state-player-status-observer = Observer
|
||||||
|
lobby-state-player-status-station-time = The station time is: {$stationTime}
|
||||||
|
|||||||
Reference in New Issue
Block a user