Fix Roundend Summary Overlap (#1789)

* Fixed translation

* Temp fix

* Add "TODO: Remove" Comment
This commit is contained in:
Exp
2020-08-19 17:02:31 +02:00
committed by GitHub
parent 3b2a804f4f
commit 81fea61b72

View File

@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using Content.Client.Utility;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.Localization;
@@ -17,7 +18,7 @@ namespace Content.Client.UserInterface
private TabContainer RoundEndWindowTabs { get; }
protected override Vector2? CustomSize => (520, 580);
public RoundEndSummaryWindow(string gm, TimeSpan roundTimeSpan, List<RoundEndPlayerInfo> info )
public RoundEndSummaryWindow(string gm, TimeSpan roundTimeSpan, List<RoundEndPlayerInfo> info)
{
Title = Loc.GetString("Round End Summary");
@@ -65,30 +66,40 @@ namespace Content.Client.UserInterface
//Create labels for each player info.
foreach (var plyinfo in manifestSortedList)
{
var playerInfoText = new RichTextLabel()
{
SizeFlagsVertical = SizeFlags.Fill
SizeFlagsVertical = SizeFlags.Fill,
};
//TODO: On Hover display a popup detailing more play info.
//For example: their antag goals and if they completed them sucessfully.
var icNameColor = plyinfo.Antag ? "red" : "white";
playerInfoText.SetMarkup(
Loc.GetString($"[color=gray]{plyinfo.PlayerOOCName}[/color] was [color={icNameColor}]{plyinfo.PlayerICName}[/color] playing role of [color=orange]{plyinfo.Role}[/color]."));
Loc.GetString("[color=gray]{0}[/color] was [color={1}]{2}[/color] playing role of [color=orange]{3}[/color].",
plyinfo.PlayerOOCName, icNameColor, plyinfo.PlayerICName, Loc.GetString(plyinfo.Role)));
innerScrollContainer.AddChild(playerInfoText);
}
scrollContainer.AddChild(innerScrollContainer);
//Attach the entire ScrollContainer that holds all the playerinfo.
PlayerManifestoTab.AddChild(scrollContainer);
// TODO: 1240 Overlap, remove once it's fixed. Temp Hack to make the lines not overlap
PlayerManifestoTab.OnVisibilityChanged += PlayerManifestoTab_OnVisibilityChanged;
//Finally, display the window.
OpenCentered();
MoveToFront();
}
private void PlayerManifestoTab_OnVisibilityChanged(Control obj)
{
if (obj.Visible)
{
// For some reason the lines get not properly drawn with the right height
// so we just force a update
ForceRunLayoutUpdate();
}
}
}
}