From d1ef2f7fc752caf523d4f70c8dabb1f0b5fc692a Mon Sep 17 00:00:00 2001 From: Vigers Ray <60344369+VigersRay@users.noreply.github.com> Date: Sat, 16 Aug 2025 06:20:10 +0300 Subject: [PATCH] Copy machine fix (#2806) --- Content.Client/Paper/UI/PaperWindow.xaml | 2 + Content.Client/Paper/UI/PaperWindow.xaml.cs | 16 +- .../CopyMachineBoundUserInterface.cs | 38 + .../CopyMachineMenu.xaml} | 20 +- .../CopyMachineMenu.xaml.cs} | 22 +- .../_Sunrise/CopyMachine/CopyMachineSystem.cs | 8 + .../PrinterDocBoundUserInterface.cs | 38 - .../_Sunrise/PrinterDoc/PrinterDocSystem.cs | 8 - Content.Server/Fax/FaxConstants.cs | 2 + Content.Server/Fax/FaxSystem.cs | 21 +- .../_Sunrise/CopyMachine/CopyMachineSystem.cs | 374 +++++ .../_Sunrise/PrinterDoc/PrinterDocSystem.cs | 471 ------ .../StationGoal/StationGoalPaperSystem.cs | 8 +- .../Fax/Components/FaxMachineComponent.cs | 15 +- Content.Shared/Fax/SharedFax.cs | 12 +- .../Humanoid/Prototypes/SpeciesPrototype.cs | 2 +- Content.Shared/Paper/PaperComponent.cs | 23 +- Content.Shared/Paper/PaperSystem.cs | 16 +- .../CopyMachineBoundUserInterfaceState.cs | 62 + .../CopyMachineComponent.cs} | 32 +- .../CopyMachine/CopyMachineJobType.cs | 7 + .../CopyMachine/CopyMachineUiMessages.cs | 14 + .../DocTemplate.cs | 5 +- .../_Sunrise/CopyMachine/PoolDocTemplate.cs | 13 + .../CopyMachine/SharedCopyMachineSystem.cs | 5 + .../PrinterDocBoundUserInterfaceState.cs | 56 - .../PrinterDoc/PrinterDocUiMessages.cs | 14 - .../_Sunrise/PrinterDoc/PrinterJobType.cs | 7 - .../PrinterDoc/SharedPrinterDocSystem.cs | 12 - .../_Sunrise/SunriseCCVars/SunriseCCVars.cs | 13 +- .../_sunrise/catalog/fills/crates/service.ftl | 4 +- .../circuitboards/machine/production.ftl | 2 +- .../entities/objects/misc/flatpacks.ftl | 2 +- .../entities/structures/machines/printer.ftl | 4 +- .../station-goal/station-goal-component.ftl | 1448 ++++++++--------- .../_sunrise/catalog/fills/crates/service.ftl | 4 +- .../circuitboards/machine/production.ftl | 4 +- .../entities/objects/misc/flatpacks.ftl | 4 +- .../entities/structures/machines/printer.ftl | 4 +- .../copy_machine.ftl} | 56 +- .../station-goal/station-goal-component.ftl | 1448 ++++++++--------- .../VendingMachines/Inventories/curadrobe.yml | 2 +- .../Markers/Spawners/Random/crates.yml | 2 +- Resources/Prototypes/Species/arachnid.yml | 5 +- Resources/Prototypes/Species/diona.yml | 5 +- Resources/Prototypes/Species/dwarf.yml | 5 +- Resources/Prototypes/Species/gingerbread.yml | 5 +- Resources/Prototypes/Species/human.yml | 5 +- Resources/Prototypes/Species/moth.yml | 5 +- Resources/Prototypes/Species/reptilian.yml | 5 +- Resources/Prototypes/Species/skeleton.yml | 5 +- Resources/Prototypes/Species/slime.yml | 5 +- Resources/Prototypes/Species/terminator.yml | 6 +- Resources/Prototypes/Species/vox.yml | 5 +- .../_Sunrise/Catalog/Cargo/cargo_service.yml | 10 +- .../_Sunrise/Catalog/Fills/Crates/service.yml | 6 +- .../DocumentTemplates/pool_template.yml | 66 + .../_Sunrise/DocumentTemplates/templates.yml | 189 +++ .../Circuitboards/Machine/production.yml | 4 +- .../Entities/Objects/Misc/flatpacks.yml | 4 +- .../{printer.yml => copy_machine.yml} | 51 +- .../_Sunrise/Recipes/Lathes/Packs/science.yml | 2 +- .../_Sunrise/Recipes/Lathes/misc.yml | 4 +- .../Prototypes/_Sunrise/Species/demon.yml | 4 +- .../Prototypes/_Sunrise/Species/felinid.yml | 4 +- .../_Sunrise/Species/humanoid_xeno.yml | 4 +- .../Prototypes/_Sunrise/Species/predator.yml | 4 +- .../Prototypes/_Sunrise/Species/swine.yml | 4 +- .../Prototypes/_Sunrise/Species/tajaran.yml | 5 +- .../Prototypes/_Sunrise/Species/vulpkanin.yml | 5 +- .../Centcom/OrderingSpecialEquipment.xml | 2 - .../RequestCallMembersCentralCommitteeDSO.xml | 2 - .../_Sunrise/Command/ApplicationAccess.xml | 2 - .../Command/ApplicationAppointmentInterim.xml | 2 - .../Command/ApplicationEmployment.xml | 2 - .../_Sunrise/Command/ApplicationEquipment.xml | 2 - .../_Sunrise/Command/Certificate.xml | 2 - .../Command/CertificateAdvancedTraining.xml | 2 - .../Command/EvacuationShuttleRequest.xml | 2 - .../_Sunrise/Command/LetterResignation.xml | 2 - .../Command/OrderDeprivationAccess.xml | 2 - .../_Sunrise/Command/OrderDismissal.xml | 2 - .../_Sunrise/Command/OrderEncouragement.xml | 2 - .../_Sunrise/Command/OrderParolePrisoner.xml | 2 - .../_Sunrise/Command/PermissionEquipment.xml | 2 - .../Command/PermissionToCarryWeapons.xml | 2 - .../Command/PermissionToExtendMarriage.xml | 2 - .../PermissionToTravelInCaseOfThreat.xml | 2 - .../_Sunrise/Command/ReportDepartment.xml | 2 - .../Command/ReportEmployeePerformance.xml | 2 - .../ReportOnEliminationOfViolations.xml | 2 - .../Command/ReportOnTheChaptersMeeting.xml | 2 - .../_Sunrise/Command/ReportStation.xml | 2 - .../Command/RequestForNonlistedEmployment.xml | 2 - .../_Sunrise/Command/RequestForPromotion.xml | 2 - .../_Sunrise/Engineering/ConditionReport.xml | 2 - .../Engineering/ConstructionPermit.xml | 2 - .../Engineering/RequestConstructionWork.xml | 2 - .../Documents/_Sunrise/General/Appeal.xml | 2 - .../General/OrderMedicalIntervention.xml | 2 - .../General/ProductManufacturingOrder.xml | 2 - .../_Sunrise/General/RequestChangeSalary.xml | 2 - .../Justice/ComplaintViolationLaborRules.xml | 2 - .../_Sunrise/Justice/DecisionToStartTrial.xml | 2 - .../Justice/InternalAffairsAgentsReport.xml | 2 - .../Documents/_Sunrise/Justice/Judgment.xml | 2 - .../_Sunrise/Justice/RequestDocuments.xml | 2 - .../_Sunrise/Medical/DeathCertificate.xml | 2 - .../Medical/PermissionDisposeBody.xml | 2 - .../Medical/PrescriptionDrugAuthorization.xml | 2 - .../_Sunrise/Medical/RequestEuthanasia.xml | 2 - .../_Sunrise/Medical/StatementHealth.xml | 2 - .../_Sunrise/Science/ExperimentReport.xml | 2 - .../OrderRecognizingSentienceCreature.xml | 2 - .../_Sunrise/Science/ReportStudyObject.xml | 2 - .../_Sunrise/Science/RequestModernization.xml | 2 - .../RequestRequestToEstablishThreatLevel.xml | 2 - .../_Sunrise/Security/CertificateOffense.xml | 2 - .../_Sunrise/Security/ClosingIndictment.xml | 2 - .../_Sunrise/Security/ComplaintOffense.xml | 2 - .../_Sunrise/Security/SearchPermission.xml | 2 - .../Security/ShuttleRegistrationRequest.xml | 2 - .../_Sunrise/Service/DivorceCertificate.xml | 2 - .../_Sunrise/Service/MarriageCertificate.xml | 2 - .../_Sunrise/Supply/DisposalReport.xml | 2 - .../OrderPurchaseResourcesEquipment.xml | 2 - .../_Sunrise/Supply/OrderPurchaseWeapons.xml | 2 - .../_Sunrise/Syndicate/BusinessDeal.xml | 2 - .../Syndicate/ErrorLoadingFormHeader.xml | 2 - .../NoteBeginningMilitaryActions.xml | 2 - .../Syndicate/NoticeOfLiquidation.xml | 2 - .../Syndicate/ReportAccomplishmentGoals.xml | 2 - .../Textures/_Sunrise/ButtsScans/license.txt | 1 - .../butts_scans.rsi}/diona.png | Bin .../butts_scans.rsi}/human.png | Bin .../CopyMachine/butts_scans.rsi/meta.json | 26 + .../butts_scans.rsi}/reptilian.png | Bin .../butts_scans.rsi}/slime.png | Bin .../butts_scans.rsi}/vox.png | Bin .../CopyMachine/paper_headers.rsi/meta.json | 57 + .../nanotrasen_form_header.png | Bin 0 -> 23594 bytes .../nanotrasen_form_header_centcom.png | Bin 0 -> 19267 bytes .../nanotrasen_form_header_cmd.png | Bin 0 -> 26410 bytes .../nanotrasen_form_header_court.png | Bin 0 -> 29451 bytes .../nanotrasen_form_header_eng.png | Bin 0 -> 27062 bytes .../nanotrasen_form_header_just.png | Bin 0 -> 36576 bytes .../nanotrasen_form_header_just_oversight.png | Bin 0 -> 31526 bytes .../nanotrasen_form_header_mag.png | Bin 0 -> 25550 bytes .../nanotrasen_form_header_med.png | Bin 0 -> 27690 bytes .../nanotrasen_form_header_rnd.png | Bin 0 -> 24596 bytes .../nanotrasen_form_header_sec.png | Bin 0 -> 29636 bytes .../nanotrasen_form_header_sec_investig.png | Bin 0 -> 31162 bytes .../nanotrasen_form_header_serv.png | Bin 0 -> 26307 bytes .../nanotrasen_form_header_specops.png | Bin 0 -> 29888 bytes .../nanotrasen_form_header_sup.png | Bin 0 -> 26537 bytes .../syndicate_form_header.png | Bin 0 -> 23290 bytes Resources/Textures/_Sunrise/Paper/license.txt | 14 - .../_Sunrise/Paper/nanotrasen_form_header.png | Bin 8586 -> 0 bytes .../Paper/nanotrasen_form_header_centcom.png | Bin 9727 -> 0 bytes .../Paper/nanotrasen_form_header_cmd.png | Bin 8831 -> 0 bytes .../Paper/nanotrasen_form_header_eng.png | Bin 10054 -> 0 bytes .../Paper/nanotrasen_form_header_just.png | Bin 11670 -> 0 bytes .../Paper/nanotrasen_form_header_mag.png | Bin 9702 -> 0 bytes .../Paper/nanotrasen_form_header_med.png | Bin 10455 -> 0 bytes .../Paper/nanotrasen_form_header_rnd.png | Bin 11440 -> 0 bytes .../Paper/nanotrasen_form_header_sec.png | Bin 9963 -> 0 bytes .../nanotrasen_form_header_sec_investig.png | Bin 9988 -> 0 bytes .../Paper/nanotrasen_form_header_serv.png | Bin 9801 -> 0 bytes .../Paper/nanotrasen_form_header_sup.png | Bin 9964 -> 0 bytes .../Paper/nanotrasen_form_logo_colored.png | Bin 2908 -> 0 bytes .../_Sunrise/Paper/syndicate_form_header.png | Bin 7086 -> 0 bytes .../building.png | Bin .../icon.png | Bin .../idle.png | Bin .../inserting.png | Bin .../meta.json | 0 .../panel.png | Bin Resources/migration.yml | 2 + 178 files changed, 2472 insertions(+), 2494 deletions(-) create mode 100644 Content.Client/_Sunrise/CopyMachine/CopyMachineBoundUserInterface.cs rename Content.Client/_Sunrise/{PrinterDoc/PrinterDocMenu.xaml => CopyMachine/CopyMachineMenu.xaml} (76%) rename Content.Client/_Sunrise/{PrinterDoc/PrinterDocMenu.xaml.cs => CopyMachine/CopyMachineMenu.xaml.cs} (89%) create mode 100644 Content.Client/_Sunrise/CopyMachine/CopyMachineSystem.cs delete mode 100644 Content.Client/_Sunrise/PrinterDoc/PrinterDocBoundUserInterface.cs delete mode 100644 Content.Client/_Sunrise/PrinterDoc/PrinterDocSystem.cs create mode 100644 Content.Server/_Sunrise/CopyMachine/CopyMachineSystem.cs delete mode 100644 Content.Server/_Sunrise/PrinterDoc/PrinterDocSystem.cs create mode 100644 Content.Shared/_Sunrise/CopyMachine/CopyMachineBoundUserInterfaceState.cs rename Content.Shared/_Sunrise/{PrinterDoc/PrinterDocComponent.cs => CopyMachine/CopyMachineComponent.cs} (82%) create mode 100644 Content.Shared/_Sunrise/CopyMachine/CopyMachineJobType.cs create mode 100644 Content.Shared/_Sunrise/CopyMachine/CopyMachineUiMessages.cs rename Content.Shared/_Sunrise/{PrinterDoc => CopyMachine}/DocTemplate.cs (82%) create mode 100644 Content.Shared/_Sunrise/CopyMachine/PoolDocTemplate.cs create mode 100644 Content.Shared/_Sunrise/CopyMachine/SharedCopyMachineSystem.cs delete mode 100644 Content.Shared/_Sunrise/PrinterDoc/PrinterDocBoundUserInterfaceState.cs delete mode 100644 Content.Shared/_Sunrise/PrinterDoc/PrinterDocUiMessages.cs delete mode 100644 Content.Shared/_Sunrise/PrinterDoc/PrinterJobType.cs delete mode 100644 Content.Shared/_Sunrise/PrinterDoc/SharedPrinterDocSystem.cs rename Resources/Locale/ru-RU/_strings/_sunrise/{printer_doc/printer_doc.ftl => copy-machine/copy_machine.ftl} (80%) create mode 100644 Resources/Prototypes/_Sunrise/DocumentTemplates/pool_template.yml rename Resources/Prototypes/_Sunrise/Entities/Structures/Machines/{printer.yml => copy_machine.yml} (78%) delete mode 100644 Resources/Textures/_Sunrise/ButtsScans/license.txt rename Resources/Textures/_Sunrise/{ButtsScans => CopyMachine/butts_scans.rsi}/diona.png (100%) rename Resources/Textures/_Sunrise/{ButtsScans => CopyMachine/butts_scans.rsi}/human.png (100%) create mode 100644 Resources/Textures/_Sunrise/CopyMachine/butts_scans.rsi/meta.json rename Resources/Textures/_Sunrise/{ButtsScans => CopyMachine/butts_scans.rsi}/reptilian.png (100%) rename Resources/Textures/_Sunrise/{ButtsScans => CopyMachine/butts_scans.rsi}/slime.png (100%) rename Resources/Textures/_Sunrise/{ButtsScans => CopyMachine/butts_scans.rsi}/vox.png (100%) create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/meta.json create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_centcom.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_cmd.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_court.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_eng.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_just.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_just_oversight.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_mag.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_med.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_rnd.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_sec.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_sec_investig.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_serv.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_specops.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/nanotrasen_form_header_sup.png create mode 100644 Resources/Textures/_Sunrise/CopyMachine/paper_headers.rsi/syndicate_form_header.png delete mode 100644 Resources/Textures/_Sunrise/Paper/license.txt delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_centcom.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_cmd.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_eng.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_just.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_mag.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_med.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_rnd.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_sec.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_sec_investig.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_serv.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_header_sup.png delete mode 100644 Resources/Textures/_Sunrise/Paper/nanotrasen_form_logo_colored.png delete mode 100644 Resources/Textures/_Sunrise/Paper/syndicate_form_header.png rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/building.png (100%) rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/icon.png (100%) rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/idle.png (100%) rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/inserting.png (100%) rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/meta.json (100%) rename Resources/Textures/_Sunrise/Structures/Machines/{printer.rsi => copy_machine.rsi}/panel.png (100%) diff --git a/Content.Client/Paper/UI/PaperWindow.xaml b/Content.Client/Paper/UI/PaperWindow.xaml index 5e882b29e6..5df4541c17 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml +++ b/Content.Client/Paper/UI/PaperWindow.xaml @@ -12,6 +12,8 @@ + diff --git a/Content.Client/Paper/UI/PaperWindow.xaml.cs b/Content.Client/Paper/UI/PaperWindow.xaml.cs index cb94756905..7c9934d935 100644 --- a/Content.Client/Paper/UI/PaperWindow.xaml.cs +++ b/Content.Client/Paper/UI/PaperWindow.xaml.cs @@ -11,6 +11,7 @@ using Robust.Client.UserInterface.XAML; using Robust.Shared.Utility; using Robust.Client.UserInterface.RichText; using Content.Client.UserInterface.RichText; +using Robust.Client.GameObjects; using Robust.Shared.Input; namespace Content.Client.Paper.UI @@ -20,6 +21,7 @@ namespace Content.Client.Paper.UI { [Dependency] private readonly IInputManager _inputManager = default!; [Dependency] private readonly IResourceCache _resCache = default!; + [Dependency] private readonly IEntitySystemManager _entitySystemManager = default!; private static Color DefaultTextColor = new(25, 25, 25); @@ -47,8 +49,7 @@ namespace Content.Client.Paper.UI typeof(HeadingTag), typeof(ItalicTag), typeof(MonoTag), - typeof(CenterTag), - typeof(TextureTag) // Не дай бог игроки узнают что можно использовать данный ТЭГ для рофлов. + typeof(CenterTag) }; public event Action? OnSaved; @@ -288,6 +289,17 @@ namespace Content.Client.Paper.UI WrittenTextLabel.Visible = !isEditing && state.Text.Length > 0; BlankPaperIndicator.Visible = !isEditing && state.Text.Length == 0; + // Sunrise-Start + var sprite = _entitySystemManager.GetEntitySystem(); + if (state.ImageContent != null) + { + ImageContent.Texture = sprite.Frame0(state.ImageContent); + if (state.ImageScale != null) + ImageContent.TextureScale = state.ImageScale.Value; + BlankPaperIndicator.Visible = false; + } + // Sunrise-End + StampDisplay.RemoveAllChildren(); StampDisplay.RemoveStamps(); foreach(var stamper in state.StampedBy) diff --git a/Content.Client/_Sunrise/CopyMachine/CopyMachineBoundUserInterface.cs b/Content.Client/_Sunrise/CopyMachine/CopyMachineBoundUserInterface.cs new file mode 100644 index 0000000000..962499208e --- /dev/null +++ b/Content.Client/_Sunrise/CopyMachine/CopyMachineBoundUserInterface.cs @@ -0,0 +1,38 @@ +using Content.Shared._Sunrise.CopyMachine; +using Robust.Client.UserInterface; + +namespace Content.Client._Sunrise.CopyMachine; + +public sealed class CopyMachineBoundUserInterface : BoundUserInterface +{ + [ViewVariables] + private CopyMachineMenu? _window; + + public CopyMachineBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { } + + protected override void Open() + { + base.Open(); + + _window = this.CreateWindow(); + + _window.OnPrintPressed += templateId => + { + if (templateId != null) + SendMessage(new CopyMachinePrintMessage(templateId)); + }; + + _window.OnCopyPressed += () => + { + SendMessage(new CopyMachineCopyMessage()); + }; + } + + protected override void UpdateState(BoundUserInterfaceState state) + { + if (state is not CopyMachineBoundUserInterfaceState s || _window == null) + return; + + _window.UpdateState(s); + } +} diff --git a/Content.Client/_Sunrise/PrinterDoc/PrinterDocMenu.xaml b/Content.Client/_Sunrise/CopyMachine/CopyMachineMenu.xaml similarity index 76% rename from Content.Client/_Sunrise/PrinterDoc/PrinterDocMenu.xaml rename to Content.Client/_Sunrise/CopyMachine/CopyMachineMenu.xaml index 4d33123d6a..16f8756e5e 100644 --- a/Content.Client/_Sunrise/PrinterDoc/PrinterDocMenu.xaml +++ b/Content.Client/_Sunrise/CopyMachine/CopyMachineMenu.xaml @@ -1,7 +1,7 @@ @@ -11,13 +11,13 @@ - + -