Enhance paperwork UI (#16006)
This commit is contained in:
@@ -92,7 +92,7 @@ namespace Content.Server.Paper
|
||||
|
||||
private void OnInteractUsing(EntityUid uid, PaperComponent paperComp, InteractUsingEvent args)
|
||||
{
|
||||
if (_tagSystem.HasTag(args.Used, "Write"))
|
||||
if (_tagSystem.HasTag(args.Used, "Write") && paperComp.StampedBy.Count == 0)
|
||||
{
|
||||
var writeEvent = new PaperWriteEvent(uid, args.User);
|
||||
RaiseLocalEvent(args.Used, ref writeEvent);
|
||||
@@ -113,6 +113,8 @@ namespace Content.Server.Paper
|
||||
_popupSystem.PopupEntity(stampPaperOtherMessage, args.User, Filter.PvsExcept(args.User, entityManager: EntityManager), true);
|
||||
var stampPaperSelfMessage = Loc.GetString("paper-component-action-stamp-paper-self", ("target", Identity.Entity(args.Target, EntityManager)),("stamp", args.Used));
|
||||
_popupSystem.PopupEntity(stampPaperSelfMessage, args.User, args.User);
|
||||
|
||||
UpdateUserInterface(uid, paperComp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -124,7 +126,7 @@ namespace Content.Server.Paper
|
||||
var text = FormattedMessage.EscapeText(args.Text);
|
||||
|
||||
if (text.Length + paperComp.Content.Length <= paperComp.ContentSize)
|
||||
paperComp.Content += text + '\n';
|
||||
paperComp.Content = text;
|
||||
|
||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||
_appearance.SetData(uid, PaperVisuals.Status, PaperStatus.Written, appearance);
|
||||
@@ -136,6 +138,7 @@ namespace Content.Server.Paper
|
||||
_adminLogger.Add(LogType.Chat, LogImpact.Low,
|
||||
$"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
|
||||
|
||||
paperComp.Mode = PaperAction.Read;
|
||||
UpdateUserInterface(uid, paperComp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user