BrandenEK / Blasphemous.Framework.Penitence

Framework that allows other mods to implement custom penitences
4 stars 1 forks source link

Add scroll view to Abandon Penitence widget when text area overflows #9

Closed NeonPixels closed 2 months ago

NeonPixels commented 2 months ago

As reported on issue #2 , when the description of a custom penitence is too long, the text box in the Abandon Penitence widget will overflow, breaking the screen format.

This fix adds a functional scroll view element that will allow scrolling the text if needed. Additionally, the Abandon Penitence widget text box is made larger by default, since it originally was made too small and did not take advantage of the available space.

The new positions and dimensions have been determined using the Unity editor:

AbandonPenitence_PRSCR01 AbandonPenitence_PRSCR02 AbandonPenitence_PRSCR03

NeonPixels commented 2 months ago

Note: This feature is ignored when selecting the base game penitences, but I suspect that when using large fonts, like the Asian character sets, even the default texts might overflow the text box, so a future improvement could be to apply this fix to all penitences, mod or not.

NeonPixels commented 2 months ago

Latest commit applies the improvement commented above. The decision to display the scroll view has been moved to a postfix, so when selecting base game penitences with fonts that overflow the text box, the scroll will still display, as seen below with the Bleeding Heart penitence:

AbandonPenitence_JpScroll

NeonPixels commented 2 months ago

Last commit fix a corner case. When a penitence description requires a scrollbar in one language, and not in other, changing languages would cause the description to not update properly until the altar was accessed a couple times. This was due to the scroll view object being disabled from the previous iteration, and thus not getting the content updated properly.

BrandenEK commented 2 months ago

After some basic testing, this seems to function perfectly. Very nice work!