File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed
src/com/thistestuser/cursormacro/player Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -80,6 +80,12 @@ public boolean isRunning()
8080 return execution != null && execution .isAlive ();
8181 }
8282
83+ @ Override
84+ public boolean shouldStop ()
85+ {
86+ return !playing ;
87+ }
88+
8389 @ Override
8490 public boolean hasInstructions ()
8591 {
Original file line number Diff line number Diff line change @@ -30,6 +30,11 @@ public abstract class Player
3030 * Check if the thread has terminated yet. If this is true, nothing is allowed to be run.
3131 */
3232 public abstract boolean isRunning ();
33+
34+ /**
35+ * Returns if the execution should stop. This is used to exit from instructions that may run forever.
36+ */
37+ public abstract boolean shouldStop ();
3338
3439 public void registerMouse (boolean press , int button )
3540 {
Original file line number Diff line number Diff line change @@ -61,6 +61,12 @@ public boolean isRunning()
6161 return execution != null && execution .isAlive ();
6262 }
6363
64+ @ Override
65+ public boolean shouldStop ()
66+ {
67+ return !listening ;
68+ }
69+
6470 public void activateKeyMacro (int keyCode )
6571 {
6672 if (!listening || isRunning ())
You can’t perform that action at this time.
0 commit comments