mirror of
https://gitlab.com/2009scape/rt4-client.git
synced 2026-08-01 14:39:16 -06:00
Add scrollwheel zoom :)
This commit is contained in:
parent
71d479a399
commit
443187fb60
5 changed files with 27 additions and 1 deletions
|
|
@ -8,6 +8,8 @@ import org.openrs2.deob.annotation.OriginalClass;
|
|||
import org.openrs2.deob.annotation.OriginalMember;
|
||||
import org.openrs2.deob.annotation.Pc;
|
||||
|
||||
import static rt4.MathUtils.clamp;
|
||||
|
||||
@OriginalClass("client!o")
|
||||
public final class JavaMouseWheel extends MouseWheel implements MouseWheelListener {
|
||||
|
||||
|
|
@ -31,7 +33,13 @@ public final class JavaMouseWheel extends MouseWheel implements MouseWheelListen
|
|||
@OriginalMember(owner = "client!o", name = "mouseWheelMoved", descriptor = "(Ljava/awt/event/MouseWheelEvent;)V")
|
||||
@Override
|
||||
public final synchronized void mouseWheelMoved(@OriginalArg(0) MouseWheelEvent arg0) {
|
||||
int previous = this.anInt4233;
|
||||
this.anInt4233 += arg0.getWheelRotation();
|
||||
int diff = this.anInt4233 - previous;
|
||||
|
||||
if (Keyboard.instance.isShiftPressed()) {
|
||||
Camera.ZOOM = clamp(200, 1200, Camera.ZOOM + (diff >= 0 ? 50: -50));
|
||||
}
|
||||
}
|
||||
|
||||
@OriginalMember(owner = "client!o", name = "a", descriptor = "(Ljava/awt/Component;I)V")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue