Rework widget scrolling to support x+y scrolling#198
Open
MichaelHillcox wants to merge 3 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates FTB Library’s UI scrolling pipeline to accept both horizontal and vertical scroll deltas (trackpads / “free” scrolling), while keeping a deprecated single-axis scroll API for transitional compatibility.
Changes:
- Introduces a new
mouseScrolled(mouseX, mouseY, scrollHorizontal, scrollVertical)API onWidgetand propagates it through screens/panels. - Updates several widgets/panels to consume the new vertical delta (and prepares for horizontal support).
- Updates Gradle’s mod-publish plugin version.
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/Widget.java | Adds new 2D scroll method and deprecates old 1D method. |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/ScrollBar.java | Migrates scrollbar scrolling to the new 2D scroll signature. |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/ScreenWrapper.java | Routes Minecraft Screen scroll events into the wrapped GUI (with temporary legacy fallback). |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/Panel.java | Propagates 2D scroll into child widgets and panel scrolling. |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/IntTextBox.java | Updates scroll-to-increment behavior to use the vertical delta. |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/DropDownMenu.java | Removes redundant scrollPanel override (now handled by base behavior). |
| common/src/main/java/dev/ftb/mods/ftblibrary/ui/BaseScreen.java | Updates focused-widget and modal-panel scroll dispatch to 2D scroll. |
| common/src/main/java/dev/ftb/mods/ftblibrary/config/ui/resource/ResourceSelectorScreen.java | Updates scroll adjustments to use the vertical delta. |
| common/src/main/java/dev/ftb/mods/ftblibrary/config/ui/EditStringConfigOverlay.java | Updates scroll-to-cycle behavior to use the vertical delta and new signature. |
| build.gradle | Bumps me.modmuss50.mod-publish-plugin version. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Updated the logic to be more consistent with a standard operating system scroll. If shift is applied, attempt to apply either delta to the X axis |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This shouldn't break anything with existing mods but I could have missed something. This is a required change to allow FTB Quests and other related panels that use scrolling as a pan method to work with trackpads, ball scrolling, etc