LibGui
LibGui copied to clipboard
Animated WSprite never displays the last frame
Describe the bug WSprites with multiple frames never render the last frame.
To Reproduce Steps to reproduce the behavior:
- Create a WSprite with an animation.
- Look at it.
Version of the (please complete the following information):
- Mod: 5.2.0+1.18
- Fabric API: 0.44.0+1.18
- Minecraft: 1.18.1
Additional context This may be caused by the following if statement: https://github.com/CottonMC/LibGui/blob/bfdde6ea3623783f1c87b14fad76b6d4c465aeab/src/main/java/io/github/cottonmc/cotton/gui/widget/WSprite.java#L205 It goes back to the 0th frame immediately if the currentFrame is the last frame, rather than one greater than the last frame.