in-game chemical book (#17213)

This commit is contained in:
Nemanja
2023-06-08 10:47:53 -04:00
committed by GitHub
parent c0eefc3765
commit 14b64f5eec
3 changed files with 22 additions and 0 deletions

View File

@@ -11,6 +11,7 @@ using Robust.Client.GameObjects;
using Robust.Client.Player;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.Utility;
namespace Content.Client.Guidebook;
@@ -20,6 +21,7 @@ namespace Content.Client.Guidebook;
/// </summary>
public sealed class GuidebookSystem : EntitySystem
{
[Dependency] private readonly IGameTiming _timing = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
[Dependency] private readonly VerbSystem _verbSystem = default!;
@@ -78,6 +80,9 @@ public sealed class GuidebookSystem : EntitySystem
private void OnInteract(EntityUid uid, GuideHelpComponent component, ActivateInWorldEvent args)
{
if (!_timing.IsFirstTimePredicted)
return;
if (!component.OpenOnActivation || component.Guides.Count == 0 || _tags.HasTag(uid, GuideEmbedTag))
return;