mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-13 03:07:34 +00:00
OMG janino-scripts-final merge
This commit is contained in:
commit
96239118e7
200 files changed
+10048
-6771
No files matched your search
@@ -598,18 +598,16 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
int maxScroll = Math.max(0, getPaddedLineCount() - container.visibleLines);
|
||||
|
||||
// Handle mouse wheel scroll
|
||||
int wheelDelta = ((GuiNPCInterface) listener).mouseScroll = Mouse.getDWheel();
|
||||
if (listener instanceof GuiNPCInterface) {
|
||||
((GuiNPCInterface) listener).mouseScroll = wheelDelta;
|
||||
|
||||
// Let autocomplete menu consume scroll first if visible
|
||||
if (wheelDelta != 0 && autocompleteManager.isVisible() && autocompleteManager.mouseScrolled(xMouse, yMouse, wheelDelta)) {
|
||||
// Autocomplete consumed the scroll
|
||||
} else {
|
||||
boolean canScroll = !KEYS_OVERLAY.isVisible() || KEYS_OVERLAY.isVisible() && !KEYS_OVERLAY.aboveOverlay;
|
||||
if (wheelDelta != 0 && canScroll)
|
||||
scroll.applyWheelScroll(wheelDelta, maxScroll);
|
||||
boolean isMouseOverTextArea = xMouse >= x && xMouse < x + width && yMouse >= y && yMouse < y + height;
|
||||
int wheelDelta = 0;
|
||||
if (isMouseOverTextArea) {
|
||||
wheelDelta = Mouse.getDWheel();
|
||||
if (listener instanceof GuiNPCInterface) {
|
||||
((GuiNPCInterface) listener).mouseScroll = wheelDelta;
|
||||
}
|
||||
boolean canScroll = !KEYS_OVERLAY.isVisible() || KEYS_OVERLAY.isVisible() && !KEYS_OVERLAY.aboveOverlay;
|
||||
if (wheelDelta != 0 && canScroll)
|
||||
scroll.applyWheelScroll(wheelDelta, maxScroll);
|
||||
}
|
||||
|
||||
// Handle scrollbar dragging (delegated to ScrollState)
|
||||
|
||||
Reference in new issue
Block a user