fix(ui): unify target-mode primary clicks
This commit is contained in:
parent
b7e7ca9ee2
commit
eb6229394a
12 changed files with 176 additions and 25 deletions
|
|
@ -84,6 +84,32 @@ public sealed class ItemInteractionControllerTests
|
|||
Assert.Empty(h.UseWithTarget);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void PrimaryClickRouter_distinguishesInactiveSuccessAndConsumedRejection()
|
||||
{
|
||||
var h = new Harness();
|
||||
h.AddContained(0x50000A01u, item =>
|
||||
{
|
||||
item.Useability = HealthKitUseability;
|
||||
item.TargetType = (uint)ItemType.Creature;
|
||||
});
|
||||
h.AddContained(0x50000A02u, item => item.Type = ItemType.Armor);
|
||||
|
||||
Assert.Equal(ItemPrimaryClickResult.NotActive,
|
||||
h.Controller.OfferPrimaryClick(Player));
|
||||
|
||||
h.Controller.ActivateItem(0x50000A01u);
|
||||
Assert.Equal(ItemPrimaryClickResult.ConsumedRejected,
|
||||
h.Controller.OfferPrimaryClick(0x50000A02u));
|
||||
Assert.False(h.Controller.IsTargetModeActive);
|
||||
|
||||
h.Now += 200;
|
||||
h.Controller.ActivateItem(0x50000A01u);
|
||||
Assert.Equal(ItemPrimaryClickResult.ConsumedSuccess,
|
||||
h.Controller.OfferSelfPrimaryClick());
|
||||
Assert.Equal(new[] { (0x50000A01u, Player) }, h.UseWithTarget);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void SelfTarget_sendsUseWithTargetAndClearsTargetMode()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue