mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-12 08:27:45 +00:00
Fix Mouse Scroll in Gui Script
This commit is contained in:
1 parent
17c953f4bf
commit
4df2866fb0
1 file changed
+8
-6
@@ -63,6 +63,14 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
|
||||
container.visibleLines = height / container.lineHeight;
|
||||
|
||||
if(listener instanceof GuiNPCInterface){
|
||||
int k2 = ((GuiNPCInterface) listener).mouseScroll;
|
||||
if(k2 != 0) {
|
||||
this.scrolledLine -= k2/40;
|
||||
this.scrolledLine = Math.max(Math.min(this.scrolledLine, this.container.linesCount - this.height / this.container.lineHeight), 0);
|
||||
}
|
||||
}
|
||||
|
||||
if(clicked){
|
||||
clicked = Mouse.isButtonDown(0);
|
||||
int i = getSelectionPos(xMouse, yMouse);
|
||||
@@ -560,12 +568,6 @@ public class GuiScriptTextArea extends GuiNpcTextField {
|
||||
|
||||
public void updateCursorCounter() {
|
||||
++this.cursorCounter;
|
||||
int k2 = Mouse.getDWheel();
|
||||
if(k2 != 0) {
|
||||
this.scrolledLine += k2 > 0?-1:1;
|
||||
this.scrolledLine = Math.max(Math.min(this.scrolledLine, this.container.linesCount - this.height / this.container.lineHeight), 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void setText(String text) {
|
||||
|
||||
Reference in new issue
Block a user