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 @@ - + -