Adds explicit inventory window.
This commit is contained in:
@@ -97,6 +97,7 @@ namespace Content.Client.GameObjects.Components.Actor
|
|||||||
if (Window != null)
|
if (Window != null)
|
||||||
{
|
{
|
||||||
_gameHud.CharacterButtonVisible = false;
|
_gameHud.CharacterButtonVisible = false;
|
||||||
|
Window.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -16,21 +16,32 @@ using static Content.Shared.GameObjects.Components.Inventory.EquipmentSlotDefine
|
|||||||
using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventoryMessage;
|
using static Content.Shared.GameObjects.SharedInventoryComponent.ClientInventoryMessage;
|
||||||
using Content.Client.GameObjects.Components.Mobs;
|
using Content.Client.GameObjects.Components.Mobs;
|
||||||
using Content.Client.GameObjects.Components.Actor;
|
using Content.Client.GameObjects.Components.Actor;
|
||||||
|
using Content.Client.UserInterface;
|
||||||
|
using Robust.Client.GameObjects;
|
||||||
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.Interfaces.Network;
|
||||||
|
|
||||||
namespace Content.Client.GameObjects
|
namespace Content.Client.GameObjects
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A character UI which shows items the user has equipped within his inventory
|
/// A character UI which shows items the user has equipped within his inventory
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ClientInventoryComponent : SharedInventoryComponent, ICharacterUI
|
public class ClientInventoryComponent : SharedInventoryComponent
|
||||||
{
|
{
|
||||||
private Dictionary<Slots, IEntity> _slots = new Dictionary<Slots, IEntity>();
|
private readonly Dictionary<Slots, IEntity> _slots = new Dictionary<Slots, IEntity>();
|
||||||
|
|
||||||
|
[Dependency]
|
||||||
|
#pragma warning disable 649
|
||||||
|
private readonly IGameHud _gameHud;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Holds the godot control for the inventory window
|
/// Holds the godot control for the inventory window
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private InventoryWindow _window;
|
private InventoryWindow _window;
|
||||||
|
|
||||||
|
public SS14Window Window => _window;
|
||||||
|
|
||||||
private string _templateName = "HumanInventory"; //stored for serialization purposes
|
private string _templateName = "HumanInventory"; //stored for serialization purposes
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -59,11 +70,12 @@ namespace Content.Client.GameObjects
|
|||||||
var reflectionManager = IoCManager.Resolve<IReflectionManager>();
|
var reflectionManager = IoCManager.Resolve<IReflectionManager>();
|
||||||
var type = reflectionManager.LooseGetType(_templateName);
|
var type = reflectionManager.LooseGetType(_templateName);
|
||||||
DebugTools.Assert(type != null);
|
DebugTools.Assert(type != null);
|
||||||
_inventory = (Inventory)Activator.CreateInstance(type);
|
_inventory = (Inventory) Activator.CreateInstance(type);
|
||||||
|
|
||||||
//Creates godot control class for inventory
|
//Creates godot control class for inventory
|
||||||
_window = new InventoryWindow(this);
|
_window = new InventoryWindow(this);
|
||||||
_window.CreateInventory(_inventory);
|
_window.CreateInventory(_inventory);
|
||||||
|
_window.OnClose += () => _gameHud.InventoryButtonDown = false;
|
||||||
|
|
||||||
if (Owner.TryGetComponent(out _sprite))
|
if (Owner.TryGetComponent(out _sprite))
|
||||||
{
|
{
|
||||||
@@ -73,6 +85,7 @@ namespace Content.Client.GameObjects
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_sprite.LayerMapReserveBlank(mask);
|
_sprite.LayerMapReserveBlank(mask);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -102,8 +115,6 @@ namespace Content.Client.GameObjects
|
|||||||
|
|
||||||
var doneSlots = new HashSet<Slots>();
|
var doneSlots = new HashSet<Slots>();
|
||||||
|
|
||||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
|
||||||
|
|
||||||
foreach (var (slot, entityUid) in cast.Entities)
|
foreach (var (slot, entityUid) in cast.Entities)
|
||||||
{
|
{
|
||||||
if (_slots.ContainsKey(slot))
|
if (_slots.ContainsKey(slot))
|
||||||
@@ -112,7 +123,7 @@ namespace Content.Client.GameObjects
|
|||||||
_clearSlot(slot);
|
_clearSlot(slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
var entity = entityManager.GetEntity(entityUid);
|
var entity = Owner.EntityManager.GetEntity(entityUid);
|
||||||
_slots[slot] = entity;
|
_slots[slot] = entity;
|
||||||
_setSlot(slot, entity);
|
_setSlot(slot, entity);
|
||||||
doneSlots.Add(slot);
|
doneSlots.Add(slot);
|
||||||
@@ -168,18 +179,59 @@ namespace Content.Client.GameObjects
|
|||||||
SendNetworkMessage(equipmessage);
|
SendNetworkMessage(equipmessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void HandleMessage(ComponentMessage message, INetChannel netChannel = null,
|
||||||
|
IComponent component = null)
|
||||||
|
{
|
||||||
|
base.HandleMessage(message, netChannel, component);
|
||||||
|
|
||||||
|
switch (message)
|
||||||
|
{
|
||||||
|
case PlayerAttachedMsg _:
|
||||||
|
_gameHud.InventoryButtonVisible = true;
|
||||||
|
_gameHud.InventoryButtonToggled = b =>
|
||||||
|
{
|
||||||
|
if (b)
|
||||||
|
{
|
||||||
|
Window.Open();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Window.Close();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PlayerDetachedMsg _:
|
||||||
|
_gameHud.InventoryButtonVisible = false;
|
||||||
|
_window.Close();
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Temporary window to hold the basis for inventory hud
|
/// Temporary window to hold the basis for inventory hud
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private class InventoryWindow : GridContainer
|
private sealed class InventoryWindow : SS14Window
|
||||||
{
|
{
|
||||||
private List<Slots> IndexedSlots;
|
private List<Slots> IndexedSlots;
|
||||||
private Dictionary<Slots, InventoryButton> InventorySlots = new Dictionary<Slots, InventoryButton>(); //ordered dictionary?
|
|
||||||
|
private Dictionary<Slots, InventoryButton>
|
||||||
|
InventorySlots = new Dictionary<Slots, InventoryButton>(); //ordered dictionary?
|
||||||
|
|
||||||
private readonly ClientInventoryComponent InventoryComponent;
|
private readonly ClientInventoryComponent InventoryComponent;
|
||||||
|
private readonly GridContainer _gridContainer;
|
||||||
|
|
||||||
public InventoryWindow(ClientInventoryComponent inventory)
|
public InventoryWindow(ClientInventoryComponent inventory)
|
||||||
{
|
{
|
||||||
|
Title = "Inventory";
|
||||||
|
|
||||||
InventoryComponent = inventory;
|
InventoryComponent = inventory;
|
||||||
|
_gridContainer = new GridContainer();
|
||||||
|
Contents.AddChild(_gridContainer);
|
||||||
|
|
||||||
|
Size = CombinedMinimumSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -187,7 +239,7 @@ namespace Content.Client.GameObjects
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void CreateInventory(Inventory inventory)
|
public void CreateInventory(Inventory inventory)
|
||||||
{
|
{
|
||||||
Columns = inventory.Columns;
|
_gridContainer.Columns = inventory.Columns;
|
||||||
|
|
||||||
IndexedSlots = new List<Slots>(inventory.SlotMasks);
|
IndexedSlots = new List<Slots>(inventory.SlotMasks);
|
||||||
|
|
||||||
@@ -213,7 +265,7 @@ namespace Content.Client.GameObjects
|
|||||||
button.Text = button.ToolTip = SlotNames[slot];
|
button.Text = button.ToolTip = SlotNames[slot];
|
||||||
}
|
}
|
||||||
|
|
||||||
AddChild(newButton);
|
_gridContainer.AddChild(newButton);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,7 +307,7 @@ namespace Content.Client.GameObjects
|
|||||||
private void RemoveFromInventory(BaseButton.ButtonEventArgs args)
|
private void RemoveFromInventory(BaseButton.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
args.Button.Pressed = false;
|
args.Button.Pressed = false;
|
||||||
var control = (InventoryButton)args.Button.Parent;
|
var control = (InventoryButton) args.Button.Parent;
|
||||||
|
|
||||||
InventoryComponent.SendUnequipMessage(control.Slot);
|
InventoryComponent.SendUnequipMessage(control.Slot);
|
||||||
}
|
}
|
||||||
@@ -263,7 +315,7 @@ namespace Content.Client.GameObjects
|
|||||||
private void AddToInventory(BaseButton.ButtonEventArgs args)
|
private void AddToInventory(BaseButton.ButtonEventArgs args)
|
||||||
{
|
{
|
||||||
args.Button.Pressed = false;
|
args.Button.Pressed = false;
|
||||||
var control = (InventoryButton)args.Button.Parent;
|
var control = (InventoryButton) args.Button.Parent;
|
||||||
|
|
||||||
InventoryComponent.SendEquipMessage(control.Slot);
|
InventoryComponent.SendEquipMessage(control.Slot);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ namespace Content.Client.GameObjects.EntitySystems
|
|||||||
|
|
||||||
var inputSys = EntitySystemManager.GetEntitySystem<InputSystem>();
|
var inputSys = EntitySystemManager.GetEntitySystem<InputSystem>();
|
||||||
inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenCharacterMenu,
|
inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenCharacterMenu,
|
||||||
new PointerInputCmdHandler(HandleOpenCharacterMenu));
|
InputCmdHandler.FromDelegate(s => HandleOpenCharacterMenu()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void HandleOpenCharacterMenu(in PointerInputCmdHandler.PointerInputCmdArgs args)
|
private void HandleOpenCharacterMenu()
|
||||||
{
|
{
|
||||||
if (_playerManager.LocalPlayer.ControlledEntity == null
|
if (_playerManager.LocalPlayer.ControlledEntity == null
|
||||||
|| !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out CharacterInterface characterInterface))
|
|| !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out CharacterInterface characterInterface))
|
||||||
|
|||||||
@@ -0,0 +1,69 @@
|
|||||||
|
using Content.Client.UserInterface;
|
||||||
|
using Content.Shared.Input;
|
||||||
|
using Robust.Client.GameObjects.EntitySystems;
|
||||||
|
using Robust.Client.Player;
|
||||||
|
using Robust.Client.UserInterface.CustomControls;
|
||||||
|
using Robust.Shared.GameObjects.Systems;
|
||||||
|
using Robust.Shared.Input;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
|
|
||||||
|
namespace Content.Client.GameObjects.EntitySystems
|
||||||
|
{
|
||||||
|
public sealed class ClientInventorySystem : EntitySystem
|
||||||
|
{
|
||||||
|
#pragma warning disable 649
|
||||||
|
[Dependency] private readonly IGameHud _gameHud;
|
||||||
|
[Dependency] private readonly IPlayerManager _playerManager;
|
||||||
|
#pragma warning restore 649
|
||||||
|
|
||||||
|
public override void Initialize()
|
||||||
|
{
|
||||||
|
base.Initialize();
|
||||||
|
|
||||||
|
var inputSys = EntitySystemManager.GetEntitySystem<InputSystem>();
|
||||||
|
inputSys.BindMap.BindFunction(ContentKeyFunctions.OpenInventoryMenu,
|
||||||
|
InputCmdHandler.FromDelegate(s => HandleOpenInventoryMenu()));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void HandleOpenInventoryMenu()
|
||||||
|
{
|
||||||
|
if (_playerManager.LocalPlayer.ControlledEntity == null
|
||||||
|
|| !_playerManager.LocalPlayer.ControlledEntity.TryGetComponent(out ClientInventoryComponent clientInventory))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var menu = clientInventory.Window;
|
||||||
|
|
||||||
|
if (menu.IsOpen)
|
||||||
|
{
|
||||||
|
if (menu.IsAtFront())
|
||||||
|
{
|
||||||
|
_setOpenValue(menu, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
menu.MoveToFront();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_setOpenValue(menu, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void _setOpenValue(SS14Window menu, bool value)
|
||||||
|
{
|
||||||
|
if (value)
|
||||||
|
{
|
||||||
|
_gameHud.InventoryButtonDown = true;
|
||||||
|
menu.OpenCentered();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_gameHud.InventoryButtonDown = false;
|
||||||
|
menu.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,6 +26,7 @@ namespace Content.Client.Input
|
|||||||
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
|
human.AddFunction(ContentKeyFunctions.ThrowItemInHand);
|
||||||
human.AddFunction(ContentKeyFunctions.OpenContextMenu);
|
human.AddFunction(ContentKeyFunctions.OpenContextMenu);
|
||||||
human.AddFunction(ContentKeyFunctions.OpenCraftingMenu);
|
human.AddFunction(ContentKeyFunctions.OpenCraftingMenu);
|
||||||
|
human.AddFunction(ContentKeyFunctions.OpenInventoryMenu);
|
||||||
// Disabled until there is feedback, so hitting tab doesn't suddenly break interaction.
|
// Disabled until there is feedback, so hitting tab doesn't suddenly break interaction.
|
||||||
// human.AddFunction(ContentKeyFunctions.ToggleCombatMode);
|
// human.AddFunction(ContentKeyFunctions.ToggleCombatMode);
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,17 @@ namespace Content.Client.UserInterface
|
|||||||
bool CharacterButtonVisible { get; set; }
|
bool CharacterButtonVisible { get; set; }
|
||||||
Action<bool> CharacterButtonToggled { get; set; }
|
Action<bool> CharacterButtonToggled { get; set; }
|
||||||
|
|
||||||
|
// Inventory top button.
|
||||||
|
bool InventoryButtonDown { get; set; }
|
||||||
|
bool InventoryButtonVisible { get; set; }
|
||||||
|
Action<bool> InventoryButtonToggled { get; set; }
|
||||||
|
|
||||||
// Crafting top button.
|
// Crafting top button.
|
||||||
bool CraftingButtonDown { get; set; }
|
bool CraftingButtonDown { get; set; }
|
||||||
bool CraftingButtonVisible { get; set; }
|
bool CraftingButtonVisible { get; set; }
|
||||||
Action<bool> CraftingButtonToggled { get; set; }
|
Action<bool> CraftingButtonToggled { get; set; }
|
||||||
|
|
||||||
|
// Sandbox top button.
|
||||||
bool SandboxButtonDown { get; set; }
|
bool SandboxButtonDown { get; set; }
|
||||||
bool SandboxButtonVisible { get; set; }
|
bool SandboxButtonVisible { get; set; }
|
||||||
Action<bool> SandboxButtonToggled { get; set; }
|
Action<bool> SandboxButtonToggled { get; set; }
|
||||||
@@ -48,13 +55,14 @@ namespace Content.Client.UserInterface
|
|||||||
private TopButton _buttonEscapeMenu;
|
private TopButton _buttonEscapeMenu;
|
||||||
private TopButton _buttonTutorial;
|
private TopButton _buttonTutorial;
|
||||||
private TopButton _buttonCharacterMenu;
|
private TopButton _buttonCharacterMenu;
|
||||||
|
private TopButton _buttonInventoryMenu;
|
||||||
private TopButton _buttonCraftingMenu;
|
private TopButton _buttonCraftingMenu;
|
||||||
private TopButton _buttonSandboxMenu;
|
private TopButton _buttonSandboxMenu;
|
||||||
private TutorialWindow _tutorialWindow;
|
private TutorialWindow _tutorialWindow;
|
||||||
|
|
||||||
#pragma warning disable 649
|
#pragma warning disable 649
|
||||||
[Dependency] private readonly IResourceCache _resourceCache;
|
[Dependency] private readonly IResourceCache _resourceCache;
|
||||||
[Dependency] private readonly ILocalizationManager _localizationManager;
|
[Dependency] private readonly ILocalizationManager _loc;
|
||||||
[Dependency] private readonly IInputManager _inputManager;
|
[Dependency] private readonly IInputManager _inputManager;
|
||||||
#pragma warning restore 649
|
#pragma warning restore 649
|
||||||
|
|
||||||
@@ -66,6 +74,7 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
var escapeTexture = _resourceCache.GetTexture("/Textures/UserInterface/hamburger.svg.96dpi.png");
|
var escapeTexture = _resourceCache.GetTexture("/Textures/UserInterface/hamburger.svg.96dpi.png");
|
||||||
var characterTexture = _resourceCache.GetTexture("/Textures/UserInterface/character.svg.96dpi.png");
|
var characterTexture = _resourceCache.GetTexture("/Textures/UserInterface/character.svg.96dpi.png");
|
||||||
|
var inventoryTexture = _resourceCache.GetTexture("/Textures/UserInterface/inventory.svg.96dpi.png");
|
||||||
var craftingTexture = _resourceCache.GetTexture("/Textures/UserInterface/hammer.svg.96dpi.png");
|
var craftingTexture = _resourceCache.GetTexture("/Textures/UserInterface/hammer.svg.96dpi.png");
|
||||||
var tutorialTexture = _resourceCache.GetTexture("/Textures/UserInterface/students-cap.svg.96dpi.png");
|
var tutorialTexture = _resourceCache.GetTexture("/Textures/UserInterface/students-cap.svg.96dpi.png");
|
||||||
var sandboxTexture = _resourceCache.GetTexture("/Textures/UserInterface/sandbox.svg.96dpi.png");
|
var sandboxTexture = _resourceCache.GetTexture("/Textures/UserInterface/sandbox.svg.96dpi.png");
|
||||||
@@ -82,7 +91,7 @@ namespace Content.Client.UserInterface
|
|||||||
// Escape
|
// Escape
|
||||||
_buttonEscapeMenu = new TopButton(escapeTexture, "Esc")
|
_buttonEscapeMenu = new TopButton(escapeTexture, "Esc")
|
||||||
{
|
{
|
||||||
ToolTip = _localizationManager.GetString("Open escape menu.")
|
ToolTip = _loc.GetString("Open escape menu.")
|
||||||
};
|
};
|
||||||
|
|
||||||
_topButtonsContainer.AddChild(_buttonEscapeMenu);
|
_topButtonsContainer.AddChild(_buttonEscapeMenu);
|
||||||
@@ -92,17 +101,17 @@ namespace Content.Client.UserInterface
|
|||||||
// Tutorial
|
// Tutorial
|
||||||
_buttonTutorial = new TopButton(tutorialTexture, "F1")
|
_buttonTutorial = new TopButton(tutorialTexture, "F1")
|
||||||
{
|
{
|
||||||
ToolTip = _localizationManager.GetString("Open tutorial.")
|
ToolTip = _loc.GetString("Open tutorial.")
|
||||||
};
|
};
|
||||||
|
|
||||||
_topButtonsContainer.AddChild(_buttonTutorial);
|
_topButtonsContainer.AddChild(_buttonTutorial);
|
||||||
|
|
||||||
_buttonTutorial.OnToggled += a => ButtonTutorialOnOnToggled();
|
_buttonTutorial.OnToggled += a => ButtonTutorialOnOnToggled();
|
||||||
|
|
||||||
// Inventory
|
// Character
|
||||||
_buttonCharacterMenu = new TopButton(characterTexture, "C")
|
_buttonCharacterMenu = new TopButton(characterTexture, "C")
|
||||||
{
|
{
|
||||||
ToolTip = _localizationManager.GetString("Open character menu."),
|
ToolTip = _loc.GetString("Open character menu."),
|
||||||
Visible = false
|
Visible = false
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -110,10 +119,21 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
_buttonCharacterMenu.OnToggled += args => CharacterButtonToggled?.Invoke(args.Pressed);
|
_buttonCharacterMenu.OnToggled += args => CharacterButtonToggled?.Invoke(args.Pressed);
|
||||||
|
|
||||||
|
// Inventory
|
||||||
|
_buttonInventoryMenu = new TopButton(inventoryTexture, "I")
|
||||||
|
{
|
||||||
|
ToolTip = _loc.GetString("Open inventory menu."),
|
||||||
|
Visible = false
|
||||||
|
};
|
||||||
|
|
||||||
|
_topButtonsContainer.AddChild(_buttonInventoryMenu);
|
||||||
|
|
||||||
|
_buttonInventoryMenu.OnToggled += args => InventoryButtonToggled?.Invoke(args.Pressed);
|
||||||
|
|
||||||
// Crafting
|
// Crafting
|
||||||
_buttonCraftingMenu = new TopButton(craftingTexture, "G")
|
_buttonCraftingMenu = new TopButton(craftingTexture, "G")
|
||||||
{
|
{
|
||||||
ToolTip = _localizationManager.GetString("Open crafting menu."),
|
ToolTip = _loc.GetString("Open crafting menu."),
|
||||||
Visible = false
|
Visible = false
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -124,7 +144,7 @@ namespace Content.Client.UserInterface
|
|||||||
// Sandbox
|
// Sandbox
|
||||||
_buttonSandboxMenu = new TopButton(sandboxTexture, "B")
|
_buttonSandboxMenu = new TopButton(sandboxTexture, "B")
|
||||||
{
|
{
|
||||||
ToolTip = _localizationManager.GetString("Open sandbox menu."),
|
ToolTip = _loc.GetString("Open sandbox menu."),
|
||||||
Visible = true
|
Visible = true
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -185,6 +205,20 @@ namespace Content.Client.UserInterface
|
|||||||
|
|
||||||
public Action<bool> CharacterButtonToggled { get; set; }
|
public Action<bool> CharacterButtonToggled { get; set; }
|
||||||
|
|
||||||
|
public bool InventoryButtonDown
|
||||||
|
{
|
||||||
|
get => _buttonInventoryMenu.Pressed;
|
||||||
|
set => _buttonInventoryMenu.Pressed = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool InventoryButtonVisible
|
||||||
|
{
|
||||||
|
get => _buttonInventoryMenu.Visible;
|
||||||
|
set => _buttonInventoryMenu.Visible = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Action<bool> InventoryButtonToggled { get; set; }
|
||||||
|
|
||||||
public bool CraftingButtonDown
|
public bool CraftingButtonDown
|
||||||
{
|
{
|
||||||
get => _buttonCraftingMenu.Pressed;
|
get => _buttonCraftingMenu.Pressed;
|
||||||
|
|||||||
@@ -5,18 +5,19 @@ namespace Content.Shared.Input
|
|||||||
[KeyFunctions]
|
[KeyFunctions]
|
||||||
public static class ContentKeyFunctions
|
public static class ContentKeyFunctions
|
||||||
{
|
{
|
||||||
public static readonly BoundKeyFunction SwapHands = "SwapHands";
|
|
||||||
public static readonly BoundKeyFunction Drop = "Drop";
|
|
||||||
public static readonly BoundKeyFunction ActivateItemInHand = "ActivateItemInHand";
|
public static readonly BoundKeyFunction ActivateItemInHand = "ActivateItemInHand";
|
||||||
public static readonly BoundKeyFunction OpenCharacterMenu = "OpenCharacterMenu";
|
|
||||||
public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu";
|
|
||||||
public static readonly BoundKeyFunction ExamineEntity = "ExamineEntity";
|
|
||||||
public static readonly BoundKeyFunction UseItemInHand = "UseItemInHand"; // use hand item on world entity
|
|
||||||
public static readonly BoundKeyFunction ActivateItemInWorld = "ActivateItemInWorld"; // default action on world entity
|
public static readonly BoundKeyFunction ActivateItemInWorld = "ActivateItemInWorld"; // default action on world entity
|
||||||
public static readonly BoundKeyFunction ThrowItemInHand = "ThrowItemInHand";
|
public static readonly BoundKeyFunction Drop = "Drop";
|
||||||
public static readonly BoundKeyFunction OpenContextMenu = "OpenContextMenu";
|
public static readonly BoundKeyFunction ExamineEntity = "ExamineEntity";
|
||||||
public static readonly BoundKeyFunction FocusChat = "FocusChatWindow";
|
public static readonly BoundKeyFunction FocusChat = "FocusChatWindow";
|
||||||
public static readonly BoundKeyFunction ToggleCombatMode = "ToggleCombatMode";
|
public static readonly BoundKeyFunction OpenCharacterMenu = "OpenCharacterMenu";
|
||||||
|
public static readonly BoundKeyFunction OpenContextMenu = "OpenContextMenu";
|
||||||
|
public static readonly BoundKeyFunction OpenCraftingMenu = "OpenCraftingMenu";
|
||||||
|
public static readonly BoundKeyFunction OpenInventoryMenu = "OpenInventoryMenu";
|
||||||
public static readonly BoundKeyFunction OpenTutorial = "OpenTutorial";
|
public static readonly BoundKeyFunction OpenTutorial = "OpenTutorial";
|
||||||
|
public static readonly BoundKeyFunction SwapHands = "SwapHands";
|
||||||
|
public static readonly BoundKeyFunction ThrowItemInHand = "ThrowItemInHand";
|
||||||
|
public static readonly BoundKeyFunction ToggleCombatMode = "ToggleCombatMode";
|
||||||
|
public static readonly BoundKeyFunction UseItemInHand = "UseItemInHand"; // use hand item on world entity
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -82,3 +82,6 @@ binds:
|
|||||||
- function: OpenTutorial
|
- function: OpenTutorial
|
||||||
type: state
|
type: state
|
||||||
key: F1
|
key: F1
|
||||||
|
- function: OpenInventoryMenu
|
||||||
|
type: state
|
||||||
|
key: I
|
||||||
|
|||||||
Reference in New Issue
Block a user