diff --git a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs index 9ac3af23342..93e03ca7cdd 100644 --- a/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs +++ b/Content.Client/VendingMachines/VendingMachineBoundUserInterface.cs @@ -54,10 +54,12 @@ protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); + var system = EntMan.System(); + if (state is not VendingMachineInterfaceState newState) return; - _cachedInventory = newState.Inventory; + _cachedInventory = system.GetAllInventory(Owner); _menu?.Populate(Owner, _cachedInventory, newState.PriceMultiplier, newState.Credits); //ADT-Economy-Tweak } diff --git a/Content.Server/Administration/ServerApi.cs b/Content.Server/Administration/ServerApi.cs index f1f09d4b503..6a0bcbcf9a3 100644 --- a/Content.Server/Administration/ServerApi.cs +++ b/Content.Server/Administration/ServerApi.cs @@ -23,6 +23,9 @@ using Robust.Shared.Player; using Robust.Shared.Prototypes; using Robust.Shared.Utility; +using Content.Server.Administration.Managers; +using Content.Shared.Chat; +using Content.Server.Chat.Managers; namespace Content.Server.Administration; @@ -58,6 +61,9 @@ public sealed partial class ServerApi : IPostInjectInit [Dependency] private readonly ILogManager _logManager = default!; [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; [Dependency] private readonly ILocalizationManager _loc = default!; + [Dependency] private readonly IAdminManager _admin = default!; + [Dependency] private readonly INetConfigurationManager _netConfigManager = default!; + [Dependency] private readonly IChatManager _chatManager = default!; private string _token = string.Empty; private ISawmill _sawmill = default!; @@ -81,6 +87,7 @@ void IPostInjectInit.PostInject() RegisterActorHandler(HttpMethod.Post, "/admin/actions/force_preset", ActionForcePreset); RegisterActorHandler(HttpMethod.Post, "/admin/actions/set_motd", ActionForceMotd); RegisterActorHandler(HttpMethod.Patch, "/admin/actions/panic_bunker", ActionPanicPunker); + RegisterActorHandler(HttpMethod.Post, "/admin/actions/a_chat", ActionAdminChat); // ADT Tweak } public void Initialize() @@ -709,4 +716,60 @@ private sealed class GameruleResponse } #endregion + + #region ADT-Tweak + + private async Task ActionAdminChat(IStatusHandlerContext context, Actor actor) + { + var body = await ReadJson(context); + if (body == null) + return; + + string discordName = $"{body.NickName}(Discord)"; + string message = body.Message; + var authorUser = new NetUserId(actor.Guid); + + await RunOnMainThread(async () => + { + var clients = _admin.ActiveAdmins.Select(p => p.Channel).ToList(); + + // Используем Loc.GetString для формирования сообщения + var wrappedMessage = Loc.GetString("chat-manager-send-admin-chat-wrap-message", + ("adminChannelName", Loc.GetString("chat-manager-admin-channel-name")), + ("playerName", discordName), + ("message", FormattedMessage.EscapeText(body.Message)) + ); + + // Отправляем сообщения всем администраторам + foreach (var client in clients) + { + bool isSource = true; + string? audioPath = isSource ? _netConfigManager.GetClientCVar(client, CCVars.AdminChatSoundPath) : default; + float audioVolume = isSource ? _netConfigManager.GetClientCVar(client, CCVars.AdminChatSoundVolume) : default; + + _chatManager.ChatMessageToOne( + ChatChannel.AdminChat, + message, + wrappedMessage, + default, + false, + client, + audioPath: audioPath, + audioVolume: audioVolume, + author: authorUser + ); + } + + await RespondOk(context); + _sawmill.Info($"Send message by {FormatLogActor(actor)}"); + }); + } + + private sealed class AdminChatActionBody + { + public required string Message { get; init; } + public required string NickName { get; init; } + } + + #endregion } diff --git a/Resources/Locale/ru-RU/ADT/prototypes/Entities/Clothing/Uniforms/jumpsuits.ftl b/Resources/Locale/ru-RU/ADT/prototypes/Entities/Clothing/Uniforms/jumpsuits.ftl index 88b1cecc26f..9e7bf22e10a 100644 --- a/Resources/Locale/ru-RU/ADT/prototypes/Entities/Clothing/Uniforms/jumpsuits.ftl +++ b/Resources/Locale/ru-RU/ADT/prototypes/Entities/Clothing/Uniforms/jumpsuits.ftl @@ -221,7 +221,7 @@ ent-ADTClothingUniformAiryBlackSuit = черный воздушный костю .desc = Готично, строго, сексуально. Для тех кто любит показывать свой красивый лифчик. ent-ADTClothingJumpsuitHopAlt = деловой костюм главы персонала - .desc = Качетсвенно сделанная униформа для тех глав персонала, что могут себе такую позволить. + .desc = Качественно сделанная униформа для тех глав персонала, что могут себе такую позволить. ent-ADTClothingJumpsuitSecOffMogesBrown = костюм офицера СБ с Могеса .desc = Не совсем формальный, но очень подходящий для трофиков костюм офицера, служившего в филиале Нанотрейзен на планете Могес. Заслужить право носить такой может только ветеран СБ. Стоять, СБ Могеса! ent-ADTClothingJumpsuitSecOffMogesBlue = костюм офицера СБ с Могеса diff --git a/Resources/Prototypes/ADT/Entities/Mobs/Species/ipc.yml b/Resources/Prototypes/ADT/Entities/Mobs/Species/ipc.yml index 61a600ad5b9..c961f2e162f 100644 --- a/Resources/Prototypes/ADT/Entities/Mobs/Species/ipc.yml +++ b/Resources/Prototypes/ADT/Entities/Mobs/Species/ipc.yml @@ -137,6 +137,7 @@ - type: BloodCough postingSayDamage: blood-cough-ipc - type: TimeDespawnDamage + - type: OfferItem # ADT-Tweak - type: entity save: false diff --git a/Resources/Prototypes/ADT/Entities/Objects/Consumable/Drinks/drinks_cans.yml b/Resources/Prototypes/ADT/Entities/Objects/Consumable/Drinks/drinks_cans.yml index b466265e947..f0571512897 100644 --- a/Resources/Prototypes/ADT/Entities/Objects/Consumable/Drinks/drinks_cans.yml +++ b/Resources/Prototypes/ADT/Entities/Objects/Consumable/Drinks/drinks_cans.yml @@ -11,8 +11,18 @@ reagents: - ReagentId: EnergyDrink Quantity: 30 + - type: Appearance + - type: GenericVisualizer + visuals: + enum.OpenableVisuals.Opened: + enum.OpenableVisuals.Layer: + True: {state: "icon-open"} + False: {state: "icon"} - type: Sprite sprite: ADT/Objects/Consumable/Drinks/nostop.rsi + layers: + - state: icon + map: ["enum.OpenableVisuals.Layer"] - type: entity id: ADTDrinkBeerCanPack