fix(ui): resolve retail spell slot background
Keep shared shortcut digit overlays separate from the per-ItemList background. Resolve the magic favorite list through its cross-layout inherited cell prototype and use the pinned brown/gold ItemSlot_Empty surface instead of the blue toolbar slot. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
e3605672bb
commit
09612f9981
9 changed files with 128 additions and 53 deletions
|
|
@ -25,10 +25,12 @@ public sealed class SpellcastingUiControllerTests
|
|||
uint[] regular = [101u, 102u, 103u, 104u, 105u, 106u, 107u, 108u, 109u];
|
||||
uint[] ghosted = [201u, 202u, 203u, 204u, 205u, 206u, 207u, 208u, 209u];
|
||||
uint[] empty = [301u, 302u, 303u, 304u, 305u, 306u, 307u, 308u, 309u];
|
||||
var graphics = new UiShortcutSlotGraphics(regular, ghosted, empty, 0x060074CFu);
|
||||
var digits = new UiShortcutDigitGraphics(regular, ghosted, empty);
|
||||
|
||||
using SpellcastingUiController controller = Bind(
|
||||
layout, spellbook, objects, _ => { }, shortcutGraphics: graphics)!;
|
||||
layout, spellbook, objects, _ => { },
|
||||
shortcutDigits: digits,
|
||||
emptySlotSprite: 0x06001A97u)!;
|
||||
|
||||
UiElement group = layout.FindElement(0x100000AAu)!;
|
||||
UiItemList list = Descendants(group).OfType<UiItemList>().First();
|
||||
|
|
@ -46,11 +48,15 @@ public sealed class SpellcastingUiControllerTests
|
|||
{
|
||||
UiCatalogSlot slot = Assert.IsType<UiCatalogSlot>(list.GetItem(i));
|
||||
Assert.True(slot.IsEmptySlot);
|
||||
Assert.Equal(0x06001A97u, slot.EmptySprite);
|
||||
Assert.Equal(i, slot.ShortcutNum);
|
||||
Assert.Same(empty, slot.ActiveDigitArray());
|
||||
}
|
||||
for (int i = 9; i < 13; i++)
|
||||
{
|
||||
Assert.Equal(0x06001A97u, list.GetItem(i)!.EmptySprite);
|
||||
Assert.Equal(-1, list.GetItem(i)!.ShortcutNum);
|
||||
}
|
||||
|
||||
var cast = Assert.IsType<UiButton>(
|
||||
layout.FindElement(SpellcastingUiController.CastButtonId));
|
||||
|
|
@ -222,7 +228,8 @@ public sealed class SpellcastingUiControllerTests
|
|||
ClientObjectTable objects,
|
||||
Action<uint> useItem,
|
||||
Action<int, int, uint>? addFavorite = null,
|
||||
UiShortcutSlotGraphics? shortcutGraphics = null)
|
||||
UiShortcutDigitGraphics? shortcutDigits = null,
|
||||
uint emptySlotSprite = 0u)
|
||||
{
|
||||
var casting = new SpellCastingController(
|
||||
spellbook, () => null, () => 1u, () => { }, _ => { }, (_, _) => { }, _ => { });
|
||||
|
|
@ -234,7 +241,8 @@ public sealed class SpellcastingUiControllerTests
|
|||
new SelectionState(),
|
||||
addFavorite ?? ((_, _, _) => { }),
|
||||
(_, _) => { },
|
||||
shortcutGraphics);
|
||||
shortcutDigits,
|
||||
emptySlotSprite);
|
||||
}
|
||||
|
||||
private static void ApplyAnchors(UiElement parent)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue