[Solved] 1.3 ListingStandard Scroll issue

Started by kwang4, July 19, 2021, 07:42:35 PM

Previous topic - Next topic

kwang4

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.

Napoleonite

I would also like to know this since most of my mods broke exactly because of this.

kwang4

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);

        }