Ludeon Forums

RimWorld => Mods => Help => Topic started by: kwang4 on July 19, 2021, 07:42:35 PM

Title: [Solved] 1.3 ListingStandard Scroll issue
Post by: kwang4 on July 19, 2021, 07:42:35 PM
So it looks like for 1.3, they removed listingStandard.BeginScrollView and EndScrollView. It's pretty easy to just reimplement BeginScrollView, but EndScrollView does some witchcraft with some protected variables (Listing.listingRect and listing.curY) Is there a new way to do scrolling views as simply as in 1.2? My current settings window has just a  tad too many things to completely fit without scrolling.
Title: Re: [Solved] 1.3 ListingStandard Scroll issue
Post by: Napoleonite on July 21, 2021, 05:14:57 AM
I would also like to know this since most of my mods broke exactly because of this.
Title: Re: [Solved] 1.3 ListingStandard Scroll issue
Post by: kwang4 on July 21, 2021, 08:34:02 AM
I looked at the old 1.2 assemblies, and essentially copied the beginScrollView and EndScrollView methods.

  public override void DoSettingsWindowContents(Rect inRect)
        {
            Listing_Standard listingStandard = new Listing_Standard();
            Widgets.BeginScrollView(inRect, ref scrollPos, scrollRect);
            inRect.height = 100000f;
            inRect.width -= 20;
            scrollRect = new Rect(0f, 0f, inRect.width, listingStandard.CurHeight+100);

            //Actual ui stuff here

            Widgets.EndScrollView();
            listingStandard.End();

            base.DoSettingsWindowContents(inRect);

        }