mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 16:49:10 +00:00
Fixed pausing the bot
This commit is contained in:
@@ -28,12 +28,8 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
private JMenuItem run, pause, stop;
|
private JMenuItem run, pause, stop;
|
||||||
private boolean runScript, pauseScript;
|
private boolean runScript, pauseScript;
|
||||||
|
|
||||||
public static BotUI getInstance() {
|
|
||||||
return instance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public BotUI(String username, String password) {
|
public BotUI(String username, String password) {
|
||||||
if(instance != null) {
|
if (instance != null) {
|
||||||
throw new IllegalStateException("BotUI already created");
|
throw new IllegalStateException("BotUI already created");
|
||||||
}
|
}
|
||||||
instance = this;
|
instance = this;
|
||||||
@@ -58,9 +54,13 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
setLocationRelativeTo(null);
|
setLocationRelativeTo(null);
|
||||||
BotDialog.getInstance(this);
|
BotDialog.getInstance(this);
|
||||||
|
|
||||||
if (!OperatingSystem.getOS().equals(OperatingSystem.WINDOWS)) {
|
if (!OperatingSystem.getOS().equals(OperatingSystem.WINDOWS)) {
|
||||||
BotDialog.getInstance().setVisible(false);
|
BotDialog.getInstance().setVisible(false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BotUI getInstance() {
|
||||||
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createMenu() {
|
private void createMenu() {
|
||||||
@@ -191,7 +191,9 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setScriptState(int state) {
|
private void setScriptState(int state) {
|
||||||
Context.getInstance().getRunningScript().setState(state);
|
if (Context.getInstance().getRunningScript() != null) {
|
||||||
|
Context.getInstance().getRunningScript().setState(state);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user