This commit is contained in:
ShadowCommander
2019-08-16 15:46:06 -07:00
423 changed files with 3133 additions and 936 deletions

View File

@@ -25,12 +25,12 @@ namespace Content.Client.Chat
private ILocalizationManager localize = IoCManager.Resolve<ILocalizationManager>();
public LineEdit Input { get; private set; }
public OutputPanel contents;
public OutputPanel Contents { get; }
// Buttons for filtering
public Button AllButton;
public Button LocalButton;
public Button OOCButton;
public Button AllButton { get; }
public Button LocalButton { get; }
public Button OOCButton { get; }
/// <summary>
/// Index while cycling through the input history. -1 means not going through history.
@@ -49,11 +49,9 @@ namespace Content.Client.Chat
public bool ReleaseFocusOnEnter { get; set; } = true;
protected override void Initialize()
public ChatBox()
{
base.Initialize();
MarginLeft = -475.0f;
MarginLeft = -475.0f;
MarginTop = 10.0f;
MarginRight = -10.0f;
MarginBottom = 235.0f;
@@ -80,8 +78,8 @@ namespace Content.Client.Chat
MarginLeftOverride = 4, MarginRightOverride = 4,
SizeFlagsVertical = SizeFlags.FillExpand
};
contents = new OutputPanel();
contentMargin.AddChild(contents);
Contents = new OutputPanel();
contentMargin.AddChild(Contents);
vBox.AddChild(contentMargin);
Input = new LineEdit();
@@ -182,18 +180,6 @@ namespace Content.Client.Chat
}
}
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (disposing)
{
TextSubmitted = null;
Input = null;
contents = null;
}
}
public event TextSubmitHandler TextSubmitted;
public event FilterToggledHandler FilterToggled;
@@ -209,7 +195,7 @@ namespace Content.Client.Chat
formatted.PushColor(color);
formatted.AddText(message);
formatted.Pop();
contents.AddMessage(formatted);
Contents.AddMessage(formatted);
}
private void Input_OnTextEntered(LineEdit.LineEditEventArgs args)

View File

@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Content.Client.Interfaces.Chat;
using Content.Shared.Chat;
using Robust.Client;
using Robust.Client.Console;
using Robust.Client.Interfaces.Graphics.ClientEye;
using Robust.Client.Interfaces.UserInterface;
@@ -274,7 +273,7 @@ namespace Content.Client.Chat
private void RepopulateChat(IEnumerable<StoredChatMessage> filteredMessages)
{
_currentChatBox.contents.Clear();
_currentChatBox.Contents.Clear();
foreach (var msg in filteredMessages)
{

View File

@@ -1,5 +1,4 @@
using Content.Client.Interfaces.Chat;
using Robust.Client;
using Robust.Client.Interfaces.Graphics.ClientEye;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
@@ -32,14 +31,14 @@ namespace Content.Client.Chat
private readonly IEntity _senderEntity;
private readonly IChatManager _chatManager;
private Control _panel;
private readonly Control _panel;
private float _timeLeft = TotalTime;
public float VerticalOffset { get; set; }
private float _verticalOffsetAchieved;
public float ContentHeight { get; }
public float ContentHeight { get; private set; }
public SpeechBubble(string text, IEntity senderEntity, IEyeManager eyeManager, IChatManager chatManager)
{
@@ -68,6 +67,8 @@ namespace Content.Client.Chat
AddChild(_panel);
ForceRunStyleUpdate();
_panel.Size = _panel.CombinedMinimumSize;
ContentHeight = _panel.Height;
Size = (_panel.Width, 0);