Annosz / UIInfoSuite2

Ongoing maintenance for the original UI Info Suite mod for Stardew Valley.
1.33k stars 262 forks source link

Implementation of Issue 479 (EXP bar and pop ups work with mastery) #568

Open djuniah opened 2 weeks ago

djuniah commented 2 weeks ago

I had found this issue/feature request (I came here looking to make the same request): https://github.com/Annosz/UIInfoSuite2/issues/479

and decided to try and implement it myself. This bit of code should get the XP text over the player's head functioning past level 25 (which is apparently what the game code considers max overall level before mastery). It also implements the other portion of the feature request about the graph showing progress on the current mastery Level.

There are 3 things I wanted to note that are still "TODO" items: 1) I tried making the color of the bar match the color that was used on the mastery progress bar in the main UI but i can't seem to get the color right no matter what I do. It seems to be over-saturating anything I put in. 2) UI Info suite seems to have some way of accessing the game's icons through a rect based system (I assume tied to a sprite sheet). I don't know where this sheet is or what the coordinates would be for a "star" icon, so i used the luck icon for now since that was already implemented and is currently unused. 3) Due to the amount of EXP needed for mastery levels, it overflows the bar quite easily. I tried bumping up the "MaxBarWidth" value in DisplayedExperienceBar.cs but it didn't seem to affect anything. I have noticed it overflowing during normal gameplay before, so i'm not sure if this is a dealbreaker for this pull request or not.

djuniah commented 2 weeks ago

Ok, i actually addressed all 3 of those issues in my main comment in my latest commit: https://github.com/djuniah/UIInfoSuite2/commit/6a0708f5bb07ed6af77c0f59eaf9b6be05134f71

The only potential issue i could see is that I made the exp bar a little wider. I don't know if the old size was chosen for any particular reason (to work on mobile for example), but it wasn't wide enough to hold the larger XP numbers that the mastery system uses. Otherwise, I tested it a bit and it seems to be working fine.

EDIT: One other thing i wanted to note. I ran into an issue with the color of the bar where it was showing up incorrectly (usually a super bright green or teal no matter what values i had in there. Turns out that the color values were being treated as floats which uses the constructor with values that go from 0->1 instead of the int constructor which has values go from 0->255. It might be worth looking into the old color values to make sure that they're actually rendering as intended. Might be an old bug in the mod.