2020-12-10 23:19:55 +01:00
|
|
|
|
using Content.Shared.GameObjects.Components;
|
2020-02-11 20:01:05 -03:00
|
|
|
|
using Robust.Client.UserInterface.Controls;
|
|
|
|
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
|
|
using Robust.Shared.Maths;
|
|
|
|
|
|
using Robust.Shared.Utility;
|
|
|
|
|
|
|
2020-08-13 14:40:27 +02:00
|
|
|
|
namespace Content.Client.GameObjects.Components.Paper
|
2020-02-11 20:01:05 -03:00
|
|
|
|
{
|
|
|
|
|
|
public class PaperWindow : SS14Window
|
|
|
|
|
|
{
|
|
|
|
|
|
private readonly RichTextLabel _label;
|
|
|
|
|
|
public readonly LineEdit Input;
|
|
|
|
|
|
protected override Vector2? CustomSize => (300, 300);
|
|
|
|
|
|
|
|
|
|
|
|
public PaperWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
var container = new VBoxContainer();
|
|
|
|
|
|
_label = new RichTextLabel();
|
|
|
|
|
|
Input = new LineEdit {Visible = false};
|
|
|
|
|
|
container.AddChild(_label);
|
|
|
|
|
|
container.AddChild(Input);
|
|
|
|
|
|
Contents.AddChild(container);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void Populate(SharedPaperComponent.PaperBoundUserInterfaceState state)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (state.Mode == SharedPaperComponent.PaperAction.Write)
|
|
|
|
|
|
{
|
|
|
|
|
|
Input.Visible = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
var msg = new FormattedMessage();
|
2020-12-10 23:19:55 +01:00
|
|
|
|
msg.AddMarkupPermissive(state.Text);
|
2020-02-11 20:01:05 -03:00
|
|
|
|
_label.SetMessage(msg);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|