Enhance paperwork UI (#16006)

This commit is contained in:
Echo
2023-05-06 00:35:22 -07:00
committed by GitHub
parent 77edd7e666
commit 68eb28ac95
5 changed files with 23 additions and 14 deletions

View File

@@ -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();