mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-05 16:49:41 +00:00
Re-added BotDialog
This commit is contained in:
@@ -188,7 +188,7 @@ public class ClassPath {
|
||||
protected void loadClass(InputStream in) throws IOException {
|
||||
ClassReader cr = new ClassReader(in);
|
||||
ClassNode cn = new ClassNode();
|
||||
cr.accept(cn, ClassReader.EXPAND_FRAMES);
|
||||
cr.accept(cn, 0);
|
||||
classes.put(cn.name, cn);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ public class BotDialog extends JDialog {
|
||||
setContentPane(PaintComponent.getInstance(botUI.getSize()));
|
||||
setPreferredSize(botUI.getSize());
|
||||
setSize(botUI.getSize());
|
||||
setIgnoreRepaint(true);
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
||||
|
||||
private static final long serialVersionUID = -2126184292879805519L;
|
||||
private static BotUI instance;
|
||||
//private static JDialog dialog;
|
||||
private static JDialog dialog;
|
||||
|
||||
public static BotUI getInstance() {
|
||||
return instance == null ? instance = new BotUI() : instance;
|
||||
@@ -40,7 +40,8 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
this.setIconImage(Images.getResource("/org/parabot/core/ui/images/icon.png"));
|
||||
this.setLayout(new BorderLayout());
|
||||
//this.addComponentListener(this);
|
||||
this.addComponentListener(this);
|
||||
this.setIgnoreRepaint(true);
|
||||
|
||||
int iToolbarHeight = 24;
|
||||
int iGameHeight = 503;
|
||||
@@ -91,9 +92,9 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
||||
this.add(panel, BorderLayout.CENTER);
|
||||
|
||||
pack();
|
||||
//setLocationRelativeTo(null);
|
||||
setLocationRelativeTo(null);
|
||||
setVisible(true);
|
||||
//new BotDialog(this);
|
||||
new BotDialog(this);
|
||||
|
||||
LogArea.log("parabot " + Configuration.BOT_VERSION + " started");
|
||||
}
|
||||
@@ -116,16 +117,16 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
||||
}
|
||||
|
||||
protected void setDialog(JDialog dialog) {
|
||||
//BotUI.dialog = dialog;
|
||||
BotUI.dialog = dialog;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void componentMoved(ComponentEvent e) {
|
||||
/*if(dialog == null) {
|
||||
if(dialog == null) {
|
||||
return;
|
||||
}
|
||||
Point gameLocation = GamePanel.getInstance().getLocationOnScreen();
|
||||
dialog.setLocation(gameLocation.x, gameLocation.y);*/
|
||||
dialog.setLocation(gameLocation.x, gameLocation.y);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -34,7 +34,7 @@ public class PaintComponent extends JComponent implements Runnable {
|
||||
setPreferredSize(dimensions);
|
||||
setSize(dimensions);
|
||||
setOpaque(false);
|
||||
setDoubleBuffered(true);
|
||||
setIgnoreRepaint(true);
|
||||
}
|
||||
|
||||
public static PaintComponent getInstance(Dimension dimensions) {
|
||||
@@ -66,7 +66,7 @@ public class PaintComponent extends JComponent implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
while(true) {
|
||||
Time.sleep(15);
|
||||
Time.sleep(100);
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ public abstract class ServerExecuter {
|
||||
Context context = Context.getInstance(provider);
|
||||
BotToolbar.getInstance().addTab(context, serverName);
|
||||
context.load();
|
||||
//PaintComponent.getInstance().startPainting(context.getPaintDebugger());
|
||||
PaintComponent.getInstance().startPainting(context.getPaintDebugger());
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user