Cargo: pizza & bureaucracy (#5123)

* add paper label component

* git mv

* rename namespace

* add cargo printouts

* more crates

* directly attach paper

* comment typo
This commit is contained in:
Leon Friedrich
2021-11-11 02:15:23 +13:00
committed by GitHub
parent b8d8f48b11
commit 88df3d8b10
33 changed files with 384 additions and 162 deletions

View File

@@ -36,6 +36,22 @@ namespace Content.Server.Paper
_mode = PaperAction.Read;
UpdateUserInterface();
}
public void SetContent(string content)
{
Content = content + '\n';
UpdateUserInterface();
if (!Owner.TryGetComponent(out AppearanceComponent? appearance))
return;
var status = string.IsNullOrWhiteSpace(content)
? PaperStatus.Blank
: PaperStatus.Written;
appearance.SetData(PaperVisuals.Status, status);
}
private void UpdateUserInterface()
{
UserInterface?.SetState(new PaperBoundUserInterfaceState(Content, _mode));