feat(chargen): Campaign CC slice CC6b-MOUNT — Appearance page + preview mount

The page-mount half CC6b-PRE deferred: CharacterCreationAppearancePage
(gender buttons, Face/Clothes sub-tabs, nine spin controls with retail's
decrement/increment/select-as-current-part OnClickAt zones, nine color
swatches, shade scrollbar, zoom/rotate wiring) plus ChargenPreviewController,
which bridges the ChargenPreviewRenderer/ChargenPreviewZoomController
camera-injection gap CC6a/CC6b-PRE left open and mounts as the third private
creature viewport beside paperdoll/creature-appraisal.

Color-wheel scouting (campaign risk item 4): live-DAT probe found every
color-wheel-family id resolves through existing DatWidgetFactory mappings
(Button/Scrollbar/generic fallback) — no new widget type needed.

The @140355 gender-flip-on-init oddity (risk item 5): resolved via decomp
alone — gmCharGenMainUI's own ctor calls CharGenState::RandomizeCharacter
before any page constructs, so retail's chargen screen is never actually
blank on open; the Appearance page's gender-flip code always fires against
a real, randomly-rolled gender. Filed AP-214 (acdream doesn't port
RandomizeCharacter this round, so it opens honestly blank instead) and
AP-215 (two narrow visual substitutions: swatch .Selected highlight vs
retail's separate overlay, ordinal labels vs retail's icon-only spins).

AD-101 retired: the Heritage page's auto-gender-select interim default is
deleted now that the Appearance page's real gender buttons exist. TS-82
narrowed to Summary-only.

Scope addendum: ChargenPreviewRotationController's parameterless-constructor
default changes from 0f to a new RetailDefaultHeadingDegrees=180f constant
(retail's InitializePage override, not the ctor's raw 0) — every real
gmCG3DView owner converges on 180 before its first frame, so a controller
defaulting to 0 was a trap for future consumers.

Runtime 1713/0, Core 4786/1 skip, Content 147/0, App 5220/3 skips (Release,
ACDREAM_PROBE_LIVE_MOUNT=1) — zero failures across two clean full-solution
runs; the one Core.Net.Tests NakEmissionTests flake observed on a third run
is the same pre-existing, previously-documented timing flake (zero files
under src/AcDream.Core.Net/ touched, passes 100% in isolation).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-15 21:00:10 +02:00
parent 11374484dc
commit 34c6fceab0
20 changed files with 2109 additions and 57 deletions

View file

@ -11,10 +11,32 @@ namespace AcDream.App.Tests.Rendering;
/// </summary>
public sealed class ChargenPreviewRotationControllerTests
{
/// <summary>
/// CC6b-MOUNT: retail's OPERATIVE starting heading is 180, not the ctor's
/// raw 0 — <c>gmCGAppearancePage::gmCGAppearancePage @0x0047CDAC</c> sets
/// <c>m_fCurHeading = 0f</c>, but <c>InitializePage @0x0047FDD0</c> always
/// runs immediately afterward (before the page is ever visible) and
/// overrides it to <c>180f</c> at <c>0x00480235</c>, pushed via
/// <c>SetPlayerHeading</c> at <c>0x0048023F</c>. No player-visible chargen
/// Appearance frame is ever rendered at 0°. This is the seam a real mount
/// site experiences (the parameterless constructor), pinned here so a
/// future consumer can't silently regress to facing the character away
/// from the camera. See <see cref="ChargenPreviewRotationController.RetailDefaultHeadingDegrees"/>
/// for the full citation, including the cross-confirming
/// <c>gmCGSummaryPage</c>/<c>gmBarberUI</c> sibling call sites.
/// </summary>
[Fact]
public void DefaultConstructor_StartsAtRetailsOperative180DegreeHeading()
{
var controller = new ChargenPreviewRotationController();
Assert.Equal(180f, controller.HeadingDegrees);
}
[Fact]
public void Toggle_StartsRotatingInTheGivenDirection()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
Assert.True(controller.IsRotating);
@ -24,7 +46,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Toggle_SameDirectionWhileRotating_Stops()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Toggle(ChargenRotateDirection.Clockwise);
@ -34,7 +56,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Toggle_OppositeDirectionWhileRotating_SwitchesDirectionAndKeepsRotating()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Toggle(ChargenRotateDirection.CounterClockwise);
@ -45,7 +67,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Tick_WhileNotRotating_IsANoOp()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Tick(100.0);
Assert.Equal(0f, controller.HeadingDegrees);
@ -57,7 +79,7 @@ public sealed class ChargenPreviewRotationControllerTests
// Rotate() invalidates m_dLastRotateTime so the very first DoRotation
// tick resets it to "now" rather than computing a huge jump from a
// stale/never-set timestamp.
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Tick(1000.0);
@ -71,8 +93,10 @@ public sealed class ChargenPreviewRotationControllerTests
// Seed "now" nonzero (0.0 collides with the <= 0 reset-if-invalid
// guard, same as retail's own sentinel check would if Timer::cur_time
// could ever read exactly zero — never in practice, so tests avoid
// it too).
var controller = new ChargenPreviewRotationController();
// it too). Explicit 0f baseline keeps the relative-delta assertion
// below simple; the retail-default seam has its own dedicated test
// above.
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Tick(10.0); // seeds lastRotateTime = 10, zero delta.
controller.Tick(11.5); // half a revolution at 3 s/rev.
@ -83,7 +107,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Tick_CounterClockwiseAdvance_SubtractsAndWrapsPositive()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.CounterClockwise);
controller.Tick(10.0);
controller.Tick(11.5); // would go to -180, wraps to +180.
@ -94,7 +118,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Tick_AccumulatesAcrossMultipleTicks()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Tick(10.0);
controller.Tick(10.5); // +60 deg.
@ -113,7 +137,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void Tick_ClockwiseAdvancePast360_ClampsBackBySubtracting360()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
controller.Toggle(ChargenRotateDirection.Clockwise);
controller.Tick(10.0); // seeds lastRotateTime = 10, zero delta.
controller.Tick(10.0 + 3.5); // 3.5s at 3s/rev = 420 deg -> 420, clamped to 60.
@ -124,7 +148,7 @@ public sealed class ChargenPreviewRotationControllerTests
[Fact]
public void ToOrientation_AtZeroHeading_IsIdentity()
{
var controller = new ChargenPreviewRotationController();
var controller = new ChargenPreviewRotationController(0f);
Quaternion orientation = controller.ToOrientation();
Assert.Equal(Quaternion.Identity.X, orientation.X, 4);