Fixed PaperSystem bugs (#22896)
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using Robust.Client.GameObjects;
|
|
||||||
using Robust.Client.UserInterface.Controls;
|
using Robust.Client.UserInterface.Controls;
|
||||||
using Robust.Shared.Input;
|
using Robust.Shared.Input;
|
||||||
using Robust.Shared.Utility;
|
using Robust.Shared.Utility;
|
||||||
@@ -48,8 +47,6 @@ public sealed class PaperBoundUserInterface : BoundUserInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void Input_OnTextEntered(string text)
|
private void Input_OnTextEntered(string text)
|
||||||
{
|
|
||||||
if (!string.IsNullOrEmpty(text))
|
|
||||||
{
|
{
|
||||||
SendMessage(new PaperInputTextMessage(text));
|
SendMessage(new PaperInputTextMessage(text));
|
||||||
|
|
||||||
@@ -59,7 +56,6 @@ public sealed class PaperBoundUserInterface : BoundUserInterface
|
|||||||
_window.Input.CursorPosition = new TextEdit.CursorPos(0, TextEdit.LineBreakBias.Top);
|
_window.Input.CursorPosition = new TextEdit.CursorPos(0, TextEdit.LineBreakBias.Top);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ using Content.Shared.Paper;
|
|||||||
using Content.Shared.Tag;
|
using Content.Shared.Tag;
|
||||||
using Robust.Server.GameObjects;
|
using Robust.Server.GameObjects;
|
||||||
using Robust.Shared.Player;
|
using Robust.Shared.Player;
|
||||||
using Robust.Shared.Utility;
|
|
||||||
using Robust.Shared.Audio;
|
|
||||||
using Robust.Shared.Audio.Systems;
|
using Robust.Shared.Audio.Systems;
|
||||||
using static Content.Shared.Paper.SharedPaperComponent;
|
using static Content.Shared.Paper.SharedPaperComponent;
|
||||||
|
|
||||||
@@ -134,9 +132,10 @@ namespace Content.Server.Paper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private StampDisplayInfo GetStampInfo(StampComponent stamp)
|
private static StampDisplayInfo GetStampInfo(StampComponent stamp)
|
||||||
|
{
|
||||||
|
return new StampDisplayInfo
|
||||||
{
|
{
|
||||||
return new StampDisplayInfo {
|
|
||||||
StampedName = stamp.StampedName,
|
StampedName = stamp.StampedName,
|
||||||
StampedColor = stamp.StampedColor
|
StampedColor = stamp.StampedColor
|
||||||
};
|
};
|
||||||
@@ -144,10 +143,8 @@ namespace Content.Server.Paper
|
|||||||
|
|
||||||
private void OnInputTextMessage(EntityUid uid, PaperComponent paperComp, PaperInputTextMessage args)
|
private void OnInputTextMessage(EntityUid uid, PaperComponent paperComp, PaperInputTextMessage args)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(args.Text))
|
if (args.Text.Length <= paperComp.ContentSize)
|
||||||
return;
|
{
|
||||||
|
|
||||||
if (args.Text.Length + paperComp.Content.Length <= paperComp.ContentSize)
|
|
||||||
paperComp.Content = args.Text;
|
paperComp.Content = args.Text;
|
||||||
|
|
||||||
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
if (TryComp<AppearanceComponent>(uid, out var appearance))
|
||||||
@@ -159,6 +156,7 @@ namespace Content.Server.Paper
|
|||||||
if (args.Session.AttachedEntity != null)
|
if (args.Session.AttachedEntity != null)
|
||||||
_adminLogger.Add(LogType.Chat, LogImpact.Low,
|
_adminLogger.Add(LogType.Chat, LogImpact.Low,
|
||||||
$"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
|
$"{ToPrettyString(args.Session.AttachedEntity.Value):player} has written on {ToPrettyString(uid):entity} the following text: {args.Text}");
|
||||||
|
}
|
||||||
|
|
||||||
paperComp.Mode = PaperAction.Read;
|
paperComp.Mode = PaperAction.Read;
|
||||||
UpdateUserInterface(uid, paperComp);
|
UpdateUserInterface(uid, paperComp);
|
||||||
|
|||||||
Reference in New Issue
Block a user