Stack examining is now ECS.

This commit is contained in:
Vera Aguilera Puerto
2021-05-26 10:32:40 +02:00
parent b9debaa273
commit 0f703b8f02
3 changed files with 18 additions and 18 deletions

View File

@@ -1,6 +1,7 @@
using Content.Shared.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
namespace Content.Shared.GameObjects.EntitySystems
{
@@ -13,6 +14,7 @@ namespace Content.Shared.GameObjects.EntitySystems
SubscribeLocalEvent<SharedStackComponent, ComponentStartup>(OnStackStarted);
SubscribeLocalEvent<SharedStackComponent, StackChangeCountEvent>(OnStackCountChange);
SubscribeLocalEvent<SharedStackComponent, ExaminedEvent>(OnStackExamined);
}
private void OnStackStarted(EntityUid uid, SharedStackComponent component, ComponentStartup args)
@@ -56,6 +58,20 @@ namespace Content.Shared.GameObjects.EntitySystems
RaiseLocalEvent(uid, new StackCountChangedEvent(old, component.Count));
}
private void OnStackExamined(EntityUid uid, SharedStackComponent component, ExaminedEvent args)
{
if (!args.IsInDetailsRange)
return;
args.Message.AddText("\n");
args.Message.AddMarkup(
Loc.GetString("comp-stack-examine-detail-count",
("count", component.Count),
("markupCountColor", "lightgray")
)
);
}
}
/// <summary>