[Fix] Разные фиксы (#161)
* fix: фикс отображений в ахелпе * fix: нотисы в чат больше не отправляют сообщение в консоль * fix: исправлена текстура секретной двери * fix: ошибки перевода при вылизывании ран
This commit is contained in:
@@ -12,7 +12,6 @@ using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Network;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Configuration;
|
||||
|
||||
namespace Content.Client.Administration.UI.Bwoink
|
||||
@@ -49,39 +48,11 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
ChannelSelector.OnSelectionChanged += sel =>
|
||||
{
|
||||
_currentPlayer = sel;
|
||||
SwitchToChannel(sel?.SessionId);
|
||||
SwitchToChannel(sel.SessionId);
|
||||
ChannelSelector.PlayerListContainer.DirtyList();
|
||||
};
|
||||
|
||||
ChannelSelector.OverrideText += (info, text) =>
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
|
||||
if (info.Connected)
|
||||
sb.Append('●');
|
||||
else
|
||||
sb.Append(info.ActiveThisRound ? '○' : '·');
|
||||
|
||||
sb.Append(' ');
|
||||
if (AHelpHelper.TryGetChannel(info.SessionId, out var panel) && panel.Unread > 0)
|
||||
{
|
||||
if (panel.Unread < 11)
|
||||
sb.Append(new Rune('➀' + (panel.Unread-1)));
|
||||
else
|
||||
sb.Append(new Rune(0x2639)); // ☹
|
||||
sb.Append(' ');
|
||||
}
|
||||
|
||||
if (info.Antag && info.ActiveThisRound)
|
||||
sb.Append(new Rune(0x1F5E1)); // 🗡
|
||||
|
||||
if (info.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold)))
|
||||
sb.Append(new Rune(0x23F2)); // ⏲
|
||||
|
||||
sb.AppendFormat("\"{0}\"", text);
|
||||
|
||||
return sb.ToString();
|
||||
};
|
||||
ChannelSelector.OverrideText += (info, _) => FormatTabTitle(info);
|
||||
|
||||
ChannelSelector.Comparison = (a, b) =>
|
||||
{
|
||||
@@ -166,11 +137,10 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
ChannelSelector.PopulateList();
|
||||
}
|
||||
|
||||
|
||||
public void SelectChannel(NetUserId channel)
|
||||
{
|
||||
if (!ChannelSelector.PlayerInfo.TryFirstOrDefault(
|
||||
i => i.SessionId == channel, out var info))
|
||||
i => i.SessionId == channel, out var info))
|
||||
return;
|
||||
|
||||
// clear filter if we're trying to select a channel for a player that isn't currently filtered
|
||||
@@ -208,33 +178,33 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
Follow.Disabled = !Follow.Visible || disabled;
|
||||
}
|
||||
|
||||
private string FormatTabTitle(ItemList.Item li, PlayerInfo? pl = default)
|
||||
private string FormatTabTitle(PlayerInfo info)
|
||||
{
|
||||
pl ??= (PlayerInfo) li.Metadata!;
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(pl.Connected ? '●' : '○');
|
||||
sb.Append(info.Connected ? '●' :
|
||||
info.ActiveThisRound ? '○' : '·'
|
||||
);
|
||||
|
||||
sb.Append(' ');
|
||||
if (AHelpHelper.TryGetChannel(pl.SessionId, out var panel) && panel.Unread > 0)
|
||||
if (AHelpHelper.TryGetChannel(info.SessionId, out var panel) && panel.Unread > 0)
|
||||
{
|
||||
if (panel.Unread < 11)
|
||||
sb.Append(new Rune('➀' + (panel.Unread-1)));
|
||||
else
|
||||
sb.Append(new Rune(0x2639)); // ☹
|
||||
sb.Append(panel.Unread < 11 ? new Rune('➀' + (panel.Unread - 1)) : new Rune(0x2639)); // ☹
|
||||
|
||||
sb.Append(' ');
|
||||
}
|
||||
|
||||
if (pl.Antag)
|
||||
if (info.Antag)
|
||||
sb.Append(new Rune(0x1F5E1)); // 🗡
|
||||
|
||||
if (pl.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold)))
|
||||
if (info.OverallPlaytime <= TimeSpan.FromSeconds(_cfg.GetCVar(CCVars.NewPlayerThreshold)))
|
||||
sb.Append(new Rune(0x23F2)); // ⏲
|
||||
|
||||
sb.AppendFormat("\"{0}\"", pl.CharacterName);
|
||||
sb.Append($"\"{info.CharacterName}\"");
|
||||
|
||||
if (pl.IdentityName != pl.CharacterName && pl.IdentityName != string.Empty)
|
||||
sb.Append(' ').AppendFormat("[{0}]", pl.IdentityName);
|
||||
if (info.IdentityName != info.CharacterName && info.IdentityName != string.Empty)
|
||||
sb.Append(' ').Append($"[{info.IdentityName}]");
|
||||
|
||||
sb.Append(' ').Append(pl.Username);
|
||||
sb.Append(' ').Append(info.Username);
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
@@ -257,4 +227,4 @@ namespace Content.Client.Administration.UI.Bwoink
|
||||
UpdateButtons();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
using System.Linq;
|
||||
using Content.Client.Administration.Systems;
|
||||
using Content.Client.Stylesheets;
|
||||
using Content.Client.UserInterface.Controls;
|
||||
using Content.Client.Verbs.UI;
|
||||
using Content.Shared.Administration;
|
||||
using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
@@ -26,15 +28,18 @@ namespace Content.Client.Administration.UI.CustomControls
|
||||
public Func<PlayerInfo, string, string>? OverrideText;
|
||||
public Comparison<PlayerInfo>? Comparison;
|
||||
|
||||
private IEntityManager _entManager;
|
||||
private IUserInterfaceManager _uiManager;
|
||||
private readonly IEntityManager _entManager;
|
||||
private readonly IUserInterfaceManager _uiManager;
|
||||
|
||||
private PlayerInfo? _selectedPlayer;
|
||||
|
||||
private readonly Font _fontOverride;
|
||||
|
||||
public PlayerListControl()
|
||||
{
|
||||
_entManager = IoCManager.Resolve<IEntityManager>();
|
||||
_uiManager = IoCManager.Resolve<IUserInterfaceManager>();
|
||||
_fontOverride = IoCManager.Resolve<IResourceCache>().NotoStack(size: 12);
|
||||
_adminSystem = _entManager.System<AdminSystem>();
|
||||
RobustXamlLoader.Load(this);
|
||||
// Fill the Option data
|
||||
@@ -137,6 +142,7 @@ namespace Content.Client.Administration.UI.CustomControls
|
||||
new Label
|
||||
{
|
||||
ClipText = true,
|
||||
FontOverride = _fontOverride,
|
||||
Text = GetText(info)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user