Equipment verbs & admin inventory access. (#14315)

This commit is contained in:
Leon Friedrich
2023-03-06 06:12:08 +13:00
committed by GitHub
parent a9b268af49
commit b148bebd60
29 changed files with 499 additions and 141 deletions

View File

@@ -5,12 +5,15 @@ using Content.Client.Strip;
using Content.Client.Stylesheets;
using Content.Client.UserInterface.Controls;
using Content.Client.UserInterface.Systems.Hands.Controls;
using Content.Client.Verbs;
using Content.Client.Verbs.UI;
using Content.Shared.Ensnaring.Components;
using Content.Shared.Hands.Components;
using Content.Shared.IdentityManagement;
using Content.Shared.Input;
using Content.Shared.Inventory;
using Content.Shared.Strip.Components;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.ResourceManagement;
@@ -19,6 +22,7 @@ using Robust.Client.UserInterface.Controls;
using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;
using static Content.Client.Inventory.ClientInventorySystem;
using static Robust.Client.UserInterface.Control;
@@ -31,6 +35,7 @@ namespace Content.Client.Inventory
[Dependency] private readonly IPrototypeManager _protoMan = default!;
[Dependency] private readonly IEntityManager _entMan = default!;
[Dependency] private readonly IUserInterfaceManager _ui = default!;
private ExamineSystem _examine = default!;
private InventorySystem _inv = default!;
@@ -170,15 +175,16 @@ namespace Content.Client.Inventory
if (ev.Function == EngineKeyFunctions.Use)
{
SendMessage(new StrippingSlotButtonPressed(slot.SlotName, slot is HandButton));
}
else if (ev.Function == ContentKeyFunctions.ExamineEntity && slot.Entity != null)
{
_examine.DoExamine(slot.Entity.Value);
return;
}
if (ev.Function != EngineKeyFunctions.Use)
if (slot.Entity == null)
return;
if (ev.Function == ContentKeyFunctions.ExamineEntity)
_examine.DoExamine(slot.Entity.Value);
else if (ev.Function == EngineKeyFunctions.UseSecondary)
_ui.GetUIController<VerbMenuUIController>().OpenVerbMenu(slot.Entity.Value);
}
private void AddInventoryButton(string slotId, InventoryTemplatePrototype template, InventoryComponent inv)