issues with smoothscroll-1.8.2
SmajloSlovakian opened this issue ยท 7 comments
Description
smoothscroll is a mod made by me... recently, an issue was reported to me with this and my mod's compatibility...
there are two issues:
- my mod doesn't know about the shifting of the chat position and incorrectly applies rendering mask - you can see that by counting the visible line count or by looking at the lowest lines while scrolling.
- when opening/focusing chat, it somehow instantly scrolls up and then smoothly scrolls down.
video:
https://github.com/SmajloSlovakian/Minecraft-Smooth-Scrolling/assets/135575164/5e6be236-5cca-44e6-abf6-bd46ea9e91b4
Specs and Details
Required information:
- Minecraft version: 1.20.4
- Mods: smoothscroll 1.8.2, chat patches 204.6.1, fabric api 0.91.3, YACL 3.3.1
Additional context
i already fixed the first issue on my and on your end on my machine and i will make a pull request now... but i don't know how to fix the second issue
i'm not super familiar with rendering and animations yet, so to be honest idk what the issue is either. i can look in a few days but idk about any of this to be honest...
also please move the request to the 1.20.4 branch if you can, i need to review both changes and a lot of things have changed between the two versions so i'm not 100% sure the fix will apply to both simultaneously. thanks for the super detailed report!
so basically my mod works just by having a scrolloffset value. i hijack some methods, which change the scrolledlines value and add the change into the offset and cancel the scrolledelines change. every frame, i divide the scrolloffset by a number in the head of the render method and i also change the scrolledlines value so it aligns with the offset and then i change it back in the tail. i also change the y position of every line by a number corresponding to the offset... this isn't a perfect explanation but it will do...
so what you have somewhere is that you somehow change the scrolledlines value to maximum (as if it was scrolled all the way up) without my mod noticing and then you change it back to 0 with my mod noticing...
to that pull request, it should work fine but i will do as you say...
okay cool, thanks for the explanation! according to my memory, the only changes i make to the scrolled lines are from my config's shiftChat option, and when the game loads the chat log for the first time it changes their received time (so it doesn't look like you just got a ton of messages). maybe those are messing it up somehow?
ok so i fixed it in my mod by not changing the offset when refresh is called...
hmm... it seems that when i open chat, it calls addmessage some amount of times... when addmessage is called, my mod doesn't instantly scroll down, instead it smoothly scrolls down (for every line it adds 9 pixels to the offset and leaves the scrolledlines untouched)... so that means that there's the issue somewhere... there also appears that resetscroll gets called 2 times (not at the same time but at the same frame - when opening chat)
awesome! i seriously appreciate all the work you've been doing to fix this ๐