Make pointing arrows not show up on the context menu (#2252)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
Content.Shared/GameObjects/Verbs/IShowContextMenu.cs
Normal file
9
Content.Shared/GameObjects/Verbs/IShowContextMenu.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
|
||||
namespace Content.Shared.GameObjects.Verbs
|
||||
{
|
||||
public interface IShowContextMenu : IComponent
|
||||
{
|
||||
bool ShowContextMenu(IEntity examiner);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user