Ludeon Forums

RimWorld => Mods => Help => Topic started by: LWM on April 25, 2021, 10:43:27 PM

Title: Nested Scroll windows?
Post by: LWM on April 25, 2021, 10:43:27 PM
Hey, everyone!  UI question here:

I have a Listing_Standard with a ScrollView, and inside that scroll view I get a Rect and inside that Rect I do the ThingFilter UI.  The problem is that the ThingFilter's scroll bars do not appear!  Only the ScrollView scroll bars appear...

Does anyone know if this problem will go away if I rewrite everything without the Listing_Standard?
Title: Re: Nested Scroll windows?
Post by: LWM on April 26, 2021, 02:21:45 AM
Answer: it works when it's not a ThingFiter UI (with scroll bars) inside a Listing_Standard.

I got around the problem by using something like this:
Code: [Select]
Widgets.ScrollView(...);//use height to make Rects
var l = new Listing_Standard();
l.Begin(innerRect);
...
height=l.CurHeight; //height is an object field
l.End();
var filterRect = new Rect(...);
ThingFilterUI.DoThingFilterConfigWidnow(...);
Widgets.EndScrollView();
It works for now, anyway :)  But listing standards seem hard to use if you want to do anything slightly complicated.  :P
Title: Listing_Standard no longer has ScrollView; fix
Post by: LWM on July 12, 2021, 03:31:54 PM
For 1.3, Listing_Standard no longer has a scroll view, so this workaround is a general way to fix any mod that use Listing_Standard's BeginScrollView &c.