mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 08:39:12 +00:00
Fixed pausing the bot
This commit is contained in:
@@ -28,18 +28,14 @@ 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;
|
||||||
//WebLookAndFeel.install();
|
//WebLookAndFeel.install();
|
||||||
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
|
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
|
||||||
|
|
||||||
setTitle("Parabot");
|
setTitle("Parabot");
|
||||||
setResizable(false);
|
setResizable(false);
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
@@ -51,16 +47,20 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
|||||||
|
|
||||||
add(GamePanel.getInstance());
|
add(GamePanel.getInstance());
|
||||||
GamePanel.getInstance().add(VerboseLoader.get(username, password), BorderLayout.CENTER);
|
GamePanel.getInstance().add(VerboseLoader.get(username, password), BorderLayout.CENTER);
|
||||||
|
|
||||||
SwingUtil.setParabotIcons(this);
|
SwingUtil.setParabotIcons(this);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
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