Skip to content

Commit

Permalink
Merge branch 'master' into ipc-flashlight-eddie
Browse files Browse the repository at this point in the history
  • Loading branch information
jungarikjan authored Apr 8, 2024
2 parents 0114ba5 + 7136f43 commit cee2d94
Show file tree
Hide file tree
Showing 7 changed files with 61 additions and 8 deletions.
11 changes: 11 additions & 0 deletions Content.Server/ADT/ActiveGateway/ActiveGatewayComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using Content.Server.Gateway.Components;
using Content.Server.Gateway.Systems;

namespace Content.Server.ADT.ActiveGateway;

[RegisterComponent, Access(typeof(ActiveGatewaySystem))]
public sealed partial class ActiveGatewayComponent : Component
{
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool Enabled = true;
}
20 changes: 20 additions & 0 deletions Content.Server/ADT/ActiveGateway/ActiveGatewaySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using Content.Server.Gateway.Components;
using Content.Server.Gateway.Systems;

namespace Content.Server.ADT.ActiveGateway;

public sealed class ActiveGatewaySystem : EntitySystem
{
[Dependency] private readonly GatewaySystem _gatewaySystem = new GatewaySystem();

public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ActiveGatewayComponent, ComponentStartup>(OnComponentStartup);
}

private void OnComponentStartup(EntityUid uid, ActiveGatewayComponent component, ComponentStartup args)
{
_gatewaySystem.SetEnabled(uid, component.Enabled);
}
}
5 changes: 4 additions & 1 deletion Content.Server/Administration/Systems/BwoinkSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
using Robust.Shared.Console;
using Content.Server.Administration.Commands;


namespace Content.Server.Administration.Systems
{
Expand Down Expand Up @@ -411,7 +414,7 @@ protected override void OnBwoinkTextMessage(BwoinkTextMessage message, EntitySes
}
else if (senderAdmin is not null && senderAdmin.HasFlag(AdminFlags.Adminhelp))
{
bwoinkText = $"[color=red]{senderSession.Name}[/color]: {escapedText}";
bwoinkText = $"\\[{senderAdmin.Title}\\][color=red]{senderSession.Name}[/color]: {escapedText}"; // сообщение админа
}
else
{
Expand Down
12 changes: 11 additions & 1 deletion Content.Server/Chat/Managers/ChatManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -260,9 +260,19 @@ private void SendAdminChat(ICommonSession player, string message)
}

var clients = _adminManager.ActiveAdmins.Select(p => p.Channel);
var senderAdmin = _adminManager.GetAdminData(player);
if (senderAdmin == null)
{
return;
}
var senderName = player.Name;
if (!string.IsNullOrEmpty(senderAdmin.Title))
{
senderName += $"\\[{senderAdmin.Title}\\]";
}
var wrappedMessage = Loc.GetString("chat-manager-send-admin-chat-wrap-message",
("adminChannelName", Loc.GetString("chat-manager-admin-channel-name")),
("playerName", player.Name), ("message", FormattedMessage.EscapeText(message)));
("playerName", senderName), ("message", FormattedMessage.EscapeText(message)));

foreach (var client in clients)
{
Expand Down
12 changes: 6 additions & 6 deletions Resources/Changelog/ChangelogADT.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1580,15 +1580,15 @@ Entries:
id: 55720 #костыль отображения в Обновлениях
time: '2024-04-06T08:20:00.0000000+00:00'







- author: Эдди
changes:
- { message: "Добавлен встроенный фонарик для КПБ.", type: Add}
- { message: "Добавлено требование на общее игровое время для Психолога в размере 180 минут.", type: Add}
id: 55721 #костыль отображения в Обновлениях
time: '2024-04-08T08:20:00.0000000+00:00'

- author: Шрёдингер
changes:
- {message: "Добавил отображение админ-префикса для Ахелпа и АдминЧата.", type: Add}
id: 55722
time: '2024-04-08T08:20:00.0000000+00:00'
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ent-ADTGatewayActive = врата
.desc = Таинственные врата, возведенные неизвестно кем, позволяют преодолевать быстрее света огромные расстояния.
.suffix = { "Активированные" }
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- type: entity
parent: Gateway
id: ADTGatewayActive
suffix: "Активированный"
components:
- type: ActiveGateway # Если накинуть вместе с Gateway, то они будут в активированном состоянии всегда

0 comments on commit cee2d94

Please sign in to comment.