Various Paper adjustments (#3993)
* Various Paper adjustments + can now have prefilled text + cleaned up paper sprite layering a bit, + adds an AME manual as a test but doesn't put it anywhere + Paper cannot write arbitrary Examine markup * Paper component doesn't show text on examine anymore
This commit is contained in:
@@ -7,7 +7,9 @@ using Content.Shared.GameObjects.EntitySystems;
|
||||
using Content.Shared.Interfaces.GameObjects.Components;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization.Manager.Attributes;
|
||||
using Robust.Shared.Utility;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.ViewVariables;
|
||||
|
||||
namespace Content.Server.GameObjects.Components.Paper
|
||||
@@ -16,6 +18,7 @@ namespace Content.Server.GameObjects.Components.Paper
|
||||
public class PaperComponent : SharedPaperComponent, IExamine, IInteractUsing, IUse
|
||||
{
|
||||
private PaperAction _mode;
|
||||
[DataField("content")]
|
||||
public string Content { get; private set; } = "";
|
||||
|
||||
[ViewVariables] private BoundUserInterface? UserInterface => Owner.GetUIOrNull(PaperUiKey.Key);
|
||||
@@ -41,8 +44,14 @@ namespace Content.Server.GameObjects.Components.Paper
|
||||
{
|
||||
if (!inDetailsRange)
|
||||
return;
|
||||
if (Content == "")
|
||||
return;
|
||||
|
||||
message.AddMarkup(Content);
|
||||
message.AddMarkup(
|
||||
Loc.GetString(
|
||||
"paper-component-examine-detail-has-words"
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
bool IUse.UseEntity(UseEntityEventArgs eventArgs)
|
||||
@@ -66,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Paper
|
||||
|
||||
if (Owner.TryGetComponent(out SpriteComponent? sprite))
|
||||
{
|
||||
sprite.LayerSetState(1, "paper_words");
|
||||
sprite.LayerSetState(0, "paper_words");
|
||||
}
|
||||
|
||||
Owner.Description = "";
|
||||
|
||||
Reference in New Issue
Block a user