Skip to content

Commit

Permalink
Remove mixin into mouseScrolled and just override method within BaseO…
Browse files Browse the repository at this point in the history
…woHandledScreen
  • Loading branch information
Dragon-Seeker committed Oct 23, 2024
1 parent 39728ef commit c4cad00
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/main/java/io/wispforest/owo/mixin/ui/HandledScreenMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,4 @@ private void closeIt(int keyCode, int scanCode, int modifiers, CallbackInfoRetur
cir.setReturnValue(true);
}
}

// Fixes issues with scrolling with screens extending Handled and using UIAdapter
@WrapMethod(method = "mouseScrolled")
private boolean owo$useSuperMouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount, Operation<Boolean> original){
var bl = original.call(mouseX, mouseY, horizontalAmount, verticalAmount);

if (bl) return true;

return super.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,11 @@ public boolean mouseDragged(double mouseX, double mouseY, int button, double del
return this.uiAdapter.mouseDragged(mouseX, mouseY, button, deltaX, deltaY) || super.mouseDragged(mouseX, mouseY, button, deltaX, deltaY);
}

@Override
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) {
return this.uiAdapter.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount) || super.mouseScrolled(mouseX, mouseY, horizontalAmount, verticalAmount);
}

@Nullable
@Override
public Element getFocused() {
Expand Down

0 comments on commit c4cad00

Please sign in to comment.