diff --git a/OpenRA.Game/Chat.cs b/OpenRA.Game/Chat.cs index ce3564cd89..9ca3619411 100644 --- a/OpenRA.Game/Chat.cs +++ b/OpenRA.Game/Chat.cs @@ -29,7 +29,7 @@ namespace OpenRA { const int logLength = 10; - public List> recentLines = new List>(); + public List recentLines = new List(); public string typing = ""; public bool isChatting = true; @@ -68,10 +68,12 @@ namespace OpenRA public void AddLine(Color c, string from, string text) { - recentLines.Add(Tuple.New(c, from, text)); + recentLines.Add(new ChatLine { Color = c, Owner = from, Text = text }); var eva = Rules.Info["world"].Traits.Get(); Sound.Play(eva.ChatBeep); while (recentLines.Count > logLength) recentLines.RemoveAt(0); } } + + class ChatLine { public Color Color = Color.White; public string Owner, Text; } } diff --git a/OpenRA.Game/Chrome.cs b/OpenRA.Game/Chrome.cs index d13ede8028..20c3be277c 100644 --- a/OpenRA.Game/Chrome.cs +++ b/OpenRA.Game/Chrome.cs @@ -192,7 +192,7 @@ namespace OpenRA renderer.Device.EnableScissor(typingArea.Left, typingArea.Top, typingArea.Width, typingArea.Height); if (Game.chat.isChatting) - RenderChatLine(Tuple.New(Color.White, "Chat:", Game.chat.typing), + RenderChatLine(new ChatLine { Owner = "Chat:", Text = Game.chat.typing }, new int2(typingArea.X + 10, typingArea.Y + 6)); rgbaRenderer.Flush(); @@ -209,11 +209,11 @@ namespace OpenRA renderer.Device.DisableScissor(); } - void RenderChatLine(Tuple line, int2 p) + void RenderChatLine(ChatLine line, int2 p) { - var size = renderer.RegularFont.Measure(line.b); - renderer.RegularFont.DrawText(line.b, p, line.a); - renderer.RegularFont.DrawText(line.c, p + new int2(size.X + 10, 0), Color.White); + var size = renderer.RegularFont.Measure(line.Owner); + renderer.RegularFont.DrawText(line.Owner, p, line.Color); + renderer.RegularFont.DrawText(line.Text, p + new int2(size.X + 10, 0), Color.White); } public int ticksSinceLastMove = 0;