Enhance paperwork UI (#16006)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<paper:PaperWindow xmlns="https://spacestation14.io"
|
||||
xmlns:paper="clr-namespace:Content.Client.Paper.UI"
|
||||
MouseFilter="Stop" Resizable="True" MinSize="150 150"
|
||||
SetSize="300 400"> <!-- Provide some reasonable sizes by default. Can be changed by the component -->
|
||||
SetSize="510 660"> <!-- Provide some reasonable sizes by default. Can be changed by the component -->
|
||||
|
||||
<BoxContainer Name="ContentsRoot" Orientation="Vertical">
|
||||
<PanelContainer StyleClasses="AngleRect" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="6">
|
||||
@@ -12,9 +12,8 @@
|
||||
<PanelContainer Name="PaperContent" VerticalExpand="True" HorizontalExpand="True" MaxWidth="600">
|
||||
<BoxContainer Orientation="Vertical" VerticalAlignment="Stretch">
|
||||
<TextureButton Name="HeaderImage" HorizontalAlignment="Center" VerticalAlignment="Top" MouseFilter="Ignore"/>
|
||||
<Control Name="TextAlignmentPadding" VerticalAlignment="Top" />
|
||||
<RichTextLabel Name="BlankPaperIndicator" StyleClasses="LabelSecondaryColor"
|
||||
VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
||||
<Control Name="TextAlignmentPadding" VerticalAlignment="Top"/>
|
||||
<RichTextLabel Name="BlankPaperIndicator" StyleClasses="LabelSecondaryColor" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
||||
<RichTextLabel StyleClasses="PaperWrittenText" Name="WrittenTextLabel" VerticalAlignment="Top"/>
|
||||
<PanelContainer Name="InputContainer" StyleClasses="TransparentBorderedWindowPanel" MinHeight="100"
|
||||
VerticalAlignment="Stretch" VerticalExpand="True" HorizontalExpand="True">
|
||||
|
||||
@@ -3,6 +3,7 @@ using Robust.Client.AutoGenerated;
|
||||
using Robust.Client.Graphics;
|
||||
using Robust.Client.ResourceManagement;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.XAML;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -180,13 +181,19 @@ namespace Content.Client.Paper.UI
|
||||
InputContainer.Visible = isEditing;
|
||||
|
||||
var msg = new FormattedMessage();
|
||||
// Remove any newlines from the end of the message. There can be a trailing
|
||||
// new line at the end of user input, and we would like to display the input
|
||||
// box immediately on the next line.
|
||||
msg.AddMarkupPermissive(state.Text.TrimEnd('\r', '\n'));
|
||||
WrittenTextLabel.SetMessage(msg);
|
||||
WrittenTextLabel.Visible = state.Text.Length > 0;
|
||||
msg.AddMarkupPermissive(state.Text);
|
||||
|
||||
Input.TextRope = Rope.Leaf.Empty;
|
||||
Input.CursorPosition = new TextEdit.CursorPos();
|
||||
Input.InsertAtCursor(msg.ToString());
|
||||
|
||||
for (var i = 0; i <= state.StampedBy.Count * 3 + 1; i++)
|
||||
{
|
||||
msg.AddMarkupPermissive("\r\n");
|
||||
}
|
||||
WrittenTextLabel.SetMessage(msg);
|
||||
|
||||
WrittenTextLabel.Visible = !isEditing && state.Text.Length > 0;
|
||||
BlankPaperIndicator.Visible = !isEditing && state.Text.Length == 0;
|
||||
|
||||
StampDisplay.RemoveAllChildren();
|
||||
|
||||
Reference in New Issue
Block a user