ScalarVector1 / DragonLens

Modern, customizable, and community-driven debugging and cheat mod for TModLoader
26 stars 14 forks source link

Use FixedUIScrollbar in Browser #8

Closed steviegt6 closed 1 year ago

steviegt6 commented 1 year ago

Resolves #7.

The Problem

UIGrid does not play nice with a regular Scrollbar.

The Solution

Use FixedScrollbar instead.

Notes

I had to make the choice between using Terraria.GameContent.UI.Elements.FixedUIScrollbar and Terraria.ModLoader.UI.Elements.FixedScrollbar. I opted for the vanilla type since that has actual official support. It seems that vanilla faced a similar situation in 1.4 that required this. Vanilla and tModLoader use identical logic in their implementations.

Furthermore, I made changes to the loading of SmartUIStates to expose their associated UserInterface as FixedUIScrollbar requires it.

ScalarVector1 commented 1 year ago

Looks good, please open an issue for https://github.com/ProjectStarlight/StarlightRiver to backport the loader changes to that project aswell