terrarium-earth / Tempad

Bringing the Loki time door to Minecraft 1.18+
Other
25 stars 12 forks source link

[Bug]: Scrolling with mouse wheel breaks list order #92

Closed ghost closed 10 months ago

ghost commented 10 months ago

Bug Description

if you have 12 location saved in the tempad, when you save a new location then re-open the tempad, if you scroll with the mouse wheel to go lower, the list order breaks. it seens to have no type of order since they are no correlation with the locations. test1 test1

How to Reproduce?

  1. get 12 location on tempad
  2. add new location
  3. re-open tempad tp menu
  4. scroll up or down with mouse wheel

Expected Behavior

keep the order, not scramble completly

Version

1.4.0

Mod Loader Version

1.18.2

Mod Loader

Forge

Logs or additional context

No response

Code of Conduct

CodexAdrian commented 10 months ago

1.18 is no longer supported

TheGMYeti commented 3 months ago

Using the Tempad mod in the LPS SteamPunk mod pack (mc version 1.19.2, which you committed to 3 weeks ago) and I can confirm that the list still breaks when you scroll. I even know the reason, but I am not able to fix it right now. me.codexadrian.tempad.client.gui.RunProgramScreen::init() & me.codexadrian.tempad.client.gui.RunProgramScreen::tick() use different code to fill the list. I can't tell if it is the only issue right now, but from what I can see the issue is cause by init() sorting the list while tick() doesn't. An issue I can see coming up is that it moves at most 12 items of allLocations to shownLocationData before sorting. I might suggest either adding sorting before moving to shownLocationData for best experience, or removing the sort from init for a quick fix?