From 502c3e2bf5bad7abf98df1198c8a8af6701f2f76 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 13 Dec 2017 19:16:41 +0000 Subject: [PATCH] Remove global chat integration. --- AUTHORS | 3 - Makefile | 3 +- OpenRA.Game/Game.cs | 6 - OpenRA.Game/GlobalChat.cs | 387 ------------------ OpenRA.Game/OpenRA.Game.csproj | 5 - OpenRA.Game/Settings.cs | 12 - OpenRA.Mods.Common/OpenRA.Mods.Common.csproj | 1 - .../Widgets/Logic/GlobalChatLogic.cs | 155 ------- .../Widgets/Logic/Lobby/LobbyLogic.cs | 63 --- .../Widgets/Logic/MultiplayerLogic.cs | 1 - mods/cnc/chrome/lobby-globalchat.yaml | 142 ------- mods/cnc/chrome/lobby.yaml | 20 +- mods/cnc/chrome/multiplayer-globalchat.yaml | 123 ------ mods/cnc/chrome/multiplayer.yaml | 9 +- mods/cnc/mod.yaml | 2 - mods/common/chrome/lobby-globalchat.yaml | 142 ------- mods/common/chrome/lobby.yaml | 26 +- mods/common/chrome/multiplayer-browser.yaml | 2 +- .../chrome/multiplayer-createserver.yaml | 4 +- .../chrome/multiplayer-directconnect.yaml | 4 +- .../common/chrome/multiplayer-globalchat.yaml | 123 ------ mods/common/chrome/multiplayer.yaml | 21 +- mods/common/metrics.yaml | 3 - mods/d2k/mod.yaml | 2 - mods/ra/mod.yaml | 2 - mods/ts/mod.yaml | 2 - packaging/windows/OpenRA.nsi | 2 - thirdparty/fetch-thirdparty-deps.ps1 | 8 - thirdparty/fetch-thirdparty-deps.sh | 7 - 29 files changed, 20 insertions(+), 1260 deletions(-) delete mode 100644 OpenRA.Game/GlobalChat.cs delete mode 100644 OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs delete mode 100644 mods/cnc/chrome/lobby-globalchat.yaml delete mode 100644 mods/cnc/chrome/multiplayer-globalchat.yaml delete mode 100644 mods/common/chrome/lobby-globalchat.yaml delete mode 100644 mods/common/chrome/multiplayer-globalchat.yaml diff --git a/AUTHORS b/AUTHORS index 50a47fa558..6f65659801 100644 --- a/AUTHORS +++ b/AUTHORS @@ -169,9 +169,6 @@ under the MIT license. Using ICSharpCode.SharpZipLib initially by Mike Krueger and distributed under the GNU GPL terms. -Using SmartIrc4Net developed by Mirco Bauer -distributed under the LGPL version 2.1 or later. - Using rix0rrr.BeaconLib developed by Rico Huijbers distributed under MIT License. diff --git a/Makefile b/Makefile index a8de0c6558..a1b2913b3c 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,7 @@ SDK ?= CSC = mcs $(SDK) CSFLAGS = -nologo -warn:4 -codepage:utf8 -langversion:5 -unsafe -warnaserror DEFINE = TRACE -COMMON_LIBS = System.dll System.Core.dll System.Data.dll System.Data.DataSetExtensions.dll System.Drawing.dll System.Xml.dll thirdparty/download/ICSharpCode.SharpZipLib.dll thirdparty/download/FuzzyLogicLibrary.dll thirdparty/download/MaxMind.Db.dll thirdparty/download/Eluant.dll thirdparty/download/SmarIrc4net.dll thirdparty/download/rix0rrr.BeaconLib.dll +COMMON_LIBS = System.dll System.Core.dll System.Data.dll System.Data.DataSetExtensions.dll System.Drawing.dll System.Xml.dll thirdparty/download/ICSharpCode.SharpZipLib.dll thirdparty/download/FuzzyLogicLibrary.dll thirdparty/download/MaxMind.Db.dll thirdparty/download/Eluant.dll thirdparty/download/rix0rrr.BeaconLib.dll NUNIT_LIBS_PATH := NUNIT_LIBS := $(NUNIT_LIBS_PATH)nunit.framework.dll @@ -357,7 +357,6 @@ install-engine: @$(CP) SharpFont.dll.config "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) Open.Nat.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) MaxMind.Db.dll "$(DATA_INSTALL_DIR)" - @$(INSTALL_PROGRAM) SmarIrc4net.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) rix0rrr.BeaconLib.dll "$(DATA_INSTALL_DIR)" install-common-mod-files: diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index ff61e3a2ad..eb001a2cbf 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -21,7 +21,6 @@ using System.Net; using System.Reflection; using System.Threading; using System.Threading.Tasks; -using OpenRA.Chat; using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Primitives; @@ -55,8 +54,6 @@ namespace OpenRA public static bool BenchmarkMode = false; - public static GlobalChat GlobalChat; - public static string EngineVersion { get; private set; } static Task discoverNat; @@ -338,8 +335,6 @@ namespace OpenRA Settings.Server.AllowPortForward = true; } - GlobalChat = new GlobalChat(); - var modSearchArg = args.GetValue("Engine.ModSearchPaths", null); var modSearchPaths = modSearchArg != null ? FieldLoader.GetValue("Engine.ModsPath", modSearchArg) : @@ -821,7 +816,6 @@ namespace OpenRA ModData.Dispose(); ChromeProvider.Deinitialize(); - GlobalChat.Dispose(); Sound.Dispose(); Renderer.Dispose(); diff --git a/OpenRA.Game/GlobalChat.cs b/OpenRA.Game/GlobalChat.cs deleted file mode 100644 index ca62061a1e..0000000000 --- a/OpenRA.Game/GlobalChat.cs +++ /dev/null @@ -1,387 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System; -using System.Collections; -using System.Linq; -using System.Threading; -using Meebey.SmartIrc4net; -using OpenRA.Primitives; - -namespace OpenRA.Chat -{ - public enum ChatConnectionStatus { Disconnected, Connecting, Connected, Disconnecting, Joined, Error } - public enum ChatMessageType { Message, Notification } - - public sealed class ChatUser - { - public readonly string Name; - public bool IsOp; - public bool IsVoiced; - - public ChatUser(string name, bool isOp, bool isVoice) - { - Name = name; - IsOp = isOp; - IsVoiced = isVoice; - } - } - - public sealed class ChatMessage - { - static long nextUID; - - public readonly DateTime Time; - public readonly ChatMessageType Type; - public readonly string Nick; - public readonly string Message; - public readonly string UID; - - public ChatMessage(DateTime time, ChatMessageType type, string nick, string message) - { - Time = time; - Type = type; - Nick = nick; - Message = message; - - UID = Interlocked.Increment(ref nextUID).ToString(); - } - - public override string ToString() - { - var time = Time.ToString(Game.Settings.Chat.TimestampFormat); - if (Type == ChatMessageType.Notification) - return "{0} {1}".F(time, Message); - - return "{0} {1}: {2}".F(time, Nick, Message); - } - } - - public sealed class GlobalChat : IDisposable - { - readonly IrcClient client = new IrcClient(); - volatile Channel channel; - - public readonly ObservableSortedDictionary Users = new ObservableSortedDictionary(StringComparer.InvariantCultureIgnoreCase); - public readonly ObservableList History = new ObservableList(); - - volatile string topic; - public string Topic { get { return topic; } } - - volatile ChatConnectionStatus connectionStatus = ChatConnectionStatus.Disconnected; - public ChatConnectionStatus ConnectionStatus { get { return connectionStatus; } } - - string nickname; - - public GlobalChat() - { - client.Encoding = System.Text.Encoding.UTF8; - client.SendDelay = 100; - client.ActiveChannelSyncing = true; - - client.OnConnecting += OnConnecting; - client.OnConnected += OnConnected; - client.OnDisconnecting += OnDisconnecting; - client.OnDisconnected += OnDisconnected; - client.OnError += OnError; - client.OnKick += OnKick; - - client.OnRawMessage += (_, e) => Game.RunAfterTick(() => Log.Write("irc", e.Data.RawMessage)); - client.OnJoin += OnJoin; - client.OnChannelActiveSynced += OnChannelActiveSynced; - client.OnTopic += (_, e) => topic = e.Topic; - client.OnTopicChange += (_, e) => topic = e.NewTopic; - client.OnNickChange += OnNickChange; - - client.OnChannelMessage += (_, e) => AddMessage(e.Data.Nick, e.Data.Message); - client.OnOp += (_, e) => SetUserOp(e.Whom, true); - client.OnDeop += (_, e) => SetUserOp(e.Whom, false); - client.OnVoice += (_, e) => SetUserVoiced(e.Whom, true); - client.OnDevoice += (_, e) => SetUserVoiced(e.Whom, false); - client.OnPart += OnPart; - client.OnQuit += OnQuit; - } - - void SetUserOp(string whom, bool isOp) - { - Game.RunAfterTick(() => - { - ChatUser user; - if (Users.TryGetValue(whom, out user)) - user.IsOp = isOp; - }); - } - - void SetUserVoiced(string whom, bool isVoiced) - { - Game.RunAfterTick(() => - { - ChatUser user; - if (Users.TryGetValue(whom, out user)) - user.IsVoiced = isVoiced; - }); - } - - public void Connect(string nickname) - { - if (client.IsConnected || !IsValidNickname(nickname)) - return; - - this.nickname = nickname; - - new Thread(() => - { - try - { - client.Connect(Game.Settings.Chat.Hostname, Game.Settings.Chat.Port); - } - catch (Exception e) - { - connectionStatus = ChatConnectionStatus.Error; - AddNotification(e.Message); - Game.RunAfterTick(() => Log.Write("irc", e.ToString())); - - return; - } - - client.Listen(); - }) { Name = "IrcListenThread", IsBackground = true }.Start(); - } - - void AddNotification(string text) - { - var message = new ChatMessage(DateTime.Now, ChatMessageType.Notification, null, text); - Game.RunAfterTick(() => - { - History.Add(message); - Log.Write("irc", text); - }); - } - - void AddMessage(string nick, string text) - { - var message = new ChatMessage(DateTime.Now, ChatMessageType.Message, nick, text); - Game.RunAfterTick(() => - { - History.Add(message); - Log.Write("irc", text); - }); - } - - void OnConnecting(object sender, EventArgs e) - { - AddNotification("Connecting to {0}:{1}...".F(Game.Settings.Chat.Hostname, Game.Settings.Chat.Port)); - connectionStatus = ChatConnectionStatus.Connecting; - } - - void OnConnected(object sender, EventArgs e) - { - AddNotification("Connected."); - connectionStatus = ChatConnectionStatus.Connected; - - client.Login(nickname, "in-game IRC client", 0, "OpenRA"); - client.RfcJoin("#" + Game.Settings.Chat.Channel); - } - - void OnDisconnecting(object sender, EventArgs e) - { - if (connectionStatus != ChatConnectionStatus.Error) - connectionStatus = ChatConnectionStatus.Disconnecting; - } - - void OnDisconnected(object sender, EventArgs e) - { - Game.RunAfterTick(Users.Clear); - - // Keep the chat window open if there is an error - // It will be cleared by the Disconnect button - if (connectionStatus != ChatConnectionStatus.Error) - { - Game.RunAfterTick(History.Clear); - topic = null; - connectionStatus = ChatConnectionStatus.Disconnected; - } - } - - void OnError(object sender, ErrorEventArgs e) - { - // Ignore any errors that happen during disconnect - if (connectionStatus != ChatConnectionStatus.Disconnecting) - { - connectionStatus = ChatConnectionStatus.Error; - AddNotification("Error: " + e.ErrorMessage); - } - } - - void OnKick(object sender, KickEventArgs e) - { - if (e.Whom == client.Nickname) - { - Disconnect(); - connectionStatus = ChatConnectionStatus.Error; - AddNotification("You were kicked from the chat by {0}. ({1})".F(e.Who, e.KickReason)); - } - else - { - Users.Remove(e.Whom); - AddNotification("{0} was kicked from the chat by {1}. ({2})".F(e.Whom, e.Who, e.KickReason)); - } - } - - void OnJoin(object sender, JoinEventArgs e) - { - if (e.Who == client.Nickname || channel == null || e.Channel != channel.Name) - return; - - AddNotification("{0} joined the chat.".F(e.Who)); - Game.RunAfterTick(() => Users.Add(e.Who, new ChatUser(e.Who, false, false))); - } - - void OnChannelActiveSynced(object sender, IrcEventArgs e) - { - channel = client.GetChannel(e.Data.Channel); - AddNotification("{0} users online".F(channel.Users.Count)); - connectionStatus = ChatConnectionStatus.Joined; - - foreach (DictionaryEntry user in channel.Users) - { - var u = (ChannelUser)user.Value; - Game.RunAfterTick(() => Users.Add(u.Nick, new ChatUser(u.Nick, u.IsOp, u.IsVoice))); - } - } - - void OnNickChange(object sender, NickChangeEventArgs e) - { - AddNotification("{0} is now known as {1}.".F(e.OldNickname, e.NewNickname)); - - Game.RunAfterTick(() => - { - ChatUser user; - if (!Users.TryGetValue(e.OldNickname, out user)) - return; - - Users.Remove(e.OldNickname); - Users.Add(e.NewNickname, new ChatUser(e.NewNickname, user.IsOp, user.IsVoiced)); - }); - } - - void OnQuit(object sender, QuitEventArgs e) - { - AddNotification("{0} left the chat.".F(e.Who)); - Game.RunAfterTick(() => Users.Remove(e.Who)); - } - - void OnPart(object sender, PartEventArgs e) - { - if (channel == null || e.Data.Channel != channel.Name) - return; - - AddNotification("{0} left the chat.".F(e.Who)); - Game.RunAfterTick(() => Users.Remove(e.Who)); - } - - public string SanitizedName(string dirty) - { - if (string.IsNullOrEmpty(dirty)) - return null; - - // There is no need to mangle the nick if it is already valid - if (Rfc2812.IsValidNickname(dirty)) - return dirty; - - // TODO: some special chars are allowed as well, but not at every position - var clean = new string(dirty.Where(c => char.IsLetterOrDigit(c)).ToArray()); - - if (string.IsNullOrEmpty(clean)) - return null; - - if (char.IsDigit(clean[0])) - return SanitizedName(clean.Substring(1)); - - // Source: https://tools.ietf.org/html/rfc2812#section-1.2.1 - if (clean.Length > 9) - clean = clean.Substring(0, 9); - - return clean; - } - - public bool IsValidNickname(string name) - { - return Rfc2812.IsValidNickname(name); - } - - public void SendMessage(string text) - { - if (connectionStatus != ChatConnectionStatus.Joined) - return; - - // Guard against a last-moment disconnection - try - { - client.SendMessage(SendType.Message, channel.Name, text); - AddMessage(client.Nickname, text); - } - catch (NotConnectedException) { } - } - - public bool TrySetNickname(string nick) - { - // TODO: This is inconsistent with the other check - if (Rfc2812.IsValidNickname(nick)) - { - client.RfcNick(nick); - return true; - } - - return false; - } - - public void Disconnect() - { - // Error is an alias for disconnect, but keeps the panel open - // so that clients can see the error - if (connectionStatus == ChatConnectionStatus.Error) - { - Game.RunAfterTick(History.Clear); - topic = null; - connectionStatus = ChatConnectionStatus.Disconnected; - } - else - connectionStatus = ChatConnectionStatus.Disconnecting; - - if (!client.IsConnected) - return; - - client.RfcQuit(Game.Settings.Chat.QuitMessage); - - AddNotification("Disconnecting from {0}...".F(client.Address)); - - Game.RunAfterTick(() => { Game.Settings.Chat.ConnectAutomatically = false; Game.Settings.Save(); }); - } - - public void Dispose() - { - // HACK: The IRC library we are using has terrible thread-handling code that relies on Thread.Abort. - // There is a thread reading from the network socket which is aborted, however on Windows this is inside - // native code so this abort call hangs until the network socket reads something and returns to managed - // code where it can then be aborted. - // - // This means we may hang for several seconds during shutdown (until we receive something over IRC!) before - // closing. - // - // Since our IRC client currently lives forever, the only time we call this Dispose method is during the - // shutdown of our process. Therefore, we can work around the problem by just not bothering to disconnect - // properly. Since our process is about to die anyway, it's not like anyone will care. - ////if (client.IsConnected) - //// client.Disconnect(); - } - } -} \ No newline at end of file diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index ecb68cdcd6..d618498159 100644 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -98,10 +98,6 @@ ..\thirdparty\download\MaxMind.Db.dll False - - ..\thirdparty\download\SmarIrc4net.dll - False - @@ -247,7 +243,6 @@ - diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index b72d8df0b4..f64f9af418 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -194,16 +194,6 @@ namespace OpenRA public MPGameFilters MPGameFilters = MPGameFilters.Waiting | MPGameFilters.Empty | MPGameFilters.Protected | MPGameFilters.Started; } - public class ChatSettings - { - public string Hostname = "irc.openra.net"; - public int Port = 6667; - public string Channel = "lobby"; - public string QuitMessage = "Battle control terminated!"; - public string TimestampFormat = "HH:mm"; - public bool ConnectAutomatically = false; - } - public class Settings { readonly string settingsFile; @@ -215,7 +205,6 @@ namespace OpenRA public readonly ServerSettings Server = new ServerSettings(); public readonly DebugSettings Debug = new DebugSettings(); internal Dictionary Keys = new Dictionary(); - public readonly ChatSettings Chat = new ChatSettings(); public readonly Dictionary Sections; @@ -235,7 +224,6 @@ namespace OpenRA { "Graphics", Graphics }, { "Server", Server }, { "Debug", Debug }, - { "Chat", Chat } }; // Override fieldloader to ignore invalid entries diff --git a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj index 16d9a03240..aff4ea017f 100644 --- a/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj +++ b/OpenRA.Mods.Common/OpenRA.Mods.Common.csproj @@ -728,7 +728,6 @@ - diff --git a/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs deleted file mode 100644 index ed89be3f32..0000000000 --- a/OpenRA.Mods.Common/Widgets/Logic/GlobalChatLogic.cs +++ /dev/null @@ -1,155 +0,0 @@ -#region Copyright & License Information -/* - * Copyright 2007-2017 The OpenRA Developers (see AUTHORS) - * This file is part of OpenRA, which is free software. It is made - * available to you under the terms of the GNU General Public License - * as published by the Free Software Foundation, either version 3 of - * the License, or (at your option) any later version. For more - * information, see COPYING. - */ -#endregion - -using System.Drawing; -using OpenRA.Chat; -using OpenRA.Widgets; - -namespace OpenRA.Mods.Common.Widgets.Logic -{ - class GlobalChatLogic : ChromeLogic - { - readonly ScrollPanelWidget historyPanel; - readonly ContainerWidget chatTemplate; - readonly ScrollPanelWidget nicknamePanel; - readonly Widget nicknameTemplate; - readonly TextFieldWidget inputBox; - - [ObjectCreator.UseCtor] - public GlobalChatLogic(Widget widget) - { - historyPanel = widget.Get("HISTORY_PANEL"); - chatTemplate = historyPanel.Get("CHAT_TEMPLATE"); - nicknamePanel = widget.Get("NICKNAME_PANEL"); - nicknameTemplate = nicknamePanel.Get("NICKNAME_TEMPLATE"); - - var textColor = ChromeMetrics.Get("GlobalChatTextColor"); - var textLabel = chatTemplate.Get("TEXT"); - textLabel.GetColor = () => textColor; - - historyPanel.Bind(Game.GlobalChat.History, MakeHistoryWidget, HistoryWidgetEquals, true); - nicknamePanel.Bind(Game.GlobalChat.Users, MakeUserWidget, UserWidgetEquals, false); - - inputBox = widget.Get("CHAT_TEXTFIELD"); - inputBox.IsDisabled = () => Game.GlobalChat.ConnectionStatus != ChatConnectionStatus.Joined; - inputBox.OnEnterKey = EnterPressed; - - // IRC protocol limits messages to 510 characters + CRLF - inputBox.MaxLength = 510; - - var nickName = Game.GlobalChat.SanitizedName(Game.Settings.Player.Name); - var nicknameBox = widget.Get("NICKNAME_TEXTFIELD"); - nicknameBox.Text = nickName; - nicknameBox.OnTextEdited = () => - { - nicknameBox.Text = Game.GlobalChat.SanitizedName(nicknameBox.Text); - }; - - var connectPanel = widget.Get("GLOBALCHAT_CONNECT_PANEL"); - connectPanel.IsVisible = () => Game.GlobalChat.ConnectionStatus == ChatConnectionStatus.Disconnected; - - var disconnectButton = widget.Get("DISCONNECT_BUTTON"); - disconnectButton.OnClick = Game.GlobalChat.Disconnect; - - var connectAutomaticallyCheckBox = connectPanel.Get("CONNECT_AUTOMATICALLY_CHECKBOX"); - connectAutomaticallyCheckBox.IsChecked = () => Game.Settings.Chat.ConnectAutomatically; - connectAutomaticallyCheckBox.OnClick = () => { Game.Settings.Chat.ConnectAutomatically ^= true; Game.Settings.Save(); }; - - var connectButton = connectPanel.Get("CONNECT_BUTTON"); - connectButton.IsDisabled = () => !Game.GlobalChat.IsValidNickname(nicknameBox.Text); - connectButton.OnClick = () => Game.GlobalChat.Connect(nicknameBox.Text); - - var mainPanel = widget.Get("GLOBALCHAT_MAIN_PANEL"); - mainPanel.IsVisible = () => Game.GlobalChat.ConnectionStatus != ChatConnectionStatus.Disconnected; - - mainPanel.Get("CHANNEL_TOPIC").GetText = () => Game.GlobalChat.Topic; - - if (Game.Settings.Chat.ConnectAutomatically) - Game.GlobalChat.Connect(nickName); - } - - Widget MakeHistoryWidget(object o) - { - var message = (ChatMessage)o; - var from = message.Type == ChatMessageType.Notification ? "Battlefield Control" : message.Nick; - var color = message.Type == ChatMessageType.Notification ? ChromeMetrics.Get("GlobalChatNotificationColor") - : ChromeMetrics.Get("GlobalChatPlayerNameColor"); - var template = (ContainerWidget)chatTemplate.Clone(); - LobbyUtils.SetupChatLine(template, color, message.Time, from, message.Message); - - template.Id = message.UID; - return template; - } - - bool HistoryWidgetEquals(Widget widget, object o) - { - return ((LabelWidget)widget).Id == ((ChatMessage)o).UID; - } - - Widget MakeUserWidget(object o) - { - var nick = (string)o; - var client = Game.GlobalChat.Users[nick]; - - var item = nicknameTemplate.Clone(); - item.Id = client.Name; - item.IsVisible = () => true; - var name = item.Get("NICK"); - name.GetText = () => client.Name; - name.IsVisible = () => true; - - // TODO: Add custom image for voice - var indicator = item.Get("INDICATOR"); - indicator.IsVisible = () => client.IsOp || client.IsVoiced; - indicator.GetImageName = () => client.IsOp || client.IsVoiced ? "admin" : ""; - - return item; - } - - bool UserWidgetEquals(Widget widget, object o) - { - var nick = (string)o; - return widget.Id == nick; - } - - bool EnterPressed() - { - if (inputBox.Text.Length == 0) - return true; - - if (inputBox.Text.StartsWith("/nick ")) - { - var nick = inputBox.Text.Replace("/nick ", string.Empty); - Game.GlobalChat.TrySetNickname(nick); - } - else - Game.GlobalChat.SendMessage(inputBox.Text); - - inputBox.Text = ""; - - return true; - } - - bool disposed; - protected override void Dispose(bool disposing) - { - base.Dispose(disposing); - - if (disposed) - return; - - historyPanel.Unbind(); - nicknamePanel.Unbind(); - - disposed = true; - } - } -} diff --git a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs index e45fbfe3b5..15719f3ed7 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Lobby/LobbyLogic.cs @@ -14,7 +14,6 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; using System.Threading.Tasks; -using OpenRA.Chat; using OpenRA.Graphics; using OpenRA.Network; using OpenRA.Traits; @@ -38,9 +37,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic enum PanelType { Players, Options, Music, Kick, ForceStart } PanelType panel = PanelType.Players; - enum ChatPanelType { Lobby, Global } - ChatPanelType chatPanel = ChatPanelType.Lobby; - readonly Widget lobby; readonly Widget editablePlayerTemplate; readonly Widget nonEditablePlayerTemplate; @@ -65,9 +61,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic MapPreview map; bool addBotOnMapLoad; bool teamChat; - int lobbyChatUnreadMessages; - int globalChatLastReadMessages; - int globalChatUnreadMessages; // Listen for connection failures void ConnectionStateChanged(OrderManager om) @@ -353,33 +346,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic if (skirmishMode) disconnectButton.Text = "Back"; - var globalChat = Game.LoadWidget(null, "LOBBY_GLOBALCHAT_PANEL", lobby.Get("GLOBALCHAT_ROOT"), new WidgetArgs()); - var globalChatInput = globalChat.Get("CHAT_TEXTFIELD"); - - globalChat.IsVisible = () => chatPanel == ChatPanelType.Global; - - var globalChatTab = lobby.Get("GLOBALCHAT_TAB"); - globalChatTab.IsHighlighted = () => chatPanel == ChatPanelType.Global; - globalChatTab.OnClick = () => - { - chatPanel = ChatPanelType.Global; - globalChatInput.TakeKeyboardFocus(); - }; - - var globalChatLabel = globalChatTab.Text; - globalChatTab.GetText = () => - { - if (globalChatUnreadMessages == 0 || chatPanel == ChatPanelType.Global) - return globalChatLabel; - - return globalChatLabel + " ({0})".F(globalChatUnreadMessages); - }; - - globalChatLastReadMessages = Game.GlobalChat.History.Count(m => m.Type == ChatMessageType.Message); - - var lobbyChat = lobby.Get("LOBBYCHAT"); - lobbyChat.IsVisible = () => chatPanel == ChatPanelType.Lobby; - chatLabel = lobby.Get("LABEL_CHATTYPE"); var chatTextField = lobby.Get("CHAT_TEXTFIELD"); chatTextField.MaxLength = UnitOrders.ChatMessageMaxLength; @@ -412,23 +378,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic chatTextField.OnEscKey = () => { chatTextField.Text = ""; return true; }; - var lobbyChatTab = lobby.Get("LOBBYCHAT_TAB"); - lobbyChatTab.IsHighlighted = () => chatPanel == ChatPanelType.Lobby; - lobbyChatTab.OnClick = () => - { - chatPanel = ChatPanelType.Lobby; - chatTextField.TakeKeyboardFocus(); - }; - - var lobbyChatLabel = lobbyChatTab.Text; - lobbyChatTab.GetText = () => - { - if (lobbyChatUnreadMessages == 0 || chatPanel == ChatPanelType.Lobby) - return lobbyChatLabel; - - return lobbyChatLabel + " ({0})".F(lobbyChatUnreadMessages); - }; - lobbyChatPanel = lobby.Get("CHAT_DISPLAY"); chatTemplate = lobbyChatPanel.Get("CHAT_TEMPLATE"); lobbyChatPanel.RemoveChildren(); @@ -473,22 +422,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic { if (panel == PanelType.Options && OptionsTabDisabled()) panel = PanelType.Players; - - var newMessages = Game.GlobalChat.History.Count(m => m.Type == ChatMessageType.Message); - globalChatUnreadMessages += newMessages - globalChatLastReadMessages; - globalChatLastReadMessages = newMessages; - - if (chatPanel == ChatPanelType.Lobby) - lobbyChatUnreadMessages = 0; - - if (chatPanel == ChatPanelType.Global) - globalChatUnreadMessages = 0; } void AddChatLine(Color c, string from, string text) { - lobbyChatUnreadMessages += 1; - var template = (ContainerWidget)chatTemplate.Clone(); LobbyUtils.SetupChatLine(template, c, DateTime.Now, from, text); diff --git a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs index 2fbbb2a4f8..66dcf1ca01 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MultiplayerLogic.cs @@ -109,7 +109,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic createServerTab.OnClick = () => panel = PanelType.CreateServer; widget.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; - Game.LoadWidget(null, "GLOBALCHAT_PANEL", widget.Get("GLOBALCHAT_ROOT"), new WidgetArgs()); lanGameLocations = new List(); try diff --git a/mods/cnc/chrome/lobby-globalchat.yaml b/mods/cnc/chrome/lobby-globalchat.yaml deleted file mode 100644 index 17d36497ae..0000000000 --- a/mods/cnc/chrome/lobby-globalchat.yaml +++ /dev/null @@ -1,142 +0,0 @@ -Container@LOBBY_GLOBALCHAT_PANEL: - Logic: GlobalChatLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Container@GLOBALCHAT_MAIN_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Background@TOPIC: - Width: 582 - Height: 20 - Background: panel-transparent - Children: - Label@CHANNEL_TOPIC: - X: 10 - Y: 0 - 1 - Width: PARENT_RIGHT - 20 - Height: PARENT_BOTTOM - Font: TinyBold - Align: Center - ScrollPanel@HISTORY_PANEL: - Y: 19 - Width: 582 - Height: PARENT_BOTTOM - 49 - TopBottomSpacing: 4 - ItemSpacing: 4 - Children: - Container@CHAT_TEMPLATE: - X: 2 - Width: PARENT_RIGHT - 27 - Height: 16 - Children: - Label@TIME: - X: 3 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@NAME: - X: 45 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@TEXT: - X: 55 - Width: PARENT_RIGHT - 60 - Height: 15 - WordWrap: true - VAlign: Top - Shadow: True - TextField@CHAT_TEXTFIELD: - X: 200 - Y: PARENT_BOTTOM - 25 - Width: 382 - Height: 25 - LeftMargin: 60 - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: - ScrollPanel@NICKNAME_PANEL: - X: 596 - Width: PARENT_RIGHT - 596 - Height: PARENT_BOTTOM - 30 - Children: - Container@NICKNAME_TEMPLATE: - Height: 20 - Width: PARENT_RIGHT - 25 - Children: - Image@INDICATOR: - ImageCollection: lobby-bits - ImageName: admin - X: 4 - Y: 9 - Label@NICK: - X: 15 - Width: PARENT_RIGHT - 15 - Height: 20 - Button@DISCONNECT_BUTTON: - X: 596 - Y: PARENT_BOTTOM - 25 - Width: PARENT_RIGHT - 596 - Height: 25 - Text: Leave Chat - Font: Bold - Container@GLOBALCHAT_CONNECT_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Background: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - 30 - Background: scrollpanel-bg - Children: - Label@GLOBAL_CHAT_LABEL: - Y: PARENT_BOTTOM / 4 - Width: PARENT_RIGHT - Align: Center - Text: Global Chat - Font: Bold - Label@NICKNAME_LABEL: - X: 200 - Y: PARENT_BOTTOM / 4 + 35 - Text: Nickname: - TextField@NICKNAME_TEXTFIELD: - X: 270 - Y: PARENT_BOTTOM / 4 + 25 - Width: 150 - Height: 25 - Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX: - X: 270 - Y: PARENT_BOTTOM / 4 + 75 - Height: 20 - Width: 180 - Font: Regular - Text: Connect Automatically - Button@CONNECT_BUTTON: - X: 430 - Y: PARENT_BOTTOM / 4 + 25 - Width: 100 - Height: 25 - Text: Connect - Font: Bold - TextField@FAKE_CHAT: - X: 200 - Y: PARENT_BOTTOM - 25 - Width: PARENT_RIGHT - 200 - Height: 25 - LeftMargin: 60 - Disabled: true - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: diff --git a/mods/cnc/chrome/lobby.yaml b/mods/cnc/chrome/lobby.yaml index 2b26a0ccf8..d1c62350a0 100644 --- a/mods/cnc/chrome/lobby.yaml +++ b/mods/cnc/chrome/lobby.yaml @@ -57,18 +57,6 @@ Container@SERVER_LOBBY: Y: 30 Width: 582 Height: 219 - Button@LOBBYCHAT_TAB: - X: 15 - Y: PARENT_BOTTOM - 46 - Width: 95 - Height: 31 - Text: Game - Button@GLOBALCHAT_TAB: - X: 115 - Y: PARENT_BOTTOM - 46 - Width: 95 - Height: 31 - Text: Global Container@LOBBYCHAT: X: 15 Y: 285 @@ -107,9 +95,8 @@ Container@SERVER_LOBBY: VAlign: Top Shadow: True TextField@CHAT_TEXTFIELD: - X: 200 Y: PARENT_BOTTOM - HEIGHT - Width: PARENT_RIGHT - 200 + Width: PARENT_RIGHT Height: 25 LeftMargin: 50 Children: @@ -119,11 +106,6 @@ Container@SERVER_LOBBY: Height: 25 Align: Right Text: Chat: - Container@GLOBALCHAT_ROOT: - X: 15 - Y: 285 - Width: PARENT_RIGHT - 30 - Height: PARENT_BOTTOM - 300 Button@DISCONNECT_BUTTON: Y: PARENT_BOTTOM - 36 Width: 140 diff --git a/mods/cnc/chrome/multiplayer-globalchat.yaml b/mods/cnc/chrome/multiplayer-globalchat.yaml deleted file mode 100644 index b3c608ffe8..0000000000 --- a/mods/cnc/chrome/multiplayer-globalchat.yaml +++ /dev/null @@ -1,123 +0,0 @@ -Container@GLOBALCHAT_PANEL: - Logic: GlobalChatLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Container@GLOBALCHAT_MAIN_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Background@TOPIC: - Width: 582 - Height: 20 - Background: panel-transparent - Children: - Label@CHANNEL_TOPIC: - X: 10 - Y: 0 - 1 - Width: PARENT_RIGHT - 20 - Height: PARENT_BOTTOM - Font: TinyBold - Align: Center - ScrollPanel@HISTORY_PANEL: - Y: 19 - Width: 582 - Height: PARENT_BOTTOM - 49 - TopBottomSpacing: 4 - ItemSpacing: 4 - Children: - Container@CHAT_TEMPLATE: - X: 2 - Width: PARENT_RIGHT - 27 - Height: 16 - Children: - Label@TIME: - X: 3 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@NAME: - X: 45 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@TEXT: - X: 55 - Width: PARENT_RIGHT - 60 - Height: 15 - WordWrap: true - VAlign: Top - Shadow: True - TextField@CHAT_TEXTFIELD: - Y: PARENT_BOTTOM - 25 - Width: 582 - Height: 25 - LeftMargin: 60 - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: - ScrollPanel@NICKNAME_PANEL: - X: PARENT_RIGHT - WIDTH - Width: 174 - Height: PARENT_BOTTOM - 30 - Children: - Container@NICKNAME_TEMPLATE: - Height: 20 - Width: PARENT_RIGHT - 25 - Children: - Image@INDICATOR: - ImageCollection: lobby-bits - ImageName: admin - X: 4 - Y: 9 - Label@NICK: - X: 15 - Width: PARENT_RIGHT - 15 - Height: 20 - Button@DISCONNECT_BUTTON: - X: PARENT_RIGHT - WIDTH - Y: PARENT_BOTTOM - 25 - Width: 174 - Height: 25 - Text: Leave Chat - Font: Bold - Background@GLOBALCHAT_CONNECT_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Background: scrollpanel-bg - Children: - Label@GLOBAL_CHAT_LABEL: - Y: PARENT_BOTTOM / 4 - Width: PARENT_RIGHT - Align: Center - Text: Global Chat - Font: Bold - Label@NICKNAME_LABEL: - X: 200 - Y: PARENT_BOTTOM / 4 + 35 - Text: Nickname: - TextField@NICKNAME_TEXTFIELD: - X: 270 - Y: PARENT_BOTTOM / 4 + 25 - Width: 150 - Height: 25 - Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX: - X: 270 - Y: PARENT_BOTTOM / 4 + 75 - Height: 20 - Width: 180 - Font: Regular - Text: Connect Automatically - Button@CONNECT_BUTTON: - X: 430 - Y: PARENT_BOTTOM / 4 + 25 - Width: 100 - Height: 25 - Text: Connect - Font: Bold diff --git a/mods/cnc/chrome/multiplayer.yaml b/mods/cnc/chrome/multiplayer.yaml index 18c34b0ce8..9e5571626b 100644 --- a/mods/cnc/chrome/multiplayer.yaml +++ b/mods/cnc/chrome/multiplayer.yaml @@ -1,9 +1,9 @@ Container@MULTIPLAYER_PANEL: Logic: MultiplayerLogic X: (WINDOW_RIGHT - WIDTH) / 2 - Y: (WINDOW_BOTTOM - 560) / 2 + Y: (WINDOW_BOTTOM - 345) / 2 Width: 800 - Height: 575 + Height: 360 Children: Label@TITLE: Text: Multiplayer @@ -51,11 +51,6 @@ Container@MULTIPLAYER_PANEL: X: 15 Width: PARENT_RIGHT - 30 Height: PARENT_BOTTOM - Container@GLOBALCHAT_ROOT: - X: 15 - Y: 315 - Width: PARENT_RIGHT - 30 - Height: PARENT_BOTTOM - 330 TooltipContainer@TOOLTIP_CONTAINER: Button@BACK_BUTTON: Key: escape diff --git a/mods/cnc/mod.yaml b/mods/cnc/mod.yaml index aa0c7a2b52..6b37be1040 100644 --- a/mods/cnc/mod.yaml +++ b/mods/cnc/mod.yaml @@ -93,14 +93,12 @@ ChromeLayout: cnc|chrome/multiplayer-browser.yaml cnc|chrome/multiplayer-createserver.yaml cnc|chrome/multiplayer-directconnect.yaml - cnc|chrome/multiplayer-globalchat.yaml cnc|chrome/lobby.yaml cnc|chrome/lobby-mappreview.yaml cnc|chrome/lobby-players.yaml cnc|chrome/lobby-options.yaml cnc|chrome/lobby-music.yaml cnc|chrome/lobby-kickdialogs.yaml - cnc|chrome/lobby-globalchat.yaml cnc|chrome/connection.yaml cnc|chrome/color-picker.yaml cnc|chrome/mapchooser.yaml diff --git a/mods/common/chrome/lobby-globalchat.yaml b/mods/common/chrome/lobby-globalchat.yaml deleted file mode 100644 index 8ebb4617d9..0000000000 --- a/mods/common/chrome/lobby-globalchat.yaml +++ /dev/null @@ -1,142 +0,0 @@ -Container@LOBBY_GLOBALCHAT_PANEL: - Logic: GlobalChatLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Container@GLOBALCHAT_MAIN_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - 30 - Children: - Background@TOPIC: - Width: 582 - Height: 20 - Background: dialog2 - Children: - Label@CHANNEL_TOPIC: - X: 10 - Y: 0 - 1 - Width: PARENT_RIGHT - 20 - Height: PARENT_BOTTOM - Font: TinyBold - Align: Center - ScrollPanel@HISTORY_PANEL: - Y: 20 - Width: 582 - Height: PARENT_BOTTOM - 50 - TopBottomSpacing: 4 - ItemSpacing: 4 - Children: - Container@CHAT_TEMPLATE: - X: 2 - Width: PARENT_RIGHT - 27 - Height: 16 - Children: - Label@TIME: - X: 3 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@NAME: - X: 45 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@TEXT: - X: 55 - Width: PARENT_RIGHT - 60 - Height: 15 - WordWrap: true - VAlign: Top - Shadow: True - TextField@CHAT_TEXTFIELD: - X: 205 - Y: PARENT_BOTTOM - 25 - Width: 582 - 205 - Height: 25 - LeftMargin: 60 - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: - ScrollPanel@NICKNAME_PANEL: - X: 596 - Width: PARENT_RIGHT - 596 - Height: PARENT_BOTTOM - 30 - Children: - Container@NICKNAME_TEMPLATE: - Width: PARENT_RIGHT - 25 - Height: 20 - Children: - Image@INDICATOR: - ImageCollection: lobby-bits - ImageName: admin - X: 4 - Y: 9 - Label@NICK: - X: 15 - Width: PARENT_RIGHT - 15 - Height: 20 - Button@DISCONNECT_BUTTON: - X: 596 - Y: PARENT_BOTTOM - 25 - Width: PARENT_RIGHT - 596 - Height: 25 - Text: Leave Chat - Font: Bold - Container@GLOBALCHAT_CONNECT_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - 30 - Children: - Background: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - 30 - Background: scrollpanel-bg - Children: - Label@GLOBAL_CHAT_LABEL: - Y: PARENT_BOTTOM / 4 - Width: PARENT_RIGHT - Align: Center - Text: Global Chat - Font: Bold - Label@NICKNAME_LABEL: - X: 200 - Y: PARENT_BOTTOM / 4 + 35 - Text: Nickname: - TextField@NICKNAME_TEXTFIELD: - X: 270 - Y: PARENT_BOTTOM / 4 + 25 - Width: 150 - Height: 25 - Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX: - X: 270 - Y: PARENT_BOTTOM / 4 + 75 - Height: 20 - Width: 180 - Font: Regular - Text: Connect Automatically - Button@CONNECT_BUTTON: - X: 430 - Y: PARENT_BOTTOM / 4 + 25 - Width: 100 - Height: 25 - Text: Connect - Font: Bold - TextField@FAKE_CHAT: - X: 205 - Y: PARENT_BOTTOM - 25 - Width: PARENT_RIGHT - 205 - Height: 25 - LeftMargin: 60 - Disabled: true - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: diff --git a/mods/common/chrome/lobby.yaml b/mods/common/chrome/lobby.yaml index 9072ade707..c55a85d862 100644 --- a/mods/common/chrome/lobby.yaml +++ b/mods/common/chrome/lobby.yaml @@ -57,25 +57,11 @@ Background@SERVER_LOBBY: Height: 25 Text: Change Map Font: Bold - Button@LOBBYCHAT_TAB: - X: 20 - Y: PARENT_BOTTOM - 81 - Width: 100 - Height: 31 - Text: Game - Font: Bold - Button@GLOBALCHAT_TAB: - X: 120 - Y: PARENT_BOTTOM - 81 - Width: 100 - Height: 31 - Text: Global - Font: Bold Container@LOBBYCHAT: X: 20 - Y: PARENT_BOTTOM - HEIGHT - 50 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: PARENT_RIGHT - 40 - Height: 229 + Height: 259 Children: ScrollPanel@CHAT_DISPLAY: Width: PARENT_RIGHT @@ -108,9 +94,8 @@ Background@SERVER_LOBBY: VAlign: Top Shadow: True TextField@CHAT_TEXTFIELD: - X: 205 Y: PARENT_BOTTOM - HEIGHT - Width: PARENT_RIGHT - 205 + Width: PARENT_RIGHT - 260 Height: 25 LeftMargin: 50 Children: @@ -120,11 +105,6 @@ Background@SERVER_LOBBY: Height: 25 Align: Right Text: Chat: - Container@GLOBALCHAT_ROOT: - X: 20 - Y: PARENT_BOTTOM - HEIGHT - 20 - Width: PARENT_RIGHT - 40 - Height: 259 Button@START_GAME_BUTTON: X: PARENT_RIGHT - WIDTH - 150 Y: PARENT_BOTTOM - HEIGHT - 20 diff --git a/mods/common/chrome/multiplayer-browser.yaml b/mods/common/chrome/multiplayer-browser.yaml index ae22562138..fcd22e92b8 100644 --- a/mods/common/chrome/multiplayer-browser.yaml +++ b/mods/common/chrome/multiplayer-browser.yaml @@ -35,7 +35,7 @@ Container@MULTIPLAYER_BROWSER_PANEL: ScrollPanel@SERVER_LIST: Y: 30 Width: 583 - Height: 249 + Height: 279 TopBottomSpacing: 2 Children: ScrollItem@HEADER_TEMPLATE: diff --git a/mods/common/chrome/multiplayer-createserver.yaml b/mods/common/chrome/multiplayer-createserver.yaml index ac907169ba..e0f528cb62 100644 --- a/mods/common/chrome/multiplayer-createserver.yaml +++ b/mods/common/chrome/multiplayer-createserver.yaml @@ -13,11 +13,11 @@ Container@MULTIPLAYER_CREATESERVER_PANEL: ScrollPanel: Y: 30 Width: 583 - Height: 249 + Height: 279 Children: Container: X: 185 - Y: 25 + Y: 30 Children: Label@SERVER_NAME_LABEL: Y: 14 diff --git a/mods/common/chrome/multiplayer-directconnect.yaml b/mods/common/chrome/multiplayer-directconnect.yaml index 5071625a0d..4777c7e9d1 100644 --- a/mods/common/chrome/multiplayer-directconnect.yaml +++ b/mods/common/chrome/multiplayer-directconnect.yaml @@ -12,11 +12,11 @@ Container@MULTIPLAYER_DIRECTCONNECT_PANEL: ScrollPanel: Y: 30 Width: 583 - Height: 249 + Height: 279 Children: Container: X: 185 - Y: 60 + Y: 85 Children: Label@ADDRESS_LABEL: Y: 14 diff --git a/mods/common/chrome/multiplayer-globalchat.yaml b/mods/common/chrome/multiplayer-globalchat.yaml deleted file mode 100644 index b9ad2b261c..0000000000 --- a/mods/common/chrome/multiplayer-globalchat.yaml +++ /dev/null @@ -1,123 +0,0 @@ -Container@GLOBALCHAT_PANEL: - Logic: GlobalChatLogic - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Container@GLOBALCHAT_MAIN_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Children: - Background@TOPIC: - Width: 582 - Height: 20 - Background: dialog2 - Children: - Label@CHANNEL_TOPIC: - X: 10 - Y: 0 - 1 - Width: PARENT_RIGHT - 20 - Height: PARENT_BOTTOM - Font: TinyBold - Align: Center - ScrollPanel@HISTORY_PANEL: - Y: 20 - Width: 582 - Height: PARENT_BOTTOM - 50 - TopBottomSpacing: 4 - ItemSpacing: 4 - Children: - Container@CHAT_TEMPLATE: - X: 2 - Width: PARENT_RIGHT - 27 - Height: 16 - Children: - Label@TIME: - X: 3 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@NAME: - X: 45 - Width: 50 - Height: 15 - VAlign: Top - Shadow: True - Label@TEXT: - X: 55 - Width: PARENT_RIGHT - 60 - Height: 15 - WordWrap: true - VAlign: Top - Shadow: True - TextField@CHAT_TEXTFIELD: - Y: PARENT_BOTTOM - 25 - Width: 582 - Height: 25 - LeftMargin: 60 - Children: - Label@LABEL_CHATTYPE: - Y: 0 - 1 - Width: 55 - Height: 25 - Align: Right - Text: Global: - ScrollPanel@NICKNAME_PANEL: - X: PARENT_RIGHT - WIDTH - Width: 174 - Height: PARENT_BOTTOM - 30 - Children: - Container@NICKNAME_TEMPLATE: - Height: 20 - Width: PARENT_RIGHT - 25 - Children: - Image@INDICATOR: - ImageCollection: lobby-bits - ImageName: admin - X: 4 - Y: 9 - Label@NICK: - X: 15 - Width: PARENT_RIGHT - 15 - Height: 20 - Button@DISCONNECT_BUTTON: - X: PARENT_RIGHT - WIDTH - Y: PARENT_BOTTOM - 25 - Width: 174 - Height: 25 - Text: Leave Chat - Font: Bold - Background@GLOBALCHAT_CONNECT_PANEL: - Width: PARENT_RIGHT - Height: PARENT_BOTTOM - Background: scrollpanel-bg - Children: - Label@GLOBAL_CHAT_LABEL: - Y: PARENT_BOTTOM / 4 - Width: PARENT_RIGHT - Align: Center - Text: Global Chat - Font: Bold - Label@NICKNAME_LABEL: - X: 200 - Y: PARENT_BOTTOM / 4 + 35 - Text: Nickname: - TextField@NICKNAME_TEXTFIELD: - X: 270 - Y: PARENT_BOTTOM / 4 + 25 - Width: 150 - Height: 25 - Checkbox@CONNECT_AUTOMATICALLY_CHECKBOX: - X: 270 - Y: PARENT_BOTTOM / 4 + 75 - Height: 20 - Width: 180 - Font: Regular - Text: Connect Automatically - Button@CONNECT_BUTTON: - X: 430 - Y: PARENT_BOTTOM / 4 + 25 - Width: 100 - Height: 25 - Text: Connect - Font: Bold diff --git a/mods/common/chrome/multiplayer.yaml b/mods/common/chrome/multiplayer.yaml index 6df32ced33..578abb031b 100644 --- a/mods/common/chrome/multiplayer.yaml +++ b/mods/common/chrome/multiplayer.yaml @@ -3,7 +3,7 @@ Background@MULTIPLAYER_PANEL: X: (WINDOW_RIGHT - WIDTH) / 2 Y: (WINDOW_BOTTOM - HEIGHT) / 2 Width: 808 - Height: 600 + Height: 395 Children: Label@TITLE: Y: 15 @@ -14,35 +14,35 @@ Background@MULTIPLAYER_PANEL: Font: Bold DropDownButton@FILTERS_DROPDOWNBUTTON: X: 20 - Y: 321 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 158 Height: 25 Text: Filter Games Font: Bold Button@REFRESH_BUTTON: X: 183 - Y: 321 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 100 Height: 25 Text: Refresh Font: Bold Button@BROWSER_TAB: X: 288 - Y: 315 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 105 Height: 31 Text: Browse Font: Bold Button@DIRECTCONNECT_TAB: X: 393 - Y: 315 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 105 Height: 31 Text: Direct IP Font: Bold Button@CREATE_TAB: X: 498 - Y: 315 + Y: PARENT_BOTTOM - HEIGHT - 20 Width: 105 Height: 31 Text: Create @@ -51,18 +51,13 @@ Background@MULTIPLAYER_PANEL: X: 20 Y: 37 Width: PARENT_RIGHT - 40 - Height: PARENT_BOTTOM - Container@GLOBALCHAT_ROOT: - X: 20 - Y: 351 - Width: PARENT_RIGHT - 40 - Height: PARENT_BOTTOM - 401 + Height: PARENT_BOTTOM - 87 TooltipContainer@TOOLTIP_CONTAINER: Button@BACK_BUTTON: Key: escape X: PARENT_RIGHT - WIDTH - 20 Y: PARENT_BOTTOM - HEIGHT - 20 - Width: 120 + Width: 174 Height: 25 Text: Back Font: Bold diff --git a/mods/common/metrics.yaml b/mods/common/metrics.yaml index 97d47ccd94..c29df52199 100644 --- a/mods/common/metrics.yaml +++ b/mods/common/metrics.yaml @@ -10,9 +10,6 @@ Metrics: ButtonTextShadow: false CheckboxPressedState: false GameStartedColor: FFA500 - GlobalChatNotificationColor: FFA500 - GlobalChatTextColor: FFFFFF - GlobalChatPlayerNameColor: 00FF00 HotkeyColor: FFFFFF HotkeyColorDisabled: 808080 HotkeyFont: Regular diff --git a/mods/d2k/mod.yaml b/mods/d2k/mod.yaml index 959c1dfb96..58ae989899 100644 --- a/mods/d2k/mod.yaml +++ b/mods/d2k/mod.yaml @@ -88,14 +88,12 @@ ChromeLayout: common|chrome/lobby-options.yaml common|chrome/lobby-music.yaml common|chrome/lobby-kickdialogs.yaml - common|chrome/lobby-globalchat.yaml common|chrome/color-picker.yaml common|chrome/map-chooser.yaml common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml - common|chrome/multiplayer-globalchat.yaml common|chrome/connection.yaml d2k|chrome/dropdowns.yaml common|chrome/musicplayer.yaml diff --git a/mods/ra/mod.yaml b/mods/ra/mod.yaml index b60efeb9b1..076efa3206 100644 --- a/mods/ra/mod.yaml +++ b/mods/ra/mod.yaml @@ -103,14 +103,12 @@ ChromeLayout: common|chrome/lobby-options.yaml common|chrome/lobby-music.yaml common|chrome/lobby-kickdialogs.yaml - common|chrome/lobby-globalchat.yaml common|chrome/color-picker.yaml common|chrome/map-chooser.yaml common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml - common|chrome/multiplayer-globalchat.yaml common|chrome/connection.yaml common|chrome/replaybrowser.yaml common|chrome/dropdowns.yaml diff --git a/mods/ts/mod.yaml b/mods/ts/mod.yaml index 41264d5952..6c23b84c0c 100644 --- a/mods/ts/mod.yaml +++ b/mods/ts/mod.yaml @@ -151,14 +151,12 @@ ChromeLayout: common|chrome/lobby-options.yaml common|chrome/lobby-music.yaml common|chrome/lobby-kickdialogs.yaml - common|chrome/lobby-globalchat.yaml ts|chrome/color-picker.yaml common|chrome/map-chooser.yaml common|chrome/multiplayer.yaml common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-directconnect.yaml - common|chrome/multiplayer-globalchat.yaml common|chrome/connection.yaml common|chrome/replaybrowser.yaml ts|chrome/dropdowns.yaml diff --git a/packaging/windows/OpenRA.nsi b/packaging/windows/OpenRA.nsi index 48679f0855..2ab6864b2f 100644 --- a/packaging/windows/OpenRA.nsi +++ b/packaging/windows/OpenRA.nsi @@ -122,7 +122,6 @@ Section "Game" GAME File "${SRCDIR}\MaxMind.Db.dll" File "${SRCDIR}\GeoLite2-Country.mmdb.gz" File "${SRCDIR}\eluant.dll" - File "${SRCDIR}\SmarIrc4net.dll" File "${SRCDIR}\rix0rrr.BeaconLib.dll" File "${DEPSDIR}\soft_oal.dll" File "${DEPSDIR}\SDL2.dll" @@ -252,7 +251,6 @@ Function ${UN}Clean Delete $INSTDIR\freetype6.dll Delete $INSTDIR\SDL2-CS.dll Delete $INSTDIR\OpenAL-CS.dll - Delete $INSTDIR\SmarIrc4net.dll Delete $INSTDIR\rix0rrr.BeaconLib.dll RMDir /r $INSTDIR\Support diff --git a/thirdparty/fetch-thirdparty-deps.ps1 b/thirdparty/fetch-thirdparty-deps.ps1 index 641f1763f9..beba0609e0 100644 --- a/thirdparty/fetch-thirdparty-deps.ps1 +++ b/thirdparty/fetch-thirdparty-deps.ps1 @@ -150,14 +150,6 @@ if (!(Test-Path "GeoLite2-Country.mmdb.gz") -Or (((get-date) - (get-item "GeoLit (New-Object System.Net.WebClient).DownloadFile("http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz", $target) } -if (!(Test-Path "SmarIrc4net.dll")) -{ - echo "Fetching SmartIrc4net from NuGet." - ./nuget.exe install SmartIrc4net -Version 0.4.5.1 -ExcludeVersion -Verbosity quiet - cp SmartIrc4net/lib/net40/SmarIrc4net.* . - rmdir SmartIrc4net -Recurse -} - if (!(Test-Path "rix0rrr.BeaconLib.dll")) { echo "Fetching rix0rrr.BeaconLib from NuGet." diff --git a/thirdparty/fetch-thirdparty-deps.sh b/thirdparty/fetch-thirdparty-deps.sh index c7a9537bc5..931d9b19b6 100755 --- a/thirdparty/fetch-thirdparty-deps.sh +++ b/thirdparty/fetch-thirdparty-deps.sh @@ -96,13 +96,6 @@ if [ ! -f Eluant.dll ]; then curl -s -L -O https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll fi -if [ ! -f SmarIrc4net.dll ]; then - echo "Fetching SmartIrc4net from NuGet." - ../noget.sh SmartIrc4net 0.4.5.1 - cp ./SmartIrc4net/lib/net40/SmarIrc4net* . - rm -rf SmartIrc4net -fi - if [ ! -f rix0rrr.BeaconLib.dll ]; then echo "Fetching rix0rrr.BeaconLib from NuGet." ../noget.sh rix0rrr.BeaconLib 1.0.1