Skip to content

Commit eb4071d

Browse files
committed
refactor: rename MouseHandler statics
1 parent 8b450ea commit eb4071d

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/main/java/org/runejs/client/Game.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public class Game {
7878
public static int loginStatus = 0;
7979
public static int modewhat = 0;
8080
public static int modewhere = 0;
81-
public static long aLong1203 = 0L;
81+
public static long lastClickTime = 0L;
8282
public static int mouseInvInterfaceIndex = 0;
8383
public static int anInt509 = 0;
8484
public static boolean aBoolean519 = true;
@@ -618,7 +618,7 @@ else if (gameInterface.xTextAlignment == 1)
618618

619619

620620
public static void setConfigToDefaults() {
621-
aLong1203 = 0L;
621+
lastClickTime = 0L;
622622
mouseCapturer.coord = 0;
623623
duplicateClickCount = 0;
624624
aBoolean1735 = true;
@@ -636,7 +636,7 @@ public static void setConfigToDefaults() {
636636
IncomingPackets.thirdLastOpcode = -1;
637637
IncomingPackets.incomingPacketBuffer.currentPosition = 0;
638638
MovedStatics.menuActionRow = 0;
639-
MouseHandler.method650(0);
639+
MouseHandler.setFramesSinceMouseInput(0);
640640
for (int i = 0; i < 100; i++)
641641
ChatBox.chatMessages[i] = null;
642642
GameInterface.itemCurrentlySelected = 0;
@@ -1255,10 +1255,10 @@ else if(x > 764)
12551255
}
12561256
}
12571257
if(MouseHandler.clickType != 0) {
1258-
long l = (MouseHandler.aLong2561 - aLong1203) / 50L;
1258+
long delta = (MouseHandler.clickTime - lastClickTime) / 50L;
12591259
int i = MouseHandler.clickX;
12601260
int i_10_ = MouseHandler.clickY;
1261-
aLong1203 = MouseHandler.aLong2561;
1261+
lastClickTime = MouseHandler.clickTime;
12621262
if(i >= 0) {
12631263
if(i > 764)
12641264
i = 764;
@@ -1272,9 +1272,9 @@ else if(x > 764)
12721272
int i_11_ = 0;
12731273
if(MouseHandler.clickType == 2)
12741274
i_11_ = 1;
1275-
if(l > 4095)
1276-
l = 4095L;
1277-
int i_12_ = (int) l;
1275+
if(delta > 4095)
1276+
delta = 4095L;
1277+
int i_12_ = (int) delta;
12781278
OutgoingPackets.buffer.putPacket(234);
12791279
int i_13_ = i_10_ * 765 + i;
12801280
OutgoingPackets.buffer.putIntLE((i_11_ << 19) + (i_12_ << 20) + i_13_);
@@ -1471,7 +1471,7 @@ else if(ChatBox.dialogueId != -1)
14711471
int i_21_ = KeyFocusListener.resetFramesSinceKeyboardInput();
14721472
if(i_20_ > 4500 && i_21_ > 4500) {
14731473
SceneCluster.idleLogout = 250;
1474-
MouseHandler.method650(4000);
1474+
MouseHandler.setFramesSinceMouseInput(4000);
14751475
OutgoingPackets.buffer.putPacket(216);
14761476
}
14771477

src/main/java/org/runejs/client/input/MouseHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class MouseHandler implements MouseListener, MouseMotionListener, FocusLi
2222
public static int mouseY = 0;
2323
public static int clickX = 0;
2424
public static int clickY = 0;
25-
public static long aLong2561 = 0L;
25+
public static long clickTime = 0L;
2626
public static int cursorY;
2727
public static int cursorX;
2828
public static boolean gameScreenClickable;
@@ -41,7 +41,7 @@ public static void method1015() {
4141
clickType = eventMouseButtonPressed;
4242
clickX = eventClickX;
4343
clickY = MovedStatics.eventClickY;
44-
aLong2561 = lastClick;
44+
clickTime = lastClick;
4545
eventMouseButtonPressed = 0;
4646
}
4747
}
@@ -63,7 +63,7 @@ public static int resetFramesSinceMouseInput() {
6363
return framesSinceMouseInput++;
6464
}
6565

66-
public static void method650(int arg1) {
66+
public static void setFramesSinceMouseInput(int arg1) {
6767
framesSinceMouseInput = arg1;
6868
}
6969

0 commit comments

Comments
 (0)