Migrate the Wear window to shared XML/Lua UI
Goal: replace Wear's C# presentation with a bundled XML/Lua package, preserving the current player-visible layout, equipment interactions and window lifecycle. Implemented and verified from develop, then committed with explicit /open-pr permission as 6de1c1d00 (feature: Migrate Wear to shared Lua UI) on feature/client-lua-wear. Branch pushed with upstream; working tree clean. User subsequently confirmed the migrated window works correctly in the client. PR #2810 merged: https://git.project-rk.com/prk/engines/pulls/2810 (feature/client-lua-wear → develop). User confirmed the merge and successful validation on all platforms. Work is complete. Wear now uses UI/Packages/Wear and ScriptedWearWindow; legacy WearPresenter/layout route removed. Core icon cells can adopt fixed XML views without reparenting, preserving labels and implant gaps. Native equipment/input/transaction ownership is unchanged. Lua owns tabs, fixed frame policy, presentation and selection feedback; generated Wear projection reuses native semantic equipment-location reference types. Verified outcomes: initial binding/presentation tests observed red then green. Three mutation controls independently trigger failures for removing selection, tab-gesture invalidation and fixed-content centering; all restored before final suites. Final full client run with warnings-as-errors: 4092 passed, 161 skipped, zero failures. Graphics: 713 passed, 1 skipped. Final ./run-client-lua-tests.sh: native Release 8/8, ASan/UBSan 8/8, generator self-tests, bridge AOT and UI AOT including actual Wear package/generated projections all pass. Wear package AOT exercises facts, empty bindings, ammo/availability/selection, real tab input, fixed geometry and teardown; it does not source-link the full native Wear adapter or claim full-client AOT publishing. Unchanged adapter updates allocate zero managed bytes in the warmed 1000-update regression. Essential native input regressions cover equip/unequip, click-carry/drag, hidden-page press revocation, tooltips/replacement, script errors and authoritative model survival. Persistence/session test covers saved placement/pin, fixed size, close/Escape, session hide/reopen and notification flushing without changed facts. Rendered all four tabs with installed art; fresh outputs visually inspected after preserving fixed content centering. The first AOT pass caught a harness mounting the frame as the viewport root; corrected to use a production-style window layer. Initial full GUI-assets run exposed four character-creation fixture failures because the standard runner mounts only the GUI subtree, omitting sibling text databases; rerunning with the complete installation mounted read-only and GUIROOT pointing inside it passes all four and the full suite. No unrelated tests/code were altered or disabled. Static patch review completed across all 21 changed diffs with no actionable findings. git diff --check passes. Evidence: .dev-data/wear-validation/ contains red/green, mutation, targeted, full-client, graphics, final native/AOT logs and inspected rendered PNGs. Full-client reproduction: prk-client-tests:10.0 container with repository at /src, nuget cache /nuget, results /test-results, full installation mounted read-only at /game and PRK_GUIROOT=/game/cd_image/gui/Default; dotnet test PRK.Client/PRK.Client.Tests/PRK.Client.Tests.csproj --results-directory /test-results --nologo --verbosity minimal -m:1 -p:TreatWarningsAsErrors=true -p:WarningsNotAsErrors=NU1903. PRK_INSTALL_ROOT/PRK_DATAROOT not set, so other install-dependent cases remain skipped. Automated validation did not include a manual live-game session; user subsequently confirmed correct client behavior before PR publication. User subsequently confirmed successful validation on all platforms after merge, superseding the earlier platform-validation gap. A separate new full-client NativeAOT publish was not claimed. Baseline: inventory-container migration 564157eb2 (#2808), shared icon-grid lifecycle 7d66cd1b6 (#2806), and Stats/NCU/Nano migrations 6626be885 (#2805). Relevant code: PRK.Client/PRK.Client/UI/Windows/WearPresenter.cs, UI/Layouts/Wear.xml, UI/CharacterInterface.cs (BuildWear, equipment model update and inspection), UI/Windows/ScriptedItemContainerWindow.cs, UI/Packages/Core/{window,icon_grid}.lua and UI/ItemInputBindings.cs. Existing tests: WearWindowTests, ClientWeaponAmmoTests, UiPresenterTests and ItemInteractionTests. Ownership: Lua owns window/frame composition, fixed sizing policy, tab selection/visibility, slot layout and visual state. C# retains ItemContainer equipment facts, resource ownership, availability/ammo knowledge, tooltips/inspection backends, native input/cursor state and validated equipment transactions. Use LuaUiComponent/LuaWindowServices and generated domain-owned contracts; batch fact projection and bypass unchanged updates without managed allocation. Continue refreshing native lifecycle notifications even when facts do not change. Reuse ItemInputBindings/ItemInputSurface semantic references and leases rather than locating canonical items by rendered widgets. Acceptance: - Preserve Weapons, Clothing, Implants and Social tabs, all 58 equipment slots, labels/order, anatomical implant gaps and selected-tab hit/render behavior. Empty valid slots remain exact equipment targets; decorative gaps do not become targets. - Preserve icons, stack fallback, known weapon rounds (including ammo-only updates and solar-powered exclusion), skill-lock countdown/fading, over-equipment tint and native carry/selection feedback. Item removal/replacement clears stale presentation. - Preserve native equip/unequip, click-carry/drag/drop, right-click behavior and inspection. A tab click must not activate equipment; hidden/tab-switched/replaced/faulted views cannot authorize stale gestures or retain tooltips. - Preserve Wear window identity, initial placement/fixed sizing, saved placement/open/pin state, close/menu/Escape preference and session transitions. - Script failure shows the established diagnostic and disables/releases presentation/input/callbacks without reviving a C# Wear presenter or destroying the authoritative equipment model. Borrowed icons remain native-owned. - Remove WearPresenter and the legacy Wear layout path after migration. Retain GuiTabGroup and ItemSlotCollection where other native consumers still require them. Reuse/refactor constraints: prefer shared Core.Window and compatible Grid.cells lifecycle. Wear's labeled anatomical slots and noninteractive gaps differ from Inventory; extend shared cell presentation narrowly where useful, rather than copying a reconciliation engine or forcing Wear into Inventory grid/list policies. Share native projection helpers only when semantics/lifetime actually match; do not create another input/transaction layer. No major architecture refactor expected. No new gameplay, list mode, addon/reload framework or stock-binary-derived material. Validation: establish player-visible baseline/regression cases before implementation, show new essential tests failing then passing against the real scripted component and native input. Cover tabs/empty targets, equipment transactions, inspection/tooltips, selection, ammo/availability updates, stale gestures and failure/teardown. Run targeted and full client tests, relevant graphics tests, warnings-as-errors build and ./run-client-lua-tests.sh (generator, native/sanitizers and AOT acceptance). Verify Wear's own packaged component under NativeAOT rather than treating existing Actions smoke as Wear proof. Review rendered tabs with installed art and exercise live session/window transitions when available; report fixture/platform/full-client-publish limitations explicitly. No tests executed during planning.
Checklist
5 of 5 complete- Establish Wear parity cases using real layout/input: tabs, anatomical slots and empty targets, equipment transactions, tooltips/inspection, selection and ammo/availability.
- Implement the Wear XML/Lua package with shared window/cell patterns, Lua-owned tabs and visuals, and a thin typed native fact/resource adapter over existing equipment/input models.
- Integrate Wear with native window persistence, Escape/session lifecycle and equipment interaction feedback; verify stale gestures, tooltip release and script-failure teardown.
- Remove the C# Wear presenter and legacy layout route; retain shared native helpers needed by other windows and update affected package documentation/tests.
- Pass red/green behavior regressions, client/graphics validation, warnings-as-errors build and Lua/generator/native/AOT checks including Wear component coverage; review rendered/live behavior and record unavailable platform/fixture checks.
- Area
- Project Rubi-Ka
- Project
- engines
- Kind
- Feature
- Task ID
tsk_6ncx5xnkgb- Updated