The Lua Noesis object model currently exposes property get/set, tree traversal (Find,
Child, VisualChild), event subscription, and command execution — but no way to
programmatically scroll a ScrollViewer/ListBox. I'd like to request one small addition:
ListBox::ScrollIntoView(item) (ideal), or alternatively a working scroll-offset setter on
ScrollViewer.
Use case:
My mod (CCNS — "CC Hair & Head Search", a character-creation QoL mod) https://github.com/Shiney1965/BG3-CC-Mod-Head-and-Hair
adds a search panel for the CC hair/head pickers. Applying a search result works assigning SelectedHair /
SelectedHead on the CC view-model), and the selection highlight renders — but the hair or head selection grid cannot be scrolled to the selected tile, so users must locate it manually in grids that are 40,000+ px
tall with 1,000+ modded entries. The mod already has the exact ListBoxItem container in hand;
the only missing piece is the scroll call.
What I verified doesn't work (SE v31, Patch 8, in-game)
ScrollViewer.VerticalOffset (via Lua property write):** the write is accepted and reads
back, but the view never moves, and the engine overwrites the value on the next real scroll —
it behaves as an output-only reflection of internal scroll state.
ls::LSScrollViewer.ScrollToElement (Larian's own scroll-to-element property, via Lua
property write):** accepted, no effect in the keyboard CC UI.
- The same two properties set from XAML** (a
b:ChangePropertyAction in a DataTemplate
trigger, i.e. through Noesis's own SetValue path — delivery verified by also writing a marker
value to the same target object and reading it back from Lua): marker lands, still no scroll.
Its only usage in shipped game XAML is a controller file (PreloadedActionRadials_c.xaml,
bound to gamepad FocusedElement), so it may be gamepad-focus-only machinery.
- There is no
ScrollIntoView / BringIntoView / Focus / ScrollToVerticalOffset in the
exposed method map (BG3Extender/GameDefinitions/PropertyMaps/UI.inl), and no occurrence of
ScrollIntoView anywhere in the repo.
So as far as I can tell, real user input (wheel / scrollbar / gamepad focus) is currently the only thing that can scroll these panels, and no Lua- or XAML-reachable channel works.
Proposed API (any one of these would solve it)
listBox:ScrollIntoView(item) — item as index, VM object, or ListBoxItem; maps to
Noesis::ListBox::ScrollIntoView.
element:BringIntoView() on FrameworkElement (raises RequestBringIntoView, lets the
nearest ScrollViewer handle it) — more general.
scrollViewer:ScrollToVerticalOffset(number) / ScrollToHorizontalOffset(number).
Thanks for SE — the rest of the mod (live VM reads, selection apply, loca-based labels) is built
entirely on it and works great.
The Lua Noesis object model currently exposes property get/set, tree traversal (
Find,Child,VisualChild), event subscription, and command execution — but no way toprogrammatically scroll a
ScrollViewer/ListBox. I'd like to request one small addition:ListBox::ScrollIntoView(item)(ideal), or alternatively a working scroll-offset setter onScrollViewer.Use case:
My mod (CCNS — "CC Hair & Head Search", a character-creation QoL mod) https://github.com/Shiney1965/BG3-CC-Mod-Head-and-Hair
adds a search panel for the CC hair/head pickers. Applying a search result works assigning
SelectedHair/SelectedHeadon the CC view-model), and the selection highlight renders — but the hair or head selection grid cannot be scrolled to the selected tile, so users must locate it manually in grids that are 40,000+ pxtall with 1,000+ modded entries. The mod already has the exact
ListBoxItemcontainer in hand;the only missing piece is the scroll call.
What I verified doesn't work (SE v31, Patch 8, in-game)
ScrollViewer.VerticalOffset(via Lua property write):** the write is accepted and readsback, but the view never moves, and the engine overwrites the value on the next real scroll —
it behaves as an output-only reflection of internal scroll state.
ls::LSScrollViewer.ScrollToElement(Larian's own scroll-to-element property, via Luaproperty write):** accepted, no effect in the keyboard CC UI.
b:ChangePropertyActionin aDataTemplatetrigger, i.e. through Noesis's own
SetValuepath — delivery verified by also writing a markervalue to the same target object and reading it back from Lua): marker lands, still no scroll.
Its only usage in shipped game XAML is a controller file (
PreloadedActionRadials_c.xaml,bound to gamepad
FocusedElement), so it may be gamepad-focus-only machinery.ScrollIntoView/BringIntoView/Focus/ScrollToVerticalOffsetin theexposed method map (
BG3Extender/GameDefinitions/PropertyMaps/UI.inl), and no occurrence ofScrollIntoViewanywhere in the repo.So as far as I can tell, real user input (wheel / scrollbar / gamepad focus) is currently the only thing that can scroll these panels, and no Lua- or XAML-reachable channel works.
Proposed API (any one of these would solve it)
listBox:ScrollIntoView(item)— item as index, VM object, orListBoxItem; maps toNoesis::ListBox::ScrollIntoView.element:BringIntoView()onFrameworkElement(raisesRequestBringIntoView, lets thenearest ScrollViewer handle it) — more general.
scrollViewer:ScrollToVerticalOffset(number)/ScrollToHorizontalOffset(number).Thanks for SE — the rest of the mod (live VM reads, selection apply, loca-based labels) is built
entirely on it and works great.