Remove global chat integration.

This commit is contained in:
Paul Chote
2017-12-13 19:16:41 +00:00
committed by Matthias Mailänder
parent 488cec64b8
commit 502c3e2bf5
29 changed files with 20 additions and 1260 deletions

View File

@@ -169,9 +169,6 @@ under the MIT license.
Using ICSharpCode.SharpZipLib initially by Mike Using ICSharpCode.SharpZipLib initially by Mike
Krueger and distributed under the GNU GPL terms. 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 Using rix0rrr.BeaconLib developed by Rico Huijbers
distributed under MIT License. distributed under MIT License.

View File

@@ -41,7 +41,7 @@ SDK ?=
CSC = mcs $(SDK) CSC = mcs $(SDK)
CSFLAGS = -nologo -warn:4 -codepage:utf8 -langversion:5 -unsafe -warnaserror CSFLAGS = -nologo -warn:4 -codepage:utf8 -langversion:5 -unsafe -warnaserror
DEFINE = TRACE 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_PATH :=
NUNIT_LIBS := $(NUNIT_LIBS_PATH)nunit.framework.dll NUNIT_LIBS := $(NUNIT_LIBS_PATH)nunit.framework.dll
@@ -357,7 +357,6 @@ install-engine:
@$(CP) SharpFont.dll.config "$(DATA_INSTALL_DIR)" @$(CP) SharpFont.dll.config "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) Open.Nat.dll "$(DATA_INSTALL_DIR)" @$(INSTALL_PROGRAM) Open.Nat.dll "$(DATA_INSTALL_DIR)"
@$(INSTALL_PROGRAM) MaxMind.Db.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_PROGRAM) rix0rrr.BeaconLib.dll "$(DATA_INSTALL_DIR)"
install-common-mod-files: install-common-mod-files:

View File

@@ -21,7 +21,6 @@ using System.Net;
using System.Reflection; using System.Reflection;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using OpenRA.Chat;
using OpenRA.Graphics; using OpenRA.Graphics;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Primitives; using OpenRA.Primitives;
@@ -55,8 +54,6 @@ namespace OpenRA
public static bool BenchmarkMode = false; public static bool BenchmarkMode = false;
public static GlobalChat GlobalChat;
public static string EngineVersion { get; private set; } public static string EngineVersion { get; private set; }
static Task discoverNat; static Task discoverNat;
@@ -338,8 +335,6 @@ namespace OpenRA
Settings.Server.AllowPortForward = true; Settings.Server.AllowPortForward = true;
} }
GlobalChat = new GlobalChat();
var modSearchArg = args.GetValue("Engine.ModSearchPaths", null); var modSearchArg = args.GetValue("Engine.ModSearchPaths", null);
var modSearchPaths = modSearchArg != null ? var modSearchPaths = modSearchArg != null ?
FieldLoader.GetValue<string[]>("Engine.ModsPath", modSearchArg) : FieldLoader.GetValue<string[]>("Engine.ModsPath", modSearchArg) :
@@ -821,7 +816,6 @@ namespace OpenRA
ModData.Dispose(); ModData.Dispose();
ChromeProvider.Deinitialize(); ChromeProvider.Deinitialize();
GlobalChat.Dispose();
Sound.Dispose(); Sound.Dispose();
Renderer.Dispose(); Renderer.Dispose();

View File

@@ -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<string, ChatUser> Users = new ObservableSortedDictionary<string, ChatUser>(StringComparer.InvariantCultureIgnoreCase);
public readonly ObservableList<ChatMessage> History = new ObservableList<ChatMessage>();
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();
}
}
}

View File

@@ -98,10 +98,6 @@
<HintPath>..\thirdparty\download\MaxMind.Db.dll</HintPath> <HintPath>..\thirdparty\download\MaxMind.Db.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="SmarIrc4net">
<HintPath>..\thirdparty\download\SmarIrc4net.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Activities\Activity.cs" /> <Compile Include="Activities\Activity.cs" />
@@ -247,7 +243,6 @@
<Compile Include="Renderer.cs" /> <Compile Include="Renderer.cs" />
<Compile Include="Platform.cs" /> <Compile Include="Platform.cs" />
<Compile Include="GameSpeed.cs" /> <Compile Include="GameSpeed.cs" />
<Compile Include="GlobalChat.cs" />
<Compile Include="Primitives\ObservableList.cs" /> <Compile Include="Primitives\ObservableList.cs" />
<Compile Include="Graphics\RgbaColorRenderer.cs" /> <Compile Include="Graphics\RgbaColorRenderer.cs" />
<Compile Include="Traits\Player\IndexedPlayerPalette.cs" /> <Compile Include="Traits\Player\IndexedPlayerPalette.cs" />

View File

@@ -194,16 +194,6 @@ namespace OpenRA
public MPGameFilters MPGameFilters = MPGameFilters.Waiting | MPGameFilters.Empty | MPGameFilters.Protected | MPGameFilters.Started; 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 public class Settings
{ {
readonly string settingsFile; readonly string settingsFile;
@@ -215,7 +205,6 @@ namespace OpenRA
public readonly ServerSettings Server = new ServerSettings(); public readonly ServerSettings Server = new ServerSettings();
public readonly DebugSettings Debug = new DebugSettings(); public readonly DebugSettings Debug = new DebugSettings();
internal Dictionary<string, Hotkey> Keys = new Dictionary<string, Hotkey>(); internal Dictionary<string, Hotkey> Keys = new Dictionary<string, Hotkey>();
public readonly ChatSettings Chat = new ChatSettings();
public readonly Dictionary<string, object> Sections; public readonly Dictionary<string, object> Sections;
@@ -235,7 +224,6 @@ namespace OpenRA
{ "Graphics", Graphics }, { "Graphics", Graphics },
{ "Server", Server }, { "Server", Server },
{ "Debug", Debug }, { "Debug", Debug },
{ "Chat", Chat }
}; };
// Override fieldloader to ignore invalid entries // Override fieldloader to ignore invalid entries

View File

@@ -728,7 +728,6 @@
<Compile Include="Traits\SpawnActorOnDeath.cs" /> <Compile Include="Traits\SpawnActorOnDeath.cs" />
<Compile Include="Scripting\Global\LightingGlobal.cs" /> <Compile Include="Scripting\Global\LightingGlobal.cs" />
<Compile Include="Traits\SupportPowers\ProduceActorPower.cs" /> <Compile Include="Traits\SupportPowers\ProduceActorPower.cs" />
<Compile Include="Widgets\Logic\GlobalChatLogic.cs" />
<Compile Include="Lint\CheckChromeLogic.cs" /> <Compile Include="Lint\CheckChromeLogic.cs" />
<Compile Include="Lint\CheckMapMetadata.cs" /> <Compile Include="Lint\CheckMapMetadata.cs" />
<Compile Include="Widgets\Logic\MultiplayerLogic.cs" /> <Compile Include="Widgets\Logic\MultiplayerLogic.cs" />

View File

@@ -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<ScrollPanelWidget>("HISTORY_PANEL");
chatTemplate = historyPanel.Get<ContainerWidget>("CHAT_TEMPLATE");
nicknamePanel = widget.Get<ScrollPanelWidget>("NICKNAME_PANEL");
nicknameTemplate = nicknamePanel.Get("NICKNAME_TEMPLATE");
var textColor = ChromeMetrics.Get<Color>("GlobalChatTextColor");
var textLabel = chatTemplate.Get<LabelWidget>("TEXT");
textLabel.GetColor = () => textColor;
historyPanel.Bind(Game.GlobalChat.History, MakeHistoryWidget, HistoryWidgetEquals, true);
nicknamePanel.Bind(Game.GlobalChat.Users, MakeUserWidget, UserWidgetEquals, false);
inputBox = widget.Get<TextFieldWidget>("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<TextFieldWidget>("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<ButtonWidget>("DISCONNECT_BUTTON");
disconnectButton.OnClick = Game.GlobalChat.Disconnect;
var connectAutomaticallyCheckBox = connectPanel.Get<CheckboxWidget>("CONNECT_AUTOMATICALLY_CHECKBOX");
connectAutomaticallyCheckBox.IsChecked = () => Game.Settings.Chat.ConnectAutomatically;
connectAutomaticallyCheckBox.OnClick = () => { Game.Settings.Chat.ConnectAutomatically ^= true; Game.Settings.Save(); };
var connectButton = connectPanel.Get<ButtonWidget>("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<LabelWidget>("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<Color>("GlobalChatNotificationColor")
: ChromeMetrics.Get<Color>("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<LabelWidget>("NICK");
name.GetText = () => client.Name;
name.IsVisible = () => true;
// TODO: Add custom image for voice
var indicator = item.Get<ImageWidget>("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;
}
}
}

View File

@@ -14,7 +14,6 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using OpenRA.Chat;
using OpenRA.Graphics; using OpenRA.Graphics;
using OpenRA.Network; using OpenRA.Network;
using OpenRA.Traits; using OpenRA.Traits;
@@ -38,9 +37,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
enum PanelType { Players, Options, Music, Kick, ForceStart } enum PanelType { Players, Options, Music, Kick, ForceStart }
PanelType panel = PanelType.Players; PanelType panel = PanelType.Players;
enum ChatPanelType { Lobby, Global }
ChatPanelType chatPanel = ChatPanelType.Lobby;
readonly Widget lobby; readonly Widget lobby;
readonly Widget editablePlayerTemplate; readonly Widget editablePlayerTemplate;
readonly Widget nonEditablePlayerTemplate; readonly Widget nonEditablePlayerTemplate;
@@ -65,9 +61,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
MapPreview map; MapPreview map;
bool addBotOnMapLoad; bool addBotOnMapLoad;
bool teamChat; bool teamChat;
int lobbyChatUnreadMessages;
int globalChatLastReadMessages;
int globalChatUnreadMessages;
// Listen for connection failures // Listen for connection failures
void ConnectionStateChanged(OrderManager om) void ConnectionStateChanged(OrderManager om)
@@ -353,33 +346,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (skirmishMode) if (skirmishMode)
disconnectButton.Text = "Back"; disconnectButton.Text = "Back";
var globalChat = Game.LoadWidget(null, "LOBBY_GLOBALCHAT_PANEL", lobby.Get("GLOBALCHAT_ROOT"), new WidgetArgs());
var globalChatInput = globalChat.Get<TextFieldWidget>("CHAT_TEXTFIELD");
globalChat.IsVisible = () => chatPanel == ChatPanelType.Global;
var globalChatTab = lobby.Get<ButtonWidget>("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<LabelWidget>("LABEL_CHATTYPE"); chatLabel = lobby.Get<LabelWidget>("LABEL_CHATTYPE");
var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD"); var chatTextField = lobby.Get<TextFieldWidget>("CHAT_TEXTFIELD");
chatTextField.MaxLength = UnitOrders.ChatMessageMaxLength; chatTextField.MaxLength = UnitOrders.ChatMessageMaxLength;
@@ -412,23 +378,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
chatTextField.OnEscKey = () => { chatTextField.Text = ""; return true; }; chatTextField.OnEscKey = () => { chatTextField.Text = ""; return true; };
var lobbyChatTab = lobby.Get<ButtonWidget>("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<ScrollPanelWidget>("CHAT_DISPLAY"); lobbyChatPanel = lobby.Get<ScrollPanelWidget>("CHAT_DISPLAY");
chatTemplate = lobbyChatPanel.Get("CHAT_TEMPLATE"); chatTemplate = lobbyChatPanel.Get("CHAT_TEMPLATE");
lobbyChatPanel.RemoveChildren(); lobbyChatPanel.RemoveChildren();
@@ -473,22 +422,10 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{ {
if (panel == PanelType.Options && OptionsTabDisabled()) if (panel == PanelType.Options && OptionsTabDisabled())
panel = PanelType.Players; 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) void AddChatLine(Color c, string from, string text)
{ {
lobbyChatUnreadMessages += 1;
var template = (ContainerWidget)chatTemplate.Clone(); var template = (ContainerWidget)chatTemplate.Clone();
LobbyUtils.SetupChatLine(template, c, DateTime.Now, from, text); LobbyUtils.SetupChatLine(template, c, DateTime.Now, from, text);

View File

@@ -109,7 +109,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
createServerTab.OnClick = () => panel = PanelType.CreateServer; createServerTab.OnClick = () => panel = PanelType.CreateServer;
widget.Get<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; widget.Get<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
Game.LoadWidget(null, "GLOBALCHAT_PANEL", widget.Get("GLOBALCHAT_ROOT"), new WidgetArgs());
lanGameLocations = new List<BeaconLocation>(); lanGameLocations = new List<BeaconLocation>();
try try

View File

@@ -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:

View File

@@ -57,18 +57,6 @@ Container@SERVER_LOBBY:
Y: 30 Y: 30
Width: 582 Width: 582
Height: 219 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: Container@LOBBYCHAT:
X: 15 X: 15
Y: 285 Y: 285
@@ -107,9 +95,8 @@ Container@SERVER_LOBBY:
VAlign: Top VAlign: Top
Shadow: True Shadow: True
TextField@CHAT_TEXTFIELD: TextField@CHAT_TEXTFIELD:
X: 200
Y: PARENT_BOTTOM - HEIGHT Y: PARENT_BOTTOM - HEIGHT
Width: PARENT_RIGHT - 200 Width: PARENT_RIGHT
Height: 25 Height: 25
LeftMargin: 50 LeftMargin: 50
Children: Children:
@@ -119,11 +106,6 @@ Container@SERVER_LOBBY:
Height: 25 Height: 25
Align: Right Align: Right
Text: Chat: Text: Chat:
Container@GLOBALCHAT_ROOT:
X: 15
Y: 285
Width: PARENT_RIGHT - 30
Height: PARENT_BOTTOM - 300
Button@DISCONNECT_BUTTON: Button@DISCONNECT_BUTTON:
Y: PARENT_BOTTOM - 36 Y: PARENT_BOTTOM - 36
Width: 140 Width: 140

View File

@@ -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

View File

@@ -1,9 +1,9 @@
Container@MULTIPLAYER_PANEL: Container@MULTIPLAYER_PANEL:
Logic: MultiplayerLogic Logic: MultiplayerLogic
X: (WINDOW_RIGHT - WIDTH) / 2 X: (WINDOW_RIGHT - WIDTH) / 2
Y: (WINDOW_BOTTOM - 560) / 2 Y: (WINDOW_BOTTOM - 345) / 2
Width: 800 Width: 800
Height: 575 Height: 360
Children: Children:
Label@TITLE: Label@TITLE:
Text: Multiplayer Text: Multiplayer
@@ -51,11 +51,6 @@ Container@MULTIPLAYER_PANEL:
X: 15 X: 15
Width: PARENT_RIGHT - 30 Width: PARENT_RIGHT - 30
Height: PARENT_BOTTOM Height: PARENT_BOTTOM
Container@GLOBALCHAT_ROOT:
X: 15
Y: 315
Width: PARENT_RIGHT - 30
Height: PARENT_BOTTOM - 330
TooltipContainer@TOOLTIP_CONTAINER: TooltipContainer@TOOLTIP_CONTAINER:
Button@BACK_BUTTON: Button@BACK_BUTTON:
Key: escape Key: escape

View File

@@ -93,14 +93,12 @@ ChromeLayout:
cnc|chrome/multiplayer-browser.yaml cnc|chrome/multiplayer-browser.yaml
cnc|chrome/multiplayer-createserver.yaml cnc|chrome/multiplayer-createserver.yaml
cnc|chrome/multiplayer-directconnect.yaml cnc|chrome/multiplayer-directconnect.yaml
cnc|chrome/multiplayer-globalchat.yaml
cnc|chrome/lobby.yaml cnc|chrome/lobby.yaml
cnc|chrome/lobby-mappreview.yaml cnc|chrome/lobby-mappreview.yaml
cnc|chrome/lobby-players.yaml cnc|chrome/lobby-players.yaml
cnc|chrome/lobby-options.yaml cnc|chrome/lobby-options.yaml
cnc|chrome/lobby-music.yaml cnc|chrome/lobby-music.yaml
cnc|chrome/lobby-kickdialogs.yaml cnc|chrome/lobby-kickdialogs.yaml
cnc|chrome/lobby-globalchat.yaml
cnc|chrome/connection.yaml cnc|chrome/connection.yaml
cnc|chrome/color-picker.yaml cnc|chrome/color-picker.yaml
cnc|chrome/mapchooser.yaml cnc|chrome/mapchooser.yaml

View File

@@ -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:

View File

@@ -57,25 +57,11 @@ Background@SERVER_LOBBY:
Height: 25 Height: 25
Text: Change Map Text: Change Map
Font: Bold 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: Container@LOBBYCHAT:
X: 20 X: 20
Y: PARENT_BOTTOM - HEIGHT - 50 Y: PARENT_BOTTOM - HEIGHT - 20
Width: PARENT_RIGHT - 40 Width: PARENT_RIGHT - 40
Height: 229 Height: 259
Children: Children:
ScrollPanel@CHAT_DISPLAY: ScrollPanel@CHAT_DISPLAY:
Width: PARENT_RIGHT Width: PARENT_RIGHT
@@ -108,9 +94,8 @@ Background@SERVER_LOBBY:
VAlign: Top VAlign: Top
Shadow: True Shadow: True
TextField@CHAT_TEXTFIELD: TextField@CHAT_TEXTFIELD:
X: 205
Y: PARENT_BOTTOM - HEIGHT Y: PARENT_BOTTOM - HEIGHT
Width: PARENT_RIGHT - 205 Width: PARENT_RIGHT - 260
Height: 25 Height: 25
LeftMargin: 50 LeftMargin: 50
Children: Children:
@@ -120,11 +105,6 @@ Background@SERVER_LOBBY:
Height: 25 Height: 25
Align: Right Align: Right
Text: Chat: Text: Chat:
Container@GLOBALCHAT_ROOT:
X: 20
Y: PARENT_BOTTOM - HEIGHT - 20
Width: PARENT_RIGHT - 40
Height: 259
Button@START_GAME_BUTTON: Button@START_GAME_BUTTON:
X: PARENT_RIGHT - WIDTH - 150 X: PARENT_RIGHT - WIDTH - 150
Y: PARENT_BOTTOM - HEIGHT - 20 Y: PARENT_BOTTOM - HEIGHT - 20

View File

@@ -35,7 +35,7 @@ Container@MULTIPLAYER_BROWSER_PANEL:
ScrollPanel@SERVER_LIST: ScrollPanel@SERVER_LIST:
Y: 30 Y: 30
Width: 583 Width: 583
Height: 249 Height: 279
TopBottomSpacing: 2 TopBottomSpacing: 2
Children: Children:
ScrollItem@HEADER_TEMPLATE: ScrollItem@HEADER_TEMPLATE:

View File

@@ -13,11 +13,11 @@ Container@MULTIPLAYER_CREATESERVER_PANEL:
ScrollPanel: ScrollPanel:
Y: 30 Y: 30
Width: 583 Width: 583
Height: 249 Height: 279
Children: Children:
Container: Container:
X: 185 X: 185
Y: 25 Y: 30
Children: Children:
Label@SERVER_NAME_LABEL: Label@SERVER_NAME_LABEL:
Y: 14 Y: 14

View File

@@ -12,11 +12,11 @@ Container@MULTIPLAYER_DIRECTCONNECT_PANEL:
ScrollPanel: ScrollPanel:
Y: 30 Y: 30
Width: 583 Width: 583
Height: 249 Height: 279
Children: Children:
Container: Container:
X: 185 X: 185
Y: 60 Y: 85
Children: Children:
Label@ADDRESS_LABEL: Label@ADDRESS_LABEL:
Y: 14 Y: 14

View File

@@ -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

View File

@@ -3,7 +3,7 @@ Background@MULTIPLAYER_PANEL:
X: (WINDOW_RIGHT - WIDTH) / 2 X: (WINDOW_RIGHT - WIDTH) / 2
Y: (WINDOW_BOTTOM - HEIGHT) / 2 Y: (WINDOW_BOTTOM - HEIGHT) / 2
Width: 808 Width: 808
Height: 600 Height: 395
Children: Children:
Label@TITLE: Label@TITLE:
Y: 15 Y: 15
@@ -14,35 +14,35 @@ Background@MULTIPLAYER_PANEL:
Font: Bold Font: Bold
DropDownButton@FILTERS_DROPDOWNBUTTON: DropDownButton@FILTERS_DROPDOWNBUTTON:
X: 20 X: 20
Y: 321 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 158 Width: 158
Height: 25 Height: 25
Text: Filter Games Text: Filter Games
Font: Bold Font: Bold
Button@REFRESH_BUTTON: Button@REFRESH_BUTTON:
X: 183 X: 183
Y: 321 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 100 Width: 100
Height: 25 Height: 25
Text: Refresh Text: Refresh
Font: Bold Font: Bold
Button@BROWSER_TAB: Button@BROWSER_TAB:
X: 288 X: 288
Y: 315 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 105 Width: 105
Height: 31 Height: 31
Text: Browse Text: Browse
Font: Bold Font: Bold
Button@DIRECTCONNECT_TAB: Button@DIRECTCONNECT_TAB:
X: 393 X: 393
Y: 315 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 105 Width: 105
Height: 31 Height: 31
Text: Direct IP Text: Direct IP
Font: Bold Font: Bold
Button@CREATE_TAB: Button@CREATE_TAB:
X: 498 X: 498
Y: 315 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 105 Width: 105
Height: 31 Height: 31
Text: Create Text: Create
@@ -51,18 +51,13 @@ Background@MULTIPLAYER_PANEL:
X: 20 X: 20
Y: 37 Y: 37
Width: PARENT_RIGHT - 40 Width: PARENT_RIGHT - 40
Height: PARENT_BOTTOM Height: PARENT_BOTTOM - 87
Container@GLOBALCHAT_ROOT:
X: 20
Y: 351
Width: PARENT_RIGHT - 40
Height: PARENT_BOTTOM - 401
TooltipContainer@TOOLTIP_CONTAINER: TooltipContainer@TOOLTIP_CONTAINER:
Button@BACK_BUTTON: Button@BACK_BUTTON:
Key: escape Key: escape
X: PARENT_RIGHT - WIDTH - 20 X: PARENT_RIGHT - WIDTH - 20
Y: PARENT_BOTTOM - HEIGHT - 20 Y: PARENT_BOTTOM - HEIGHT - 20
Width: 120 Width: 174
Height: 25 Height: 25
Text: Back Text: Back
Font: Bold Font: Bold

View File

@@ -10,9 +10,6 @@ Metrics:
ButtonTextShadow: false ButtonTextShadow: false
CheckboxPressedState: false CheckboxPressedState: false
GameStartedColor: FFA500 GameStartedColor: FFA500
GlobalChatNotificationColor: FFA500
GlobalChatTextColor: FFFFFF
GlobalChatPlayerNameColor: 00FF00
HotkeyColor: FFFFFF HotkeyColor: FFFFFF
HotkeyColorDisabled: 808080 HotkeyColorDisabled: 808080
HotkeyFont: Regular HotkeyFont: Regular

View File

@@ -88,14 +88,12 @@ ChromeLayout:
common|chrome/lobby-options.yaml common|chrome/lobby-options.yaml
common|chrome/lobby-music.yaml common|chrome/lobby-music.yaml
common|chrome/lobby-kickdialogs.yaml common|chrome/lobby-kickdialogs.yaml
common|chrome/lobby-globalchat.yaml
common|chrome/color-picker.yaml common|chrome/color-picker.yaml
common|chrome/map-chooser.yaml common|chrome/map-chooser.yaml
common|chrome/multiplayer.yaml common|chrome/multiplayer.yaml
common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-browser.yaml
common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-createserver.yaml
common|chrome/multiplayer-directconnect.yaml common|chrome/multiplayer-directconnect.yaml
common|chrome/multiplayer-globalchat.yaml
common|chrome/connection.yaml common|chrome/connection.yaml
d2k|chrome/dropdowns.yaml d2k|chrome/dropdowns.yaml
common|chrome/musicplayer.yaml common|chrome/musicplayer.yaml

View File

@@ -103,14 +103,12 @@ ChromeLayout:
common|chrome/lobby-options.yaml common|chrome/lobby-options.yaml
common|chrome/lobby-music.yaml common|chrome/lobby-music.yaml
common|chrome/lobby-kickdialogs.yaml common|chrome/lobby-kickdialogs.yaml
common|chrome/lobby-globalchat.yaml
common|chrome/color-picker.yaml common|chrome/color-picker.yaml
common|chrome/map-chooser.yaml common|chrome/map-chooser.yaml
common|chrome/multiplayer.yaml common|chrome/multiplayer.yaml
common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-browser.yaml
common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-createserver.yaml
common|chrome/multiplayer-directconnect.yaml common|chrome/multiplayer-directconnect.yaml
common|chrome/multiplayer-globalchat.yaml
common|chrome/connection.yaml common|chrome/connection.yaml
common|chrome/replaybrowser.yaml common|chrome/replaybrowser.yaml
common|chrome/dropdowns.yaml common|chrome/dropdowns.yaml

View File

@@ -151,14 +151,12 @@ ChromeLayout:
common|chrome/lobby-options.yaml common|chrome/lobby-options.yaml
common|chrome/lobby-music.yaml common|chrome/lobby-music.yaml
common|chrome/lobby-kickdialogs.yaml common|chrome/lobby-kickdialogs.yaml
common|chrome/lobby-globalchat.yaml
ts|chrome/color-picker.yaml ts|chrome/color-picker.yaml
common|chrome/map-chooser.yaml common|chrome/map-chooser.yaml
common|chrome/multiplayer.yaml common|chrome/multiplayer.yaml
common|chrome/multiplayer-browser.yaml common|chrome/multiplayer-browser.yaml
common|chrome/multiplayer-createserver.yaml common|chrome/multiplayer-createserver.yaml
common|chrome/multiplayer-directconnect.yaml common|chrome/multiplayer-directconnect.yaml
common|chrome/multiplayer-globalchat.yaml
common|chrome/connection.yaml common|chrome/connection.yaml
common|chrome/replaybrowser.yaml common|chrome/replaybrowser.yaml
ts|chrome/dropdowns.yaml ts|chrome/dropdowns.yaml

View File

@@ -122,7 +122,6 @@ Section "Game" GAME
File "${SRCDIR}\MaxMind.Db.dll" File "${SRCDIR}\MaxMind.Db.dll"
File "${SRCDIR}\GeoLite2-Country.mmdb.gz" File "${SRCDIR}\GeoLite2-Country.mmdb.gz"
File "${SRCDIR}\eluant.dll" File "${SRCDIR}\eluant.dll"
File "${SRCDIR}\SmarIrc4net.dll"
File "${SRCDIR}\rix0rrr.BeaconLib.dll" File "${SRCDIR}\rix0rrr.BeaconLib.dll"
File "${DEPSDIR}\soft_oal.dll" File "${DEPSDIR}\soft_oal.dll"
File "${DEPSDIR}\SDL2.dll" File "${DEPSDIR}\SDL2.dll"
@@ -252,7 +251,6 @@ Function ${UN}Clean
Delete $INSTDIR\freetype6.dll Delete $INSTDIR\freetype6.dll
Delete $INSTDIR\SDL2-CS.dll Delete $INSTDIR\SDL2-CS.dll
Delete $INSTDIR\OpenAL-CS.dll Delete $INSTDIR\OpenAL-CS.dll
Delete $INSTDIR\SmarIrc4net.dll
Delete $INSTDIR\rix0rrr.BeaconLib.dll Delete $INSTDIR\rix0rrr.BeaconLib.dll
RMDir /r $INSTDIR\Support RMDir /r $INSTDIR\Support

View File

@@ -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) (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")) if (!(Test-Path "rix0rrr.BeaconLib.dll"))
{ {
echo "Fetching rix0rrr.BeaconLib from NuGet." echo "Fetching rix0rrr.BeaconLib from NuGet."

View File

@@ -96,13 +96,6 @@ if [ ! -f Eluant.dll ]; then
curl -s -L -O https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll curl -s -L -O https://github.com/OpenRA/Eluant/releases/download/20160124/Eluant.dll
fi 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 if [ ! -f rix0rrr.BeaconLib.dll ]; then
echo "Fetching rix0rrr.BeaconLib from NuGet." echo "Fetching rix0rrr.BeaconLib from NuGet."
../noget.sh rix0rrr.BeaconLib 1.0.1 ../noget.sh rix0rrr.BeaconLib 1.0.1