AHelp tweaks - colored names for admins, window name (#5335)
Co-authored-by: T <tomeno@lulzsec.co.uk>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Client.Administration;
|
|||||||
using Content.Shared;
|
using Content.Shared;
|
||||||
using Robust.Client.Credits;
|
using Robust.Client.Credits;
|
||||||
using Robust.Client.AutoGenerated;
|
using Robust.Client.AutoGenerated;
|
||||||
|
using Robust.Client.Player;
|
||||||
using Robust.Client.UserInterface;
|
using Robust.Client.UserInterface;
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Client.UserInterface.CustomControls;
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
@@ -28,6 +29,7 @@ namespace Content.Client.Administration.UI
|
|||||||
public partial class BwoinkWindow : SS14Window
|
public partial class BwoinkWindow : SS14Window
|
||||||
{
|
{
|
||||||
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
|
[Dependency] private readonly IEntitySystemManager _systemManager = default!;
|
||||||
|
[Dependency] private readonly IPlayerManager _playerManager = default!;
|
||||||
|
|
||||||
private readonly NetUserId _channelId;
|
private readonly NetUserId _channelId;
|
||||||
|
|
||||||
@@ -36,8 +38,9 @@ namespace Content.Client.Administration.UI
|
|||||||
RobustXamlLoader.Load(this);
|
RobustXamlLoader.Load(this);
|
||||||
IoCManager.InjectDependencies(this);
|
IoCManager.InjectDependencies(this);
|
||||||
|
|
||||||
Title = title;
|
|
||||||
_channelId = channelId;
|
_channelId = channelId;
|
||||||
|
Title = (_playerManager.LocalPlayer?.UserId == _channelId) ? "Admin Message" : title;
|
||||||
|
|
||||||
SenderLineEdit.OnTextEntered += Input_OnTextEntered;
|
SenderLineEdit.OnTextEntered += Input_OnTextEntered;
|
||||||
}
|
}
|
||||||
@@ -56,7 +59,7 @@ namespace Content.Client.Administration.UI
|
|||||||
public void ReceiveLine(string text)
|
public void ReceiveLine(string text)
|
||||||
{
|
{
|
||||||
var formatted = new FormattedMessage(1);
|
var formatted = new FormattedMessage(1);
|
||||||
formatted.AddText(text);
|
formatted.AddMarkup(text);
|
||||||
TextOutput.AddMessage(formatted);
|
TextOutput.AddMessage(formatted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using Robust.Shared.Network;
|
|||||||
using Robust.Shared.Localization;
|
using Robust.Shared.Localization;
|
||||||
using Robust.Server.Player;
|
using Robust.Server.Player;
|
||||||
using Robust.Shared.IoC;
|
using Robust.Shared.IoC;
|
||||||
|
using Robust.Shared.Utility;
|
||||||
|
|
||||||
namespace Content.Server.Administration
|
namespace Content.Server.Administration
|
||||||
{
|
{
|
||||||
@@ -38,7 +39,12 @@ namespace Content.Server.Administration
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var msg = new BwoinkTextMessage(message.ChannelId, senderSession.UserId, $"{senderSession.Name}: {message.Text}");
|
var escapedText = FormattedMessage.EscapeText(message.Text);
|
||||||
|
|
||||||
|
var bwoinkText = senderAdmin
|
||||||
|
? $"[color=red]{senderSession.Name}[/color]: {escapedText}"
|
||||||
|
: $"{senderSession.Name}: {escapedText}";
|
||||||
|
var msg = new BwoinkTextMessage(message.ChannelId, senderSession.UserId, bwoinkText);
|
||||||
|
|
||||||
LogBwoink(msg);
|
LogBwoink(msg);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user