Make pointing arrows not show up on the context menu (#2252)

This commit is contained in:
DrSmugleaf
2020-10-14 22:40:59 +02:00
committed by GitHub
parent 5fcd13d0e3
commit d9b3833577
3 changed files with 24 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
using Content.Client.State;
@@ -129,6 +130,11 @@ namespace Content.Client.GameObjects.EntitySystems
continue;
}
if (entity.GetAllComponents<IShowContextMenu>().Any(s => !s.ShowContextMenu(playerEntity)))
{
continue;
}
if (ContainerHelpers.TryGetContainer(entity, out var container) && !container.ShowContents)
{
continue;

View File

@@ -1,9 +1,16 @@
using Robust.Shared.GameObjects;
using Content.Shared.GameObjects.Verbs;
using Robust.Shared.GameObjects;
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.Components.Pointing
{
public class SharedPointingArrowComponent : Component
public class SharedPointingArrowComponent : Component, IShowContextMenu
{
public sealed override string Name => "PointingArrow";
public bool ShowContextMenu(IEntity examiner)
{
return false;
}
}
}

View File

@@ -0,0 +1,9 @@
using Robust.Shared.Interfaces.GameObjects;
namespace Content.Shared.GameObjects.Verbs
{
public interface IShowContextMenu : IComponent
{
bool ShowContextMenu(IEntity examiner);
}
}