Files
OldThink/Content.Client/GameObjects/EntitySystems/ClientInventorySystem.cs

41 lines
1.2 KiB
C#
Raw Normal View History

using Content.Client.GameObjects.Components.HUD.Inventory;
2019-07-20 13:11:42 +02:00
using Content.Client.UserInterface;
using Content.Shared.Input;
using JetBrains.Annotations;
2019-07-20 13:11:42 +02:00
using Robust.Client.Player;
using Robust.Client.UserInterface.CustomControls;
using Robust.Shared.GameObjects;
using Robust.Shared.Input.Binding;
2019-07-20 13:11:42 +02:00
using Robust.Shared.IoC;
namespace Content.Client.GameObjects.EntitySystems
{
[UsedImplicitly]
2019-07-20 13:11:42 +02:00
public sealed class ClientInventorySystem : EntitySystem
{
[Dependency] private readonly IGameHud _gameHud = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
2019-07-20 13:11:42 +02:00
public override void Initialize()
{
base.Initialize();
CommandBinds.Builder
.Bind(ContentKeyFunctions.OpenInventoryMenu,
InputCmdHandler.FromDelegate(_ => HandleOpenInventoryMenu()))
.Register<ClientInventorySystem>();
}
public override void Shutdown()
{
CommandBinds.Unregister<ClientInventorySystem>();
base.Shutdown();
2019-07-20 13:11:42 +02:00
}
private void HandleOpenInventoryMenu()
{
_gameHud.InventoryButtonDown = !_gameHud.InventoryButtonDown;
2019-07-20 13:11:42 +02:00
}
}
}