Add round id to lobby and round end summary (#7547)

This commit is contained in:
ShadowCommander
2022-04-14 11:40:26 -07:00
committed by GitHub
parent 86535b4766
commit a57e0ca199
7 changed files with 23 additions and 30 deletions

View File

@@ -1,5 +1,3 @@
using System;
using System.Collections.Generic;
using Content.Client.Lobby;
using Content.Client.RoundEnd;
using Content.Client.Viewport;
@@ -9,12 +7,8 @@ using Content.Shared.Station;
using JetBrains.Annotations;
using Robust.Client.Graphics;
using Robust.Client.State;
using Robust.Shared.ContentPack;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Network;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
namespace Content.Client.GameTicking.Managers
{
@@ -129,7 +123,7 @@ namespace Content.Client.GameTicking.Managers
private void RoundEnd(RoundEndMessageEvent message)
{
//This is not ideal at all, but I don't see an immediately better fit anywhere else.
var roundEnd = new RoundEndSummaryWindow(message.GamemodeTitle, message.RoundEndText, message.RoundDuration, message.AllPlayersEndInfo);
var roundEnd = new RoundEndSummaryWindow(message.GamemodeTitle, message.RoundEndText, message.RoundDuration, message.RoundId, message.AllPlayersEndInfo);
}
}
}

View File

@@ -1,10 +1,9 @@
using System;
using System.Linq;
using Content.Client.Message;
using Content.Shared.GameTicking;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
using Robust.Shared.Utility;
using static Robust.Client.UserInterface.Controls.BoxContainer;
namespace Content.Client.RoundEnd
@@ -12,7 +11,8 @@ namespace Content.Client.RoundEnd
public sealed class RoundEndSummaryWindow : DefaultWindow
{
public RoundEndSummaryWindow(string gm, string roundEnd, TimeSpan roundTimeSpan, RoundEndMessageEvent.RoundEndPlayerInfo[] info)
public RoundEndSummaryWindow(string gm, string roundEnd, TimeSpan roundTimeSpan, int roundId,
RoundEndMessageEvent.RoundEndPlayerInfo[] info)
{
MinSize = SetSize = (520, 580);
@@ -25,7 +25,7 @@ namespace Content.Client.RoundEnd
// Also good for serious info.
var roundEndTabs = new TabContainer();
roundEndTabs.AddChild(MakeRoundEndSummaryTab(gm, roundEnd, roundTimeSpan));
roundEndTabs.AddChild(MakeRoundEndSummaryTab(gm, roundEnd, roundTimeSpan, roundId));
roundEndTabs.AddChild(MakePlayerManifestoTab(info));
Contents.AddChild(roundEndTabs);
@@ -34,7 +34,7 @@ namespace Content.Client.RoundEnd
MoveToFront();
}
private BoxContainer MakeRoundEndSummaryTab(string gamemode, string roundEnd, TimeSpan roundDuration)
private BoxContainer MakeRoundEndSummaryTab(string gamemode, string roundEnd, TimeSpan roundDuration, int roundId)
{
var roundEndSummaryTab = new BoxContainer
{
@@ -53,7 +53,11 @@ namespace Content.Client.RoundEnd
//Gamemode Name
var gamemodeLabel = new RichTextLabel();
gamemodeLabel.SetMarkup(Loc.GetString("round-end-summary-window-gamemode-name-label", ("gamemode", gamemode)));
var gamemodeMessage = new FormattedMessage();
gamemodeMessage.AddMarkup(Loc.GetString("round-end-summary-window-round-id-label", ("roundId", roundId)));
gamemodeMessage.AddText(" ");
gamemodeMessage.AddMarkup(Loc.GetString("round-end-summary-window-gamemode-name-label", ("gamemode", gamemode)));
gamemodeLabel.SetMessage(gamemodeMessage);
roundEndSummaryContainer.AddChild(gamemodeLabel);
//Duration

View File

@@ -1,13 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Content.Shared.GameTicking;
using Robust.Server.Player;
using Robust.Shared.Localization;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameTicking
{
@@ -50,7 +45,7 @@ namespace Content.Server.GameTicking
var mapName = map?.MapName ?? 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",("playerCount", playerCount),("mapName", mapName),("gmTitle", gmTitle),("desc", desc));
return Loc.GetString("game-ticker-get-info-text",("roundId", RoundId), ("playerCount", playerCount),("mapName", mapName),("gmTitle", gmTitle),("desc", desc));
}
private TickerLobbyReadyEvent GetStatusSingle(ICommonSession player, LobbyPlayerStatus status)

View File

@@ -366,7 +366,7 @@ namespace Content.Server.GameTicking
// This ordering mechanism isn't great (no ordering of minds) but functions
var listOfPlayerInfoFinal = listOfPlayerInfo.OrderBy(pi => pi.PlayerOOCName).ToArray();
_playersInGame.Clear();
RaiseNetworkEvent(new RoundEndMessageEvent(gamemodeTitle, roundEndText, roundDuration, listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal));
RaiseNetworkEvent(new RoundEndMessageEvent(gamemodeTitle, roundEndText, roundDuration, RoundId, listOfPlayerInfoFinal.Length, listOfPlayerInfoFinal));
}
public void RestartRound()

View File

@@ -1,8 +1,4 @@

using System;
using System.Collections.Generic;
using Content.Shared.Station;
using Robust.Shared.GameObjects;
using Content.Shared.Station;
using Robust.Shared.Network;
using Robust.Shared.Serialization;
@@ -139,15 +135,17 @@ namespace Content.Shared.GameTicking
public string GamemodeTitle { get; }
public string RoundEndText { get; }
public TimeSpan RoundDuration { get; }
public int RoundId { get; }
public int PlayerCount { get; }
public RoundEndPlayerInfo[] AllPlayersEndInfo { get; }
public RoundEndMessageEvent(string gamemodeTitle, string roundEndText, TimeSpan roundDuration, int playerCount,
RoundEndPlayerInfo[] allPlayersEndInfo)
public RoundEndMessageEvent(string gamemodeTitle, string roundEndText, TimeSpan roundDuration, int roundId,
int playerCount, RoundEndPlayerInfo[] allPlayersEndInfo)
{
GamemodeTitle = gamemodeTitle;
RoundEndText = roundEndText;
RoundDuration = roundDuration;
RoundId = roundId;
PlayerCount = playerCount;
AllPlayersEndInfo = allPlayersEndInfo;
}

View File

@@ -10,9 +10,10 @@ game-ticker-pause-start = Round start has been paused.
game-ticker-pause-start-resumed = Round start countdown is now resumed.
game-ticker-player-join-game-message = Welcome to Space Station 14! If this is your first time playing, be sure to press F1 on your keyboard and read the game rules, and don't be afraid to ask for help in OOC.
game-ticker-get-info-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]
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]
game-ticker-no-map-selected = [color=red]No map selected![/color]
game-ticker-player-no-jobs-available-when-joining = When attempting to join to the game, no jobs were available.

View File

@@ -1,7 +1,8 @@
round-end-summary-window-title = Round End Summary
round-end-summary-window-round-end-summary-tab-title = Round Information
round-end-summary-window-player-manifesto-tab-title = Player Manifesto
round-end-summary-window-gamemode-name-label = Round of [color=white]{$gamemode}[/color] has ended.
round-end-summary-window-round-id-label = Round [color=white]#{$roundId}[/color] has ended.
round-end-summary-window-gamemode-name-label = The game mode was [color=white]{$gamemode}[/color].
round-end-summary-window-duration-label = It lasted for [color=yellow]{$hours} hours, {$minutes} minutes, and {$seconds} seconds.
round-end-summary-window-player-info-if-observer-text = [color=gray]{$playerOOCName}[/color] was [color=lightblue]{$playerICName}[/color], an observer.
round-end-summary-window-player-info-if-not-observer-text = [color=gray]{$playerOOCName}[/color] was [color={$icNameColor}]{$playerICName}[/color] playing role of [color=orange]{$playerRole}[/color].
round-end-summary-window-player-info-if-not-observer-text = [color=gray]{$playerOOCName}[/color] was [color={$icNameColor}]{$playerICName}[/color] playing role of [color=orange]{$playerRole}[/color].