OpenTPW

UI-901: HUD happiness gauge texture response#

Status and bounded scope#

The original plan-only proposal is now a bounded implementation based on static source evidence. The custom red/yellow/green rectangle has been replaced with the original vertical meter's cropped image halves. UI-901 remains open for actual rendered shell/meter composition and alpha verification. Independent code review and exact-head CI are required before merge. Original-runtime or pixel parity is not claimed. The historical proposal progress entry is preserved unchanged.

Traced HUD binding#

Static inspection did not run or emulate the original executable. Original textures and binary excerpts stay private; no original media, hashes or disassembly are included in this change.

Rendering contract#

Clamp raw value to 0..1024; let q = value/1024 and split = y + height × (1-q). The empty top region samples the right texture half, UV (0.5,0)-(1,1-q). The filled bottom region samples the left texture half, UV (0,1-q)-(0.5,1). Both regions crop upright art at the same boundary; neither stretches a whole half into its region. White vertex tint preserves the image's colours and alpha. Zero-height quads are omitted by UiBatch. Null mean uses raw0 and still draws the empty half. No host red/yellow/green colour calculation remains.

The runtime loads /ui/textures/meter.wct through the existing image/texture-pack pipeline. Missing or malformed images follow UiRenderer's warn-once/skip path; no substitute graphic is added. No new normal/small texture selection, filtering, shader or depth policy is introduced.

The shared UiVerticalGauge body is extracted unchanged from ResearchCapacityGauge.DrawGauge, with an explicit texture path. Its research wrapper and /ui/textures/effortguage.wct ArtPath remain; the staffing limit still supplies its value. UI-064 input/state and startup geometry are unchanged.

Sampling and layout#

The existing two-second sampling, byte-truncated in-park mean, closed-park behavior and raw-value calculation are unchanged. Mean50 still maps to511; mean100 still maps to1023, leaving a small empty strip. The child is 59×224 inside the 96×265 shell, with insets 18/20/19/21. Both use BottomLeft once; no parent offset or second scale is applied. Widescreen anchoring remains host layout policy. Shell help477 is retained, but its actual tooltip dispatch is not established by storing Help: UiModelImage is nonfocusable and existing generic hit testing selects focusable elements only. Tooltip routing is explicitly outside this drawing patch.

Verification and remaining work#

Source: docs/proposals/ui-901-trace-happiness-gauge-model-response.md in the project repository.