mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 08:39:09 +00:00
Merge branch 'development' into bugfix/getsystemprop
This commit is contained in:
@@ -164,7 +164,6 @@ public class Context {
|
||||
* Loads the game
|
||||
*/
|
||||
public void load() {
|
||||
BotUI.getInstance().getJMenuBar().remove(2);
|
||||
Core.verbose(TranslationHelper.translate("PARSING_SERVER_JAR"));
|
||||
serverProvider.init();
|
||||
serverProvider.parseJar();
|
||||
|
||||
@@ -34,9 +34,12 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
||||
private static BotUI instance;
|
||||
private static JDialog dialog;
|
||||
|
||||
private JMenuItem run, pause, stop;
|
||||
private JMenuBar menuBar;
|
||||
private JMenu features, scripts, file;
|
||||
private JMenuItem run, pause, stop, cacheClear, notifications;
|
||||
private boolean runScript, pauseScript;
|
||||
|
||||
|
||||
public BotUI(String username, String password) {
|
||||
if (instance != null) {
|
||||
throw new IllegalStateException("BotUI already created");
|
||||
@@ -74,11 +77,11 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
||||
|
||||
|
||||
private void createMenu() {
|
||||
JMenuBar menuBar = new JMenuBar();
|
||||
menuBar = new JMenuBar();
|
||||
|
||||
JMenu file = new JMenu("File");
|
||||
JMenu scripts = new JMenu("Script");
|
||||
JMenu features = new JMenu("Features");
|
||||
file = new JMenu("File");
|
||||
scripts = new JMenu("Script");
|
||||
features = new JMenu("Features");
|
||||
|
||||
JMenuItem screenshot = new JMenuItem("Create screenshot");
|
||||
JMenuItem proxy = new JMenuItem("Network");
|
||||
@@ -104,10 +107,10 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
||||
stop.setEnabled(false);
|
||||
stop.setIcon(new ImageIcon(Images.getResource("/storage/images/stop.png")));
|
||||
|
||||
JMenuItem cacheClear = new JMenuItem("Clear cache");
|
||||
cacheClear = new JMenuItem("Clear cache");
|
||||
cacheClear.setIcon(new ImageIcon(Images.getResource("/storage/images/trash.png")));
|
||||
|
||||
JMenuItem notifications = new JMenuItem("Notifications");
|
||||
notifications = new JMenuItem("Notifications");
|
||||
notifications.setIcon(new ImageIcon(Images.getResource("/storage/images/bell.png")));
|
||||
|
||||
screenshot.addActionListener(this);
|
||||
@@ -341,4 +344,23 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener,
|
||||
public void windowOpened(WindowEvent arg0) {
|
||||
}
|
||||
|
||||
public JMenu getFeatures() {
|
||||
return features;
|
||||
}
|
||||
|
||||
public JMenu getScripts() {
|
||||
return scripts;
|
||||
}
|
||||
|
||||
public JMenu getFile() {
|
||||
return file;
|
||||
}
|
||||
|
||||
public JMenuItem getCacheClear() {
|
||||
return cacheClear;
|
||||
}
|
||||
|
||||
public JMenuItem getNotifications() {
|
||||
return notifications;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,36 @@
|
||||
package org.parabot.environment.servers.executers;
|
||||
|
||||
import org.parabot.core.Context;
|
||||
import org.parabot.core.Core;
|
||||
import org.parabot.core.parsers.randoms.RandomParser;
|
||||
import org.parabot.core.ui.BotUI;
|
||||
import org.parabot.core.ui.components.PaintComponent;
|
||||
import org.parabot.environment.servers.ServerProvider;
|
||||
|
||||
import java.io.PrintStream;
|
||||
|
||||
/**
|
||||
*
|
||||
* Executes a server provider
|
||||
*
|
||||
* @author Everel
|
||||
*
|
||||
* @author Everel
|
||||
*/
|
||||
public abstract class ServerExecuter {
|
||||
|
||||
public abstract void run();
|
||||
public abstract void run();
|
||||
|
||||
public void finalize(final ServerProvider provider, final String serverName) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
Context context = Context.getInstance(provider);
|
||||
context.load();
|
||||
PaintComponent.getInstance().startPainting(context);
|
||||
public void finalize(final ServerProvider provider, final String serverName) {
|
||||
new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
BotUI.getInstance().getCacheClear().setEnabled(false);
|
||||
|
||||
Context.getInstance().getRandomHandler().init();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
Context context = Context.getInstance(provider);
|
||||
context.load();
|
||||
PaintComponent.getInstance().startPainting(context);
|
||||
|
||||
Context.getInstance().getRandomHandler().init();
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
}).start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user