Fixed pausing the bot

This commit is contained in:
JKetelaar
2015-01-31 03:10:43 +01:00
parent fc0a601dfa
commit 27a92b57d5
+6 -4
View File
@@ -28,10 +28,6 @@ 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");
@@ -63,6 +59,10 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
} }
} }
public static BotUI getInstance() {
return instance;
}
private void createMenu() { private void createMenu() {
JMenuBar menuBar = new JMenuBar(); JMenuBar menuBar = new JMenuBar();
@@ -191,8 +191,10 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
} }
private void setScriptState(int state) { private void setScriptState(int state) {
if (Context.getInstance().getRunningScript() != null) {
Context.getInstance().getRunningScript().setState(state); Context.getInstance().getRunningScript().setState(state);
} }
}
@Override @Override
public void componentResized(ComponentEvent e) { public void componentResized(ComponentEvent e) {