feat(ui): complete retail quick-slot input
Port global toolbar use/select/create actions, migrate the collapsed Ctrl-number bindings, and route them through a focused retained-UI controller. Preserve shortcut aliases as aliases across inventory and paperdoll drops with retail's neutral/accept/reject drag states, preventing physical item moves such as unwielding an equipped helmet. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
6fcc510d5d
commit
e65119f0c6
24 changed files with 650 additions and 69 deletions
|
|
@ -0,0 +1,32 @@
|
|||
using AcDream.App.UI.Layout;
|
||||
using AcDream.UI.Abstractions.Input;
|
||||
|
||||
namespace AcDream.App.Tests.UI.Layout;
|
||||
|
||||
public sealed class ToolbarInputControllerTests
|
||||
{
|
||||
[Theory]
|
||||
[InlineData(InputAction.UseQuickSlot_1, 0, true)]
|
||||
[InlineData(InputAction.UseQuickSlot_9, 8, true)]
|
||||
[InlineData(InputAction.SelectQuickSlot_1, 0, false)]
|
||||
[InlineData(InputAction.SelectQuickSlot_9, 8, false)]
|
||||
[InlineData(InputAction.UseQuickSlot_14, 13, true)]
|
||||
[InlineData(InputAction.UseQuickSlot_18, 17, true)]
|
||||
public void ShortcutActions_mapRetailSlotAndIntent(InputAction action, int slot, bool use)
|
||||
{
|
||||
Assert.True(ToolbarInputController.TryMapShortcut(action, out int actualSlot, out bool actualUse));
|
||||
Assert.Equal(slot, actualSlot);
|
||||
Assert.Equal(use, actualUse);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData(InputAction.CreateShortcut)]
|
||||
[InlineData(InputAction.CombatToggleCombat)]
|
||||
[InlineData(InputAction.ToggleChatEntry)]
|
||||
public void NonSlotActions_doNotMapAsShortcut(InputAction action)
|
||||
{
|
||||
Assert.False(ToolbarInputController.TryMapShortcut(action, out int slot, out bool use));
|
||||
Assert.Equal(-1, slot);
|
||||
Assert.False(use);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue