From b840ef72556a4f9c96f5c792b849240175808082 Mon Sep 17 00:00:00 2001 From: wylab Date: Thu, 18 Dec 2025 22:19:40 +0100 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D1=80=D1=82:=20=D0=A3=D0=BB=D1=83?= =?UTF-8?q?=D1=87=D1=88=D0=B5=D0=BD=D0=B8=D0=B5=20UX=20=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D0=B9=D0=BD=D0=B0=20=D0=BA=D0=BE=D0=BD=D1=81?= =?UTF-8?q?=D0=BE=D0=BB=D0=B8=20=D1=81=D0=B2=D1=8F=D0=B7=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Портировано из space-wizards/space-station-14#41899 Изменения: - Добавлено подтверждение при изменении уровня угрозы (предотвращает случайные изменения) - Разделены кнопки вызова/отзыва шаттла в отдельные UI области - Созданы отдельные вкладки для объявлений и трансляции - Разбито монолитное меню на 3 виджета: AlertLevelControls, MessagingControls, ShuttleControls - Добавлен LCD-дисплей с таймером обратного отсчета - Обновлены текстуры и шрифты Локализация: - Полностью переведены новые строки на русский язык в стиле Corvax 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../CommunicationsConsoleComponent.cs | 14 + ...CommunicationsConsoleBoundUserInterface.cs | 50 +- .../UI/CommunicationsConsoleMenu.xaml | 80 +- .../UI/CommunicationsConsoleMenu.xaml.cs | 184 ++- .../UI/CommunicationsConsoleSheetlet.cs | 42 + .../UI/Widgets/AlertLevelControls.xaml | 22 + .../UI/Widgets/AlertLevelControls.xaml.cs | 137 +++ .../UI/Widgets/MessagingControls.xaml | 34 + .../UI/Widgets/MessagingControls.xaml.cs | 117 ++ .../UI/Widgets/ShuttleControls.xaml | 73 ++ .../UI/Widgets/ShuttleControls.xaml.cs | 99 ++ Content.Client/PDA/PdaSheetlet.cs | 3 +- .../LayeredImageContainerSheetlet.cs | 70 ++ .../Sheetlets/StripebackSheetlet.cs | 14 +- Content.Client/Stylesheets/StyleClass.cs | 1 + .../Controls/LayeredImageContainer.xaml | 8 + .../Controls/LayeredImageContainer.xaml.cs | 46 + .../CommunicationsConsoleSystem.cs | 7 + .../SharedCommunicationsConsoleComponent.cs | 4 +- Resources/Fonts/7SegmentDisplayDigits.sfd | 1027 +++++++++++++++++ Resources/Fonts/7SegmentDisplayDigits.ttf | Bin 0 -> 16048 bytes .../communications-console-component.ftl | 31 +- .../communications-console-component.ftl | 38 +- .../Interface/Diegetic/PanelMountBase.svg | 221 ++++ .../Diegetic/PanelMountBase.svg.96dpi.png | Bin 0 -> 862 bytes .../Diegetic/PanelMountHighlight.svg | 455 ++++++++ .../PanelMountHighlight.svg.96dpi.png | Bin 0 -> 1946 bytes .../Textures/Interface/Diegetic/screw.svg | 80 ++ .../Interface/Diegetic/screw.svg.96dpi.png | Bin 0 -> 2721 bytes .../Diegetic/screw.svg.96dpi.png.yml | 2 + .../Interface/Nano/geometric_panel_border.svg | 19 +- .../Nano/geometric_panel_border.svg.96dpi.png | Bin 298 -> 265 bytes .../Interface/Nano/rounded_locked_button.svg | 66 ++ .../Nano/rounded_locked_button.svg.96dpi.png | Bin 0 -> 691 bytes .../Textures/Interface/Nano/stripeback.svg | 2 +- .../Interface/Nano/stripeback.svg.96dpi.png | Bin 322 -> 370 bytes 36 files changed, 2712 insertions(+), 234 deletions(-) create mode 100644 Content.Client/Communications/CommunicationsConsoleComponent.cs create mode 100644 Content.Client/Communications/UI/CommunicationsConsoleSheetlet.cs create mode 100644 Content.Client/Communications/UI/Widgets/AlertLevelControls.xaml create mode 100644 Content.Client/Communications/UI/Widgets/AlertLevelControls.xaml.cs create mode 100644 Content.Client/Communications/UI/Widgets/MessagingControls.xaml create mode 100644 Content.Client/Communications/UI/Widgets/MessagingControls.xaml.cs create mode 100644 Content.Client/Communications/UI/Widgets/ShuttleControls.xaml create mode 100644 Content.Client/Communications/UI/Widgets/ShuttleControls.xaml.cs create mode 100644 Content.Client/Stylesheets/Sheetlets/LayeredImageContainerSheetlet.cs create mode 100644 Content.Client/UserInterface/Controls/LayeredImageContainer.xaml create mode 100644 Content.Client/UserInterface/Controls/LayeredImageContainer.xaml.cs create mode 100644 Resources/Fonts/7SegmentDisplayDigits.sfd create mode 100644 Resources/Fonts/7SegmentDisplayDigits.ttf create mode 100644 Resources/Textures/Interface/Diegetic/PanelMountBase.svg create mode 100644 Resources/Textures/Interface/Diegetic/PanelMountBase.svg.96dpi.png create mode 100644 Resources/Textures/Interface/Diegetic/PanelMountHighlight.svg create mode 100644 Resources/Textures/Interface/Diegetic/PanelMountHighlight.svg.96dpi.png create mode 100644 Resources/Textures/Interface/Diegetic/screw.svg create mode 100644 Resources/Textures/Interface/Diegetic/screw.svg.96dpi.png create mode 100644 Resources/Textures/Interface/Diegetic/screw.svg.96dpi.png.yml create mode 100644 Resources/Textures/Interface/Nano/rounded_locked_button.svg create mode 100644 Resources/Textures/Interface/Nano/rounded_locked_button.svg.96dpi.png diff --git a/Content.Client/Communications/CommunicationsConsoleComponent.cs b/Content.Client/Communications/CommunicationsConsoleComponent.cs new file mode 100644 index 0000000000..5fdb2771da --- /dev/null +++ b/Content.Client/Communications/CommunicationsConsoleComponent.cs @@ -0,0 +1,14 @@ +using Content.Shared.Communications; +using Robust.Shared.Prototypes; + +namespace Content.Client.Communications; + +[RegisterComponent] +public sealed partial class CommunicationsConsoleComponent : SharedCommunicationsConsoleComponent +{ + /// + /// The prototype ID to use in the UI to show what entities a broadcast will display on + /// + [DataField] + public EntProtoId ScreenDisplayId = "Screen"; +} diff --git a/Content.Client/Communications/UI/CommunicationsConsoleBoundUserInterface.cs b/Content.Client/Communications/UI/CommunicationsConsoleBoundUserInterface.cs index 0310e91eeb..1cb38c8ef2 100644 --- a/Content.Client/Communications/UI/CommunicationsConsoleBoundUserInterface.cs +++ b/Content.Client/Communications/UI/CommunicationsConsoleBoundUserInterface.cs @@ -1,9 +1,8 @@ -using Content.Shared.CCVar; +using Content.Shared.CCVar; using Content.Shared.Chat; using Content.Shared.Communications; using Robust.Client.UserInterface; using Robust.Shared.Configuration; -using Robust.Shared.Timing; namespace Content.Client.Communications.UI { @@ -23,37 +22,31 @@ namespace Content.Client.Communications.UI base.Open(); _menu = this.CreateWindow(); - _menu.OnAnnounce += AnnounceButtonPressed; - _menu.OnBroadcast += BroadcastButtonPressed; - _menu.OnAlertLevel += AlertLevelSelected; - _menu.OnEmergencyLevel += EmergencyShuttleButtonPressed; + _menu.OnRadioAnnounce += RadioAnnounceButtonPressed; + _menu.OnScreenBroadcast += ScreenBroadcastButtonPressed; + _menu.OnAlertLevelChanged += AlertLevelSelected; + _menu.OnShuttleCalled += CallShuttle; + _menu.OnShuttleRecalled += RecallShuttle; + + if (EntMan.TryGetComponent(Owner, out var console)) + { + _menu.SetBroadcastDisplayEntity(console.ScreenDisplayId); + } } public void AlertLevelSelected(string level) { - if (_menu!.AlertLevelSelectable) - { - _menu.CurrentLevel = level; - SendMessage(new CommunicationsConsoleSelectAlertLevelMessage(level)); - } + SendMessage(new CommunicationsConsoleSelectAlertLevelMessage(level)); } - public void EmergencyShuttleButtonPressed() - { - if (_menu!.CountdownStarted) - RecallShuttle(); - else - CallShuttle(); - } - - public void AnnounceButtonPressed(string message) + public void RadioAnnounceButtonPressed(string message) { var maxLength = _cfg.GetCVar(CCVars.ChatMaxAnnouncementLength); var msg = SharedChatSystem.SanitizeAnnouncement(message, maxLength); SendMessage(new CommunicationsConsoleAnnounceMessage(msg)); } - public void BroadcastButtonPressed(string message) + public void ScreenBroadcastButtonPressed(string message) { SendMessage(new CommunicationsConsoleBroadcastMessage(message)); } @@ -77,20 +70,7 @@ namespace Content.Client.Communications.UI if (_menu != null) { - _menu.CanAnnounce = commsState.CanAnnounce; - _menu.CanBroadcast = commsState.CanBroadcast; - _menu.CanCall = commsState.CanCall; - _menu.CountdownStarted = commsState.CountdownStarted; - _menu.AlertLevelSelectable = commsState.AlertLevels != null && !float.IsNaN(commsState.CurrentAlertDelay) && commsState.CurrentAlertDelay <= 0; - _menu.CurrentLevel = commsState.CurrentAlert; - _menu.CountdownEnd = commsState.ExpectedCountdownEnd; - - _menu.UpdateCountdown(); - _menu.UpdateAlertLevels(commsState.AlertLevels, _menu.CurrentLevel); - _menu.AlertLevelButton.Disabled = !_menu.AlertLevelSelectable; - _menu.EmergencyShuttleButton.Disabled = !_menu.CanCall; - _menu.AnnounceButton.Disabled = !_menu.CanAnnounce; - _menu.BroadcastButton.Disabled = !_menu.CanBroadcast; + _menu.UpdateState(commsState); } } } diff --git a/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml b/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml index b74df979cf..d9b571cd3c 100644 --- a/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml +++ b/Content.Client/Communications/UI/CommunicationsConsoleMenu.xaml @@ -1,62 +1,32 @@ - + MouseFilter="Stop" MinSize="400 660" SetWidth="450"> + + + + + + + + + - - - - - - - - - - - -