feat(ui): finish retail toolbar controls
Discover all seven panel launchers from their DAT panel-id attributes, route mounted panels through event-driven retained window state, and ghost unavailable panels. Port Use and Examine selection/target behavior with exact Appraise dispatch and retail cursor modes. Co-Authored-By: Codex <codex@openai.com>
This commit is contained in:
parent
21fefce0e0
commit
d3d1c895a0
19 changed files with 478 additions and 72 deletions
|
|
@ -15,6 +15,7 @@ public sealed class ItemInteractionControllerTests
|
|||
{
|
||||
public readonly ClientObjectTable Objects = new();
|
||||
public readonly List<uint> Uses = new();
|
||||
public readonly List<uint> Examines = new();
|
||||
public readonly List<(uint Source, uint Target)> UseWithTarget = new();
|
||||
public readonly List<(uint Item, uint Mask)> Wields = new();
|
||||
public readonly List<uint> Drops = new();
|
||||
|
|
@ -45,6 +46,7 @@ public sealed class ItemInteractionControllerTests
|
|||
Objects,
|
||||
playerGuid: () => Player,
|
||||
sendUse: Uses.Add,
|
||||
sendExamine: Examines.Add,
|
||||
sendUseWithTarget: (source, target) => UseWithTarget.Add((source, target)),
|
||||
sendWield: (item, mask) => Wields.Add((item, mask)),
|
||||
sendDrop: Drops.Add,
|
||||
|
|
@ -116,6 +118,38 @@ public sealed class ItemInteractionControllerTests
|
|||
Assert.Equal(new[] { (0x50000A01u, Player) }, h.UseWithTarget);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToolbarUse_withoutSelection_armsOneShotUseMode()
|
||||
{
|
||||
var h = new Harness();
|
||||
h.AddContained(0x50000A10u, item => item.Useability = ItemUseability.Contained);
|
||||
|
||||
Assert.True(h.Controller.UseSelectedOrEnterMode(0u));
|
||||
Assert.True(h.Controller.IsAnyTargetModeActive);
|
||||
Assert.Equal(InteractionModeKind.Use, h.Controller.InteractionState.Current.Kind);
|
||||
|
||||
Assert.Equal(ItemPrimaryClickResult.ConsumedSuccess,
|
||||
h.Controller.OfferPrimaryClick(0x50000A10u));
|
||||
Assert.Equal(new[] { 0x50000A10u }, h.Uses);
|
||||
Assert.False(h.Controller.IsAnyTargetModeActive);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ToolbarExamine_usesSelectionOrArmsOneShotExamineMode()
|
||||
{
|
||||
var h = new Harness();
|
||||
|
||||
Assert.True(h.Controller.ExamineSelectedOrEnterMode(Player));
|
||||
Assert.Equal(new[] { Player }, h.Examines);
|
||||
|
||||
Assert.True(h.Controller.ExamineSelectedOrEnterMode(0u));
|
||||
Assert.Equal(InteractionModeKind.Examine, h.Controller.InteractionState.Current.Kind);
|
||||
Assert.Equal(ItemPrimaryClickResult.ConsumedSuccess,
|
||||
h.Controller.OfferPrimaryClick(Pack));
|
||||
Assert.Equal(new[] { Player, Pack }, h.Examines);
|
||||
Assert.False(h.Controller.IsAnyTargetModeActive);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelfTarget_sendsUseWithTargetAndClearsTargetMode()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue