diff --git a/Content.Client/Chat/ChatBox.cs b/Content.Client/Chat/ChatBox.cs
index 58df66d9ef..0536accde8 100644
--- a/Content.Client/Chat/ChatBox.cs
+++ b/Content.Client/Chat/ChatBox.cs
@@ -1,5 +1,4 @@
-using System;
-using System.Collections.Generic;
+using System.Collections.Generic;
using Content.Shared.Chat;
using Robust.Client.Graphics.Drawing;
using Robust.Client.Input;
@@ -10,14 +9,13 @@ using Robust.Shared.Utility;
using Robust.Shared.Localization;
using Robust.Shared.IoC;
-
namespace Content.Client.Chat
{
- public class ChatBox : PanelContainer
+ public class ChatBox : MarginContainer
{
public delegate void TextSubmitHandler(ChatBox chatBox, string text);
- public delegate void FilterToggledHandler(ChatBox chatBox, Button.ButtonToggledEventArgs e);
+ public delegate void FilterToggledHandler(ChatBox chatBox, BaseButton.ButtonToggledEventArgs e);
private const int MaxLinePixelLength = 500;
@@ -30,6 +28,7 @@ namespace Content.Client.Chat
// Buttons for filtering
public Button AllButton;
+ public Button LocalButton;
public Button OOCButton;
///
@@ -56,41 +55,59 @@ namespace Content.Client.Chat
MarginLeft = -475.0f;
MarginTop = 10.0f;
MarginRight = -10.0f;
- MarginBottom = 185.0f;
+ MarginBottom = 235.0f;
AnchorLeft = 1.0f;
AnchorRight = 1.0f;
- var vBox = new VBoxContainer("VBoxContainer");
- var hBox = new HBoxContainer("FilterButtonsContainer");
+ var outerVBox = new VBoxContainer();
+
+ var panelContainer = new PanelContainer
+ {
+ PanelOverride = new StyleBoxFlat {BackgroundColor = Color.FromHex("#25252aaa")},
+ SizeFlagsVertical = SizeFlags.FillExpand
+ };
+ var vBox = new VBoxContainer();
+ panelContainer.AddChild(vBox);
+ var hBox = new HBoxContainer();
+
+ outerVBox.AddChild(panelContainer);
+ outerVBox.AddChild(hBox);
contents = new OutputPanel {SizeFlagsVertical = SizeFlags.FillExpand};
vBox.AddChild(contents);
- Input = new LineEdit("Input");
+ Input = new LineEdit();
Input.OnKeyDown += InputKeyDown;
Input.OnTextEntered += Input_OnTextEntered;
vBox.AddChild(Input);
- vBox.AddChild(hBox);
-
- AllButton = new Button()
+ AllButton = new Button
{
Text = localize.GetString("All"),
Name = "ALL",
TextAlign = Button.AlignMode.Left,
- SizeFlagsHorizontal = SizeFlags.Fill,
+ SizeFlagsHorizontal = SizeFlags.ShrinkEnd | SizeFlags.Expand,
SizeFlagsStretchRatio = 1,
ToggleMode = true,
Pressed = true
};
- OOCButton = new Button()
+ LocalButton = new Button
+ {
+ Text = localize.GetString("Local"),
+ Name = "Local",
+ TextAlign = Button.AlignMode.Left,
+ SizeFlagsStretchRatio = 1,
+ ToggleMode = true,
+ Pressed = true
+ };
+
+ OOCButton = new Button
{
Text = localize.GetString("OOC"),
Name = "OOC",
TextAlign = Button.AlignMode.Left,
- SizeFlagsHorizontal = SizeFlags.Fill,
SizeFlagsStretchRatio = 1,
ToggleMode = true,
Pressed = true
@@ -102,9 +119,7 @@ namespace Content.Client.Chat
hBox.AddChild(AllButton);
hBox.AddChild(OOCButton);
- AddChild(vBox);
-
- PanelOverride = new StyleBoxFlat { BackgroundColor = Color.Gray.WithAlpha(0.5f) };
+ AddChild(outerVBox);
}
protected override void MouseDown(GUIMouseButtonEventArgs e)
@@ -210,7 +225,7 @@ namespace Content.Client.Chat
}
}
- private void OnFilterToggled(Button.ButtonToggledEventArgs args)
+ private void OnFilterToggled(BaseButton.ButtonToggledEventArgs args)
{
FilterToggled?.Invoke(this, args);
}
diff --git a/Content.Client/Chat/ChatFilterUI.cs b/Content.Client/Chat/ChatFilterUI.cs
deleted file mode 100644
index 0bed8b707d..0000000000
--- a/Content.Client/Chat/ChatFilterUI.cs
+++ /dev/null
@@ -1,62 +0,0 @@
-using Robust.Client.Graphics;
-using Robust.Client.Graphics.Drawing;
-using Robust.Client.Interfaces.Graphics;
-using Robust.Client.UserInterface.Controls;
-using Robust.Client.UserInterface.CustomControls;
-using Robust.Client.Utility;
-using Robust.Shared.IoC;
-using Robust.Shared.Log;
-using Robust.Shared.Maths;
-using Robust.Shared.ViewVariables;
-
-using Content.Client.Chat;
-
-namespace Content.Client.Chat
-{
- public class ChatFilterUI : SS14Window
- {
- protected override void Initialize()
- {
- base.Initialize();
-
- Title = "Filter Channels";
-
- var margin = new MarginContainer()
- {
- MarginTop = 5f,
- MarginLeft = 5f,
- MarginRight = -5f,
- MarginBottom = -5f,
- };
-
- margin.SetAnchorAndMarginPreset(LayoutPreset.TopRight);
-
- var vbox = new VBoxContainer();
-
- vbox.SetAnchorAndMarginPreset(LayoutPreset.TopRight);
-
- var descMargin = new MarginContainer()
- {
- MarginTop = 5f,
- MarginLeft = 5f,
- MarginRight = -5f,
- MarginBottom = -5f,
- SizeFlagsHorizontal = SizeFlags.Fill,
- SizeFlagsStretchRatio = 2,
- };
-
- var hbox = new HBoxContainer()
- {
- SizeFlagsHorizontal = SizeFlags.FillExpand,
- };
-
- var vboxInfo = new VBoxContainer()
- {
- SizeFlagsVertical = SizeFlags.FillExpand,
- SizeFlagsStretchRatio = 3,
- };
-
-
- }
- }
-}
diff --git a/Content.Client/Chat/ChatManager.cs b/Content.Client/Chat/ChatManager.cs
index 1705758401..a596184cd7 100644
--- a/Content.Client/Chat/ChatManager.cs
+++ b/Content.Client/Chat/ChatManager.cs
@@ -1,6 +1,4 @@
-using System;
using System.Collections.Generic;
-using System.Net;
using Content.Client.Interfaces.Chat;
using Content.Shared.Chat;
using Robust.Client.Console;
@@ -22,9 +20,9 @@ namespace Content.Client.Chat
public List filteredHistory = new List();
// Filter Button States
- private bool _ALLstate;
- private bool _Localstate;
- private bool _OOCstate;
+ private bool _allState;
+ private bool _localState;
+ private bool _oocState;
// Flag Enums for holding filtered channels
private ChatChannel _filteredChannels;
@@ -55,6 +53,11 @@ namespace Content.Client.Chat
_currentChatBox.TextSubmitted += _onChatBoxTextSubmitted;
_currentChatBox.FilterToggled += _onFilterButtonToggled;
}
+
+ RepopulateChat(filteredHistory);
+ _currentChatBox.AllButton.Pressed = !_allState;
+ _currentChatBox.LocalButton.Pressed = !_localState;
+ _currentChatBox.OOCButton.Pressed = !_oocState;
}
private void WriteChatMessage(StoredChatMessage message)
@@ -127,14 +130,13 @@ namespace Content.Client.Chat
}
}
- private void _onFilterButtonToggled(ChatBox chatBox, Button.ButtonToggledEventArgs e)
+ private void _onFilterButtonToggled(ChatBox chatBox, BaseButton.ButtonToggledEventArgs e)
{
- // TODO make toggled ALL button flip all button states programatically + visually
switch (e.Button.Name)
{
case "Local":
- _Localstate = !_Localstate;
- if (_Localstate)
+ _localState = !_localState;
+ if (_localState)
{
_filteredChannels |= ChatChannel.Local;
break;
@@ -146,8 +148,8 @@ namespace Content.Client.Chat
}
case "OOC":
- _OOCstate = !_OOCstate;
- if (_OOCstate)
+ _oocState = !_oocState;
+ if (_oocState)
{
_filteredChannels |= ChatChannel.OOC;
break;
@@ -158,36 +160,24 @@ namespace Content.Client.Chat
break;
}
- default:
- _ALLstate = !_ALLstate;
- if (_ALLstate)
- {
- _filteredChannels = ChatChannel.OOC | ChatChannel.Local;
- break;
- }
- else
- {
- _filteredChannels &= ~ChatChannel.OOC;
- _filteredChannels &= ~ChatChannel.Local;
- break;
- }
+ case "ALL":
+ chatBox.LocalButton.Pressed ^= true;
+ chatBox.OOCButton.Pressed ^= true;
+ _allState = !_allState;
+ break;
}
RepopulateChat(filteredHistory);
}
- private void RepopulateChat(List filteredMessages)
+ private void RepopulateChat(IEnumerable filteredMessages)
{
_currentChatBox.contents.Clear();
- // Copy list for enumeration
- List filteredMessagesCopy = new List(filteredMessages);
-
- foreach (StoredChatMessage msg in filteredMessagesCopy)
+ foreach (var msg in filteredMessages)
{
WriteChatMessage(msg);
}
-
}
private void _onChatMessage(MsgChatMessage msg)
@@ -202,14 +192,8 @@ namespace Content.Client.Chat
private bool IsFiltered(ChatChannel channel)
{
- if (_filteredChannels.HasFlag(channel))
- {
- return true;
- }
- else
- {
- return false;
- }
+ // _ALLstate works as inverter.
+ return _allState ^ _filteredChannels.HasFlag(channel);
}
}
}
diff --git a/Content.Client/Chat/StoredChatMessage.cs b/Content.Client/Chat/StoredChatMessage.cs
index 33392229cc..083f889b60 100644
--- a/Content.Client/Chat/StoredChatMessage.cs
+++ b/Content.Client/Chat/StoredChatMessage.cs
@@ -1,14 +1,4 @@
-using System;
-using System.Collections.Generic;
-using Content.Client.Interfaces.Chat;
using Content.Shared.Chat;
-using Robust.Client.Console;
-using Robust.Shared.Interfaces.Network;
-using Robust.Shared.IoC;
-using Robust.Shared.Log;
-using Robust.Shared.Maths;
-using Robust.Shared.Utility;
-using Robust.Client.UserInterface.Controls;
namespace Content.Client.Chat
{
@@ -18,7 +8,7 @@ namespace Content.Client.Chat
///
/// Client's own copies of chat messages used in filtering locally
- ///
+ ///
///
/// Actual Message contents, i.e. words
@@ -30,20 +20,19 @@ namespace Content.Client.Chat
///
public ChatChannel Channel { get; set; }
- ///
+ ///
/// What to "wrap" the message contents with. Example is stuff like 'Joe says: "{0}"'
- ///
+ ///
public string MessageWrap { get; set; }
+ ///
+ /// Constructor to copy a net message into stored client variety
+ ///
public StoredChatMessage(MsgChatMessage netMsg)
{
- ///
- /// Constructor to copy a net message into stored client variety
- ///
-
Message = netMsg.Message;
Channel = netMsg.Channel;
MessageWrap = netMsg.MessageWrap;
}
}
-}
\ No newline at end of file
+}
diff --git a/Content.Client/UserInterface/StatusEffectsUI.cs b/Content.Client/UserInterface/StatusEffectsUI.cs
index 2874e0648b..aee3707e58 100644
--- a/Content.Client/UserInterface/StatusEffectsUI.cs
+++ b/Content.Client/UserInterface/StatusEffectsUI.cs
@@ -28,7 +28,7 @@ namespace Content.Client.UserInterface
});
SetAnchorAndMarginPreset(LayoutPreset.TopRight);
- MarginTop = 200;
+ MarginTop = 250;
MarginRight = 10;
}