feat(D.2b): Slice 2 — paperdoll armor/non-armor partition + Slots toggle state
Adds ArmorSlotElementIds (the exact 9 ids gmPaperDollUI::ListenToElementMessage flips per decomp 175674-175706) and PaperdollViewState (SlotView/DollVisible/ ArmorSlotsVisible/Toggle) as a nested public class on PaperdollController. Wires ApplyView() into the constructor so the Slots button (0x100005BE) drives armor-slot Visible and the doll viewport Visible on every click. Initial state is doll-view (armor slots hidden). The doll viewport element (0x100001D5) is bound as UiElement? so this slice stays independent of Slice 3's IUiViewportRenderer seam; _armorSlots collects whichever of the 9 ids were found in the live layout. Three new unit tests verify the id set, the default state, and the round-trip toggle against the public PaperdollViewState surface only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
1c7f20fd08
commit
c5604ff6ad
2 changed files with 97 additions and 0 deletions
44
tests/AcDream.App.Tests/UI/Layout/PaperdollToggleTests.cs
Normal file
44
tests/AcDream.App.Tests/UI/Layout/PaperdollToggleTests.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using AcDream.App.UI.Layout;
|
||||
using Xunit;
|
||||
|
||||
namespace AcDream.App.Tests.UI.Layout;
|
||||
|
||||
public class PaperdollToggleTests
|
||||
{
|
||||
// The 9 armor element-ids that gmPaperDollUI::ListenToElementMessage flips
|
||||
// (decomp 175674-175706). Doll-view hides these; slot-view shows them.
|
||||
private static readonly uint[] ArmorIds =
|
||||
{
|
||||
0x100005abu, 0x100005acu, 0x100005adu, 0x100005aeu, 0x100005afu,
|
||||
0x100005b0u, 0x100005b1u, 0x100005b2u, 0x100005b3u,
|
||||
};
|
||||
|
||||
[Fact]
|
||||
public void ArmorSlotIds_match_the_decomp_nine()
|
||||
{
|
||||
Assert.Equal(ArmorIds, PaperdollController.ArmorSlotElementIds);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void DollView_default_shows_doll_hides_armor()
|
||||
{
|
||||
var v = new PaperdollController.PaperdollViewState();
|
||||
Assert.False(v.SlotView);
|
||||
Assert.True(v.DollVisible);
|
||||
Assert.False(v.ArmorSlotsVisible);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Toggle_to_slotview_hides_doll_shows_armor_and_back()
|
||||
{
|
||||
var v = new PaperdollController.PaperdollViewState();
|
||||
v.Toggle();
|
||||
Assert.True(v.SlotView);
|
||||
Assert.False(v.DollVisible);
|
||||
Assert.True(v.ArmorSlotsVisible);
|
||||
v.Toggle();
|
||||
Assert.False(v.SlotView);
|
||||
Assert.True(v.DollVisible);
|
||||
Assert.False(v.ArmorSlotsVisible);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue