fix #380: Chat tab opacity sliders were missing their retail row captions

Root cause: PlayerOptionPage::AddSliderOption never sets a row's own
name-label text — the "Inactive Opacity"/"Active Opacity" caption comes
from a SEPARATE DAT-resident runtime catalog (DID 0x78000000, resolved
via the same two-level DBCache::GetDIDFromEnumStatic master-map/submap
lookup ChatOptionsDatDefaults already uses for enum 0x16/category 2,
here for enum 0x15/category 2) that nothing in the codebase ever
queried, so both slider rows rendered with no caption at all.

Fix: new ChatOptionsDatCaptions.TryRead resolves the DID-0x78000000
catalog's per-property name/tooltip entries (matched by the same
owning-property enum ChatOptionsDatDefaults already keys its defaults
by) and ChatOptionsPageController.BuildOpacitySliders stamps each
slider's own row caption/tooltip from it — falling back to no text
(never invented English) if resolution fails. Regressed by
ChatOptionsPageControllerTests.
Bind_WiresEachSlidersOwnRowCaption_FromTheResolvedDatCatalog and the
companion Bind_MissingCaption_RendersNoText_NeverInventsEnglish case,
plus a live-mount probe (OptionsPanelLiveMountProbeTests.
ProbeChatOpacityCaptions) confirming the production TryRead call
resolves "Inactive Opacity"/"Active Opacity" against the real DAT.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Erik 2026-08-11 23:01:22 +02:00
parent c0b3d8f233
commit 2a248c0d48
8 changed files with 415 additions and 10 deletions

View file

@ -2126,6 +2126,22 @@ public sealed class RetailUiRuntime : IDisposable
+ "constructor values (0.5/1.0).");
}
// #380: the two sliders' row CAPTIONS ("Inactive Opacity" /
// "Active Opacity") + tooltips — a SECOND, sibling DAT catalog
// lookup (DID 0x78000000, not the 0x78000001 defaults catalog
// above) — see ChatOptionsDatCaptions' own doc for the byte
// trace. Resolved once, same shape as the defaults read above.
if (!Layout.ChatOptionsDatCaptions.TryRead(
_bindings.Assets.Dats, strings,
out Layout.ChatOptionsDatCaptions.Caption defaultOpacityCaption,
out Layout.ChatOptionsDatCaptions.Caption activeOpacityCaption))
{
Console.WriteLine(
"[UI] options panel: Chat tab opacity slider captions did not resolve "
+ "(DID 0x78000000) — rows render with no caption rather than invented "
+ "English.");
}
bool chatBound = Layout.ChatOptionsPageController.Bind(
layout,
controller.ChatPage,
@ -2153,6 +2169,8 @@ public sealed class RetailUiRuntime : IDisposable
FlushOpacity: SaveChatOpacity,
DefaultOpacityDatDefault: datDefaultOpacity,
ActiveOpacityDatDefault: datActiveOpacity,
DefaultOpacityCaption: defaultOpacityCaption,
ActiveOpacityCaption: activeOpacityCaption,
CurrentFilter: windowId => _bindings.Chat.Windows.GetFilter(windowId),
SetFilter: (windowId, value) =>
{