Fix global chat history buffer timestamps.
This commit is contained in:
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var color = message.Type == ChatMessageType.Notification ? ChromeMetrics.Get<Color>("GlobalChatNotificationColor")
|
var color = message.Type == ChatMessageType.Notification ? ChromeMetrics.Get<Color>("GlobalChatNotificationColor")
|
||||||
: ChromeMetrics.Get<Color>("GlobalChatPlayerNameColor");
|
: ChromeMetrics.Get<Color>("GlobalChatPlayerNameColor");
|
||||||
var template = (ContainerWidget)chatTemplate.Clone();
|
var template = (ContainerWidget)chatTemplate.Clone();
|
||||||
LobbyUtils.SetupChatLine(template, color, from, message.Message);
|
LobbyUtils.SetupChatLine(template, color, message.Time, from, message.Message);
|
||||||
|
|
||||||
template.Id = message.UID;
|
template.Id = message.UID;
|
||||||
return template;
|
return template;
|
||||||
|
|||||||
@@ -567,7 +567,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
lobbyChatUnreadMessages += 1;
|
lobbyChatUnreadMessages += 1;
|
||||||
|
|
||||||
var template = (ContainerWidget)chatTemplate.Clone();
|
var template = (ContainerWidget)chatTemplate.Clone();
|
||||||
LobbyUtils.SetupChatLine(template, c, from, text);
|
LobbyUtils.SetupChatLine(template, c, DateTime.Now, from, text);
|
||||||
|
|
||||||
var scrolledToBottom = lobbyChatPanel.ScrolledToBottom;
|
var scrolledToBottom = lobbyChatPanel.ScrolledToBottom;
|
||||||
lobbyChatPanel.AddChild(template);
|
lobbyChatPanel.AddChild(template);
|
||||||
|
|||||||
@@ -542,7 +542,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetupChatLine(ContainerWidget template, Color c, string from, string text)
|
public static void SetupChatLine(ContainerWidget template, Color c, DateTime time, string from, string text)
|
||||||
{
|
{
|
||||||
var nameLabel = template.Get<LabelWidget>("NAME");
|
var nameLabel = template.Get<LabelWidget>("NAME");
|
||||||
var timeLabel = template.Get<LabelWidget>("TIME");
|
var timeLabel = template.Get<LabelWidget>("TIME");
|
||||||
@@ -552,7 +552,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
var font = Game.Renderer.Fonts[nameLabel.Font];
|
var font = Game.Renderer.Fonts[nameLabel.Font];
|
||||||
var nameSize = font.Measure(from);
|
var nameSize = font.Measure(from);
|
||||||
|
|
||||||
var time = DateTime.Now;
|
|
||||||
timeLabel.GetText = () => "{0:D2}:{1:D2}".F(time.Hour, time.Minute);
|
timeLabel.GetText = () => "{0:D2}:{1:D2}".F(time.Hour, time.Minute);
|
||||||
|
|
||||||
nameLabel.GetColor = () => c;
|
nameLabel.GetColor = () => c;
|
||||||
|
|||||||
Reference in New Issue
Block a user