From b38dc9bccebaee7bbbafbd93a1170524c5249a5a Mon Sep 17 00:00:00 2001 From: ThereDrD <88589686+ThereDrD0@users.noreply.github.com> Date: Sat, 16 Aug 2025 06:13:21 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=81=D0=BE=D0=BB=D0=B8?= =?UTF-8?q?=20=D1=81=D1=82=D0=B0=D0=BD=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=83=D1=87=D0=B5=D1=82=D0=B0=20(#2800)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- ...lStationRecordConsoleBoundUserInterface.cs | 6 + .../GeneralStationRecordConsoleWindow.xaml | 4 +- .../GeneralStationRecordConsoleWindow.xaml.cs | 38 ++- .../StationRecords/SunriseGeneralRecord.xaml | 69 +++++ .../SunriseGeneralRecord.xaml.cs | 282 ++++++++++++++++++ .../GeneralStationRecordConsoleComponent.cs | 37 +++ .../GeneralStationRecordConsoleSystem.cs | 27 +- .../Systems/StationRecordsSystem.cs | 1 + .../GeneralStationRecordConsoleSystem.cs | 234 +++++++++++++++ .../Humanoid/Prototypes/SpeciesPrototype.cs | 3 + .../StationRecords/GeneralRecordsUi.cs | 11 +- .../StationRecords/GeneralStationRecord.cs | 44 ++- .../_Sunrise/Helpers/StringExtensions.cs | 39 +++ .../SunriseStationRecordEvents.cs | 17 ++ .../_sunrise/station-records/printable.ftl | 27 ++ .../_sunrise/station-records/radio.ftl | 2 + .../_strings/_sunrise/station-records/ui.ftl | 20 ++ .../Machines/Computers/computers.yml | 4 + Resources/Prototypes/Species/terminator.yml | 1 + .../Prototypes/_Sunrise/Species/abductor.yml | 1 + 20 files changed, 856 insertions(+), 11 deletions(-) create mode 100644 Content.Client/_Sunrise/StationRecords/SunriseGeneralRecord.xaml create mode 100644 Content.Client/_Sunrise/StationRecords/SunriseGeneralRecord.xaml.cs create mode 100644 Content.Server/_Sunrise/StationRecords/Systems/GeneralStationRecordConsoleSystem.cs create mode 100644 Content.Shared/_Sunrise/Helpers/StringExtensions.cs create mode 100644 Content.Shared/_Sunrise/StationRecords/SunriseStationRecordEvents.cs create mode 100644 Resources/Locale/ru-RU/_strings/_sunrise/station-records/printable.ftl create mode 100644 Resources/Locale/ru-RU/_strings/_sunrise/station-records/radio.ftl create mode 100644 Resources/Locale/ru-RU/_strings/_sunrise/station-records/ui.ftl diff --git a/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs b/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs index e7bab71e38..a506a49177 100644 --- a/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs +++ b/Content.Client/StationRecords/GeneralStationRecordConsoleBoundUserInterface.cs @@ -1,3 +1,4 @@ +using Content.Shared._Sunrise.StationRecords; using Content.Shared.StationRecords; using Robust.Client.UserInterface; @@ -22,6 +23,11 @@ public sealed class GeneralStationRecordConsoleBoundUserInterface : BoundUserInt _window.OnFiltersChanged += (type, filterValue) => SendMessage(new SetStationRecordFilter(type, filterValue)); _window.OnDeleted += id => SendMessage(new DeleteStationRecord(id)); + + // Sunrise added start + _window.OnSaved += (record, id) => SendMessage(new SaveStationRecord(record, id)); + _window.OnPrinted += id => SendMessage(new PrintStationRecord(id)); + // Sunrise added end } protected override void UpdateState(BoundUserInterfaceState state) diff --git a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml index 3615eb8e00..d5201a0781 100644 --- a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml +++ b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml @@ -17,9 +17,9 @@ - + diff --git a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs index 272e6c3b25..616aecf1e9 100644 --- a/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs +++ b/Content.Client/StationRecords/GeneralStationRecordConsoleWindow.xaml.cs @@ -1,7 +1,12 @@ +using Content.Client._Sunrise.StationRecords; +using Content.Client.Lobby; +using Content.Client.Roles; using Content.Shared.StationRecords; using Robust.Client.AutoGenerated; +using Robust.Client.UserInterface; using Robust.Client.UserInterface.CustomControls; using Robust.Client.UserInterface.XAML; +using Robust.Shared.Prototypes; namespace Content.Client.StationRecords; @@ -17,10 +22,30 @@ public sealed partial class GeneralStationRecordConsoleWindow : DefaultWindow private StationRecordFilterType _currentFilterType; + // Sunrise added start + public Action? OnSaved; + public Action? OnPrinted; + + private readonly IEntityManager _entity; + private readonly IPrototypeManager _prototype; + private readonly ILocalizationManager _loc; + private readonly JobSystem _job; + private readonly LobbyUIController _controller; + // Sunrise added end + public GeneralStationRecordConsoleWindow() { RobustXamlLoader.Load(this); + // Sunrise added start + _entity = IoCManager.Resolve(); + _prototype = IoCManager.Resolve(); + _loc = IoCManager.Resolve(); + var interfaceManager = IoCManager.Resolve(); + _job = _entity.System(); + _controller = interfaceManager.GetUIController(); + // Sunrise added end + _currentFilterType = StationRecordFilterType.Name; foreach (var item in Enum.GetValues()) @@ -111,7 +136,8 @@ public sealed partial class GeneralStationRecordConsoleWindow : DefaultWindow RecordContainerStatus.Text = state.SelectedKey == null ? Loc.GetString("general-station-record-console-no-record-found") : Loc.GetString("general-station-record-console-select-record-info"); - PopulateRecordContainer(state.Record, state.CanDeleteEntries, state.SelectedKey); + // Sunrise edit + PopulateRecordContainer(state.Record, state.CanDeleteEntries, state.CanRedactSensitiveData, state.HasAccess, state.SelectedKey); } else { @@ -136,11 +162,17 @@ public sealed partial class GeneralStationRecordConsoleWindow : DefaultWindow RecordListing.SortItemsByText(); } - private void PopulateRecordContainer(GeneralStationRecord record, bool enableDelete, uint? id) + // Sunrise edit + private void PopulateRecordContainer(GeneralStationRecord record, bool enableDelete, bool canRedactSensitiveData, bool hasAccess, uint? id) { RecordContainer.RemoveAllChildren(); - var newRecord = new GeneralRecord(record, enableDelete, id); + // Sunrise edit start + var newRecord = + new SunriseGeneralRecord(record, enableDelete, canRedactSensitiveData, hasAccess, id, in _entity, in _prototype, in _loc, in _job, in _controller); + // Sunrise edit end newRecord.OnDeletePressed = OnDeleted; + newRecord.OnPrintPressed = OnPrinted; + newRecord.OnSaveButtonPressed = OnSaved; RecordContainer.AddChild(newRecord); } diff --git a/Content.Client/_Sunrise/StationRecords/SunriseGeneralRecord.xaml b/Content.Client/_Sunrise/StationRecords/SunriseGeneralRecord.xaml new file mode 100644 index 0000000000..13f6698e10 --- /dev/null +++ b/Content.Client/_Sunrise/StationRecords/SunriseGeneralRecord.xaml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +