@@ -35,6 +35,7 @@ public class MouseHandler implements MouseListener, MouseMotionListener, FocusLi
35
35
public static int cursorY ;
36
36
public static int cursorX ;
37
37
public static boolean gameScreenClickable ;
38
+ public static volatile int framesSinceMouseInput = 0 ;
38
39
private static volatile int eventClickX = 0 ;
39
40
private static volatile long lastClick = 0L ;
40
41
public boolean mouseWheelDown ;
@@ -177,17 +178,21 @@ public static void addListeners(Component arg0) {
177
178
arg0 .addMouseWheelListener (GameObject .frame );
178
179
}
179
180
181
+ public static int resetFramesSinceMouseInput () {
182
+ return framesSinceMouseInput ++;
183
+ }
184
+
180
185
public synchronized void mouseEntered (MouseEvent arg0 ) {
181
186
if (GameObject .frame != null ) {
182
- LinkedList . anInt1073 = 0 ;
187
+ framesSinceMouseInput = 0 ;
183
188
eventMouseX = arg0 .getX ();
184
189
eventMouseY = arg0 .getY ();
185
190
}
186
191
}
187
192
188
193
public synchronized void mouseExited (MouseEvent arg0 ) {
189
194
if (GameObject .frame != null ) {
190
- LinkedList . anInt1073 = 0 ;
195
+ framesSinceMouseInput = 0 ;
191
196
eventMouseX = -1 ;
192
197
eventMouseY = -1 ;
193
198
}
@@ -202,7 +207,7 @@ public synchronized void mouseDragged(MouseEvent mouseEvent) {
202
207
int mouseX = mouseEvent .getX ();
203
208
int mouseY = mouseEvent .getY ();
204
209
if (GameObject .frame != null ) {
205
- LinkedList . anInt1073 = 0 ;
210
+ framesSinceMouseInput = 0 ;
206
211
}
207
212
if (mouseWheelDown ) {
208
213
mouseY = mouseWheelX - mouseEvent .getX ();
@@ -217,7 +222,7 @@ public synchronized void mouseDragged(MouseEvent mouseEvent) {
217
222
}
218
223
219
224
private void mouseWheelDragged (int i , int j ) {
220
- LinkedList . anInt1073 = 0 ;
225
+ framesSinceMouseInput = 0 ;
221
226
222
227
if (!mouseWheelDown )
223
228
return ;
@@ -232,7 +237,7 @@ public synchronized void mousePressed(MouseEvent event) {
232
237
if (GameObject .frame != null ) {
233
238
int mouseX = event .getX ();
234
239
int mouseY = event .getY ();
235
- LinkedList . anInt1073 = 0 ;
240
+ framesSinceMouseInput = 0 ;
236
241
eventClickX = mouseX ;
237
242
MovedStatics .eventClickY = mouseY ;
238
243
lastClick = System .currentTimeMillis ();
@@ -256,7 +261,7 @@ public synchronized void mousePressed(MouseEvent event) {
256
261
257
262
public void mouseWheelMoved (MouseWheelEvent event ) {
258
263
int rotation = event .getWheelRotation ();
259
- LinkedList . anInt1073 = 0 ;
264
+ framesSinceMouseInput = 0 ;
260
265
261
266
if (!handleInterfaceScrolling (event )) {
262
267
int currentZoom = Game .playerCamera .getZoom ();
@@ -382,15 +387,15 @@ public boolean handleInterfaceScrolling(MouseWheelEvent event) {
382
387
383
388
public synchronized void mouseMoved (MouseEvent arg0 ) {
384
389
if (GameObject .frame != null ) {
385
- LinkedList . anInt1073 = 0 ;
390
+ framesSinceMouseInput = 0 ;
386
391
eventMouseX = arg0 .getX ();
387
392
eventMouseY = arg0 .getY ();
388
393
}
389
394
}
390
395
391
396
public synchronized void mouseReleased (MouseEvent arg0 ) {
392
397
if (GameObject .frame != null ) {
393
- LinkedList . anInt1073 = 0 ;
398
+ framesSinceMouseInput = 0 ;
394
399
mouseButtonPressed = 0 ;
395
400
mouseWheelDown = false ;
396
401
}
0 commit comments