Skip to content

Fix scroll input in request pipes - #126

Open
ThePixelbrain wants to merge 1 commit into
GTNewHorizons:masterfrom
ThePixelbrain:master
Open

Fix scroll input in request pipes#126
ThePixelbrain wants to merge 1 commit into
GTNewHorizons:masterfrom
ThePixelbrain:master

Conversation

@ThePixelbrain

Copy link
Copy Markdown

Summary

Fixes mouse scroll input in Logistics Request Pipes or Blocks on X11. When scrolling in these blocks to specify the amount of items to request, the selected amounts gets increased by about 100-200 items per scroll input.
This was previously broken in #78 by fixing scroll input for Wayland. This PR should work for both and also other platforms such as Windows and macOS (though I haven't tested them and don't know if #78 has broken them as well).

In the "original" LP code the raw wheel input from Mouse.getEventDWheel() was simply divided by 120. This breaks for Wayland, as the wheel input seems to be just +-1, resulting in no increase / decrease.

This PR simply checks if the value from Mouse.getEventDWheel() is positive or negative by setting it to either 1 or -1, so each scroll input will result in the addition or removal of one request item, no matter how much delta is present.

The other locations that #78 modified are fine, because the delta is already checked for being positive or negative before being used further.

I could only test this on X11, so testing it on other platforms before merging might be wise.

Checklist

  • I have tested this PR in DevEnv
  • I have tested this PR in Fullpack
  • This PR is in compliance with the GTNH AI Policy
  • This PR requires another PR in order to merge

@Storyboard-MC

Copy link
Copy Markdown

I can confirm that this works as intended on Wayland. Scrolling changes the amount by 1 and down by 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants