Remove global chat integration.
This commit is contained in:
committed by
Matthias Mailänder
parent
488cec64b8
commit
502c3e2bf5
3
AUTHORS
3
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.
|
||||
|
||||
|
||||
3
Makefile
3
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:
|
||||
|
||||
@@ -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<string[]>("Engine.ModsPath", modSearchArg) :
|
||||
@@ -821,7 +816,6 @@ namespace OpenRA
|
||||
ModData.Dispose();
|
||||
ChromeProvider.Deinitialize();
|
||||
|
||||
GlobalChat.Dispose();
|
||||
Sound.Dispose();
|
||||
Renderer.Dispose();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -98,10 +98,6 @@
|
||||
<HintPath>..\thirdparty\download\MaxMind.Db.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="SmarIrc4net">
|
||||
<HintPath>..\thirdparty\download\SmarIrc4net.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Activities\Activity.cs" />
|
||||
@@ -247,7 +243,6 @@
|
||||
<Compile Include="Renderer.cs" />
|
||||
<Compile Include="Platform.cs" />
|
||||
<Compile Include="GameSpeed.cs" />
|
||||
<Compile Include="GlobalChat.cs" />
|
||||
<Compile Include="Primitives\ObservableList.cs" />
|
||||
<Compile Include="Graphics\RgbaColorRenderer.cs" />
|
||||
<Compile Include="Traits\Player\IndexedPlayerPalette.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<string, Hotkey> Keys = new Dictionary<string, Hotkey>();
|
||||
public readonly ChatSettings Chat = new ChatSettings();
|
||||
|
||||
public readonly Dictionary<string, object> Sections;
|
||||
|
||||
@@ -235,7 +224,6 @@ namespace OpenRA
|
||||
{ "Graphics", Graphics },
|
||||
{ "Server", Server },
|
||||
{ "Debug", Debug },
|
||||
{ "Chat", Chat }
|
||||
};
|
||||
|
||||
// Override fieldloader to ignore invalid entries
|
||||
|
||||
@@ -728,7 +728,6 @@
|
||||
<Compile Include="Traits\SpawnActorOnDeath.cs" />
|
||||
<Compile Include="Scripting\Global\LightingGlobal.cs" />
|
||||
<Compile Include="Traits\SupportPowers\ProduceActorPower.cs" />
|
||||
<Compile Include="Widgets\Logic\GlobalChatLogic.cs" />
|
||||
<Compile Include="Lint\CheckChromeLogic.cs" />
|
||||
<Compile Include="Lint\CheckMapMetadata.cs" />
|
||||
<Compile Include="Widgets\Logic\MultiplayerLogic.cs" />
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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<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");
|
||||
var chatTextField = lobby.Get<TextFieldWidget>("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<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");
|
||||
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);
|
||||
|
||||
|
||||
@@ -109,7 +109,6 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
createServerTab.OnClick = () => panel = PanelType.CreateServer;
|
||||
|
||||
widget.Get<ButtonWidget>("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); };
|
||||
Game.LoadWidget(null, "GLOBALCHAT_PANEL", widget.Get("GLOBALCHAT_ROOT"), new WidgetArgs());
|
||||
|
||||
lanGameLocations = new List<BeaconLocation>();
|
||||
try
|
||||
|
||||
@@ -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:
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
|
||||
@@ -10,9 +10,6 @@ Metrics:
|
||||
ButtonTextShadow: false
|
||||
CheckboxPressedState: false
|
||||
GameStartedColor: FFA500
|
||||
GlobalChatNotificationColor: FFA500
|
||||
GlobalChatTextColor: FFFFFF
|
||||
GlobalChatPlayerNameColor: 00FF00
|
||||
HotkeyColor: FFFFFF
|
||||
HotkeyColorDisabled: 808080
|
||||
HotkeyFont: Regular
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
8
thirdparty/fetch-thirdparty-deps.ps1
vendored
8
thirdparty/fetch-thirdparty-deps.ps1
vendored
@@ -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."
|
||||
|
||||
7
thirdparty/fetch-thirdparty-deps.sh
vendored
7
thirdparty/fetch-thirdparty-deps.sh
vendored
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user