mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 22:27:32 +00:00
GUI fixes and small bug fixes to Script GUIs, Overlay GUI, etc
This commit is contained in:
1 parent
d560c23241
commit
31aac0d6b3
4 files changed
+55
-28
No files matched your search
@@ -493,12 +493,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;
|
||||
// Handle mouse wheel scroll - only consume when mouse is over this text area
|
||||
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)
|
||||
if (wheelDelta != 0 && canScroll)
|
||||
scroll.applyWheelScroll(wheelDelta, maxScroll);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user