feat(items): port retail shared cooldown overlays
Preserve public shared-cooldown metadata, resolve the authoritative cooldown enchantment with retail expiry semantics, and project the exact ten DAT-authored radial steps through the shared retained item-slot architecture. Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
parent
19e8863f4e
commit
6b1ae4fb76
27 changed files with 875 additions and 20 deletions
|
|
@ -194,4 +194,36 @@ public class UiItemSlotTests
|
|||
|
||||
[Fact]
|
||||
public void CapacityFrontSprite_default() => Assert.Equal(0x06004D23u, new UiItemSlot().CapacityFrontSprite);
|
||||
|
||||
[Fact]
|
||||
public void ActiveCooldownSprite_selects_the_exact_one_based_step()
|
||||
{
|
||||
uint[] sprites =
|
||||
[
|
||||
0x06000001u, 0x06000002u, 0x06000003u, 0x06000004u, 0x06000005u,
|
||||
0x06000006u, 0x06000007u, 0x06000008u, 0x06000009u, 0x0600000Au,
|
||||
];
|
||||
var slot = new UiItemSlot
|
||||
{
|
||||
CooldownSprites = sprites,
|
||||
CooldownStepProvider = id => id == 0x5001u ? 6 : 0,
|
||||
};
|
||||
slot.SetItem(0x5001u, 99u);
|
||||
|
||||
Assert.Equal(0x06000006u, slot.ActiveCooldownSprite());
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void ActiveCooldownSprite_isHidden_for_empty_or_inactive_slot()
|
||||
{
|
||||
var slot = new UiItemSlot
|
||||
{
|
||||
CooldownSprites = Enumerable.Range(1, 10).Select(i => (uint)i).ToArray(),
|
||||
CooldownStepProvider = _ => 0,
|
||||
};
|
||||
|
||||
Assert.Equal(0u, slot.ActiveCooldownSprite());
|
||||
slot.SetItem(0x5001u, 99u);
|
||||
Assert.Equal(0u, slot.ActiveCooldownSprite());
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue