Button remapping work
This commit is contained in:
@@ -124,7 +124,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
#pragma warning disable CS4014 // Because this call is not awaited, execution of the current method continues before the call is completed
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (Visible && @event.IsActionPressed(GameInputs.UiCancel))
|
||||
if (Visible && @event.IsActionPressed(GameInputs.Inventory))
|
||||
{
|
||||
if (UseButton.HasFocus() || DropButton.HasFocus() || ThrowButton.HasFocus())
|
||||
{
|
||||
@@ -134,6 +134,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
}
|
||||
else
|
||||
{
|
||||
AcceptEvent();
|
||||
Autoload.AudioManager.Play(SoundEffect.Cancel);
|
||||
_gameRepo.CloseInventory();
|
||||
}
|
||||
@@ -142,17 +143,17 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
if (ItemSlots.Length == 0 || UseButton.HasFocus() || DropButton.HasFocus() || ThrowButton.HasFocus())
|
||||
return;
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.UiRight) && _currentPageNumber == InventoryPageNumber.FirstPage)
|
||||
if (@event.IsActionPressed(GameInputs.MoveRight) && _currentPageNumber == InventoryPageNumber.FirstPage)
|
||||
{
|
||||
var inventory = Player.Inventory;
|
||||
if (inventory.Items.Count > _itemsPerPage)
|
||||
ChangeInventoryPage(InventoryPageNumber.SecondPage);
|
||||
}
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.UiLeft) && _currentPageNumber == InventoryPageNumber.SecondPage)
|
||||
if (@event.IsActionPressed(GameInputs.MoveLeft) && _currentPageNumber == InventoryPageNumber.SecondPage)
|
||||
ChangeInventoryPage(InventoryPageNumber.FirstPage);
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.UiDown))
|
||||
if (@event.IsActionPressed(GameInputs.MoveDown))
|
||||
{
|
||||
var oldIndex = _currentIndex;
|
||||
var newIndex = new[] { _currentIndex + 1, _itemsPerPage - 1, ItemSlots.Length - 1 }.Min();
|
||||
@@ -165,7 +166,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
_currentIndex = newIndex;
|
||||
}
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.UiUp))
|
||||
if (@event.IsActionPressed(GameInputs.MoveUp))
|
||||
{
|
||||
var oldIndex = _currentIndex;
|
||||
var newIndex = new[] { _currentIndex - 1, 0 }.Max();
|
||||
@@ -179,7 +180,7 @@ public partial class InventoryMenu : Control, IInventoryMenu
|
||||
_currentIndex = newIndex;
|
||||
}
|
||||
|
||||
if (@event.IsActionPressed(GameInputs.UiAccept))
|
||||
if (@event.IsActionPressed(GameInputs.Attack))
|
||||
{
|
||||
DisplayUserActionPrompt();
|
||||
Autoload.AudioManager.Play(SoundEffect.Select);
|
||||
|
||||
Reference in New Issue
Block a user