mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 08:39:12 +00:00
Trying to fix applet ........
This commit is contained in:
@@ -166,7 +166,7 @@ public class Context {
|
|||||||
BotUI.getInstance().validate();
|
BotUI.getInstance().validate();
|
||||||
final GamePanel panel = GamePanel.getInstance();
|
final GamePanel panel = GamePanel.getInstance();
|
||||||
panel.removeLoader();
|
panel.removeLoader();
|
||||||
panel.setContext(this);
|
panel.add(gameApplet);
|
||||||
gameApplet.setSize(765, 503);
|
gameApplet.setSize(765, 503);
|
||||||
java.util.Timer t = new java.util.Timer();
|
java.util.Timer t = new java.util.Timer();
|
||||||
t.schedule(new TimerTask() {
|
t.schedule(new TimerTask() {
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
|||||||
|
|
||||||
private static final long serialVersionUID = -2126184292879805519L;
|
private static final long serialVersionUID = -2126184292879805519L;
|
||||||
private static BotUI instance;
|
private static BotUI instance;
|
||||||
private static JDialog dialog;
|
//private static JDialog dialog;
|
||||||
|
|
||||||
public static BotUI getInstance() {
|
public static BotUI getInstance() {
|
||||||
return instance == null ? instance = new BotUI() : instance;
|
return instance == null ? instance = new BotUI() : instance;
|
||||||
@@ -40,7 +40,7 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
|||||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
this.setIconImage(Images.getResource("/org/parabot/core/ui/images/icon.png"));
|
this.setIconImage(Images.getResource("/org/parabot/core/ui/images/icon.png"));
|
||||||
this.setLayout(new BorderLayout());
|
this.setLayout(new BorderLayout());
|
||||||
this.addComponentListener(this);
|
//this.addComponentListener(this);
|
||||||
|
|
||||||
int iToolbarHeight = 24;
|
int iToolbarHeight = 24;
|
||||||
int iGameHeight = 503;
|
int iGameHeight = 503;
|
||||||
@@ -91,9 +91,9 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
|||||||
this.add(panel, BorderLayout.CENTER);
|
this.add(panel, BorderLayout.CENTER);
|
||||||
|
|
||||||
pack();
|
pack();
|
||||||
setLocationRelativeTo(null);
|
//setLocationRelativeTo(null);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
new BotDialog(this);
|
//new BotDialog(this);
|
||||||
|
|
||||||
LogArea.log("parabot " + Configuration.BOT_VERSION + " started");
|
LogArea.log("parabot " + Configuration.BOT_VERSION + " started");
|
||||||
}
|
}
|
||||||
@@ -116,16 +116,16 @@ public class BotUI extends JFrame implements ActionListener, ComponentListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void setDialog(JDialog dialog) {
|
protected void setDialog(JDialog dialog) {
|
||||||
BotUI.dialog = dialog;
|
//BotUI.dialog = dialog;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void componentMoved(ComponentEvent e) {
|
public void componentMoved(ComponentEvent e) {
|
||||||
if(dialog == null) {
|
/*if(dialog == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Point gameLocation = GamePanel.getInstance().getLocationOnScreen();
|
Point gameLocation = GamePanel.getInstance().getLocationOnScreen();
|
||||||
dialog.setLocation(gameLocation.x, gameLocation.y);
|
dialog.setLocation(gameLocation.x, gameLocation.y);*/
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.parabot.core.ui.components;
|
package org.parabot.core.ui.components;
|
||||||
|
|
||||||
import java.applet.Applet;
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
@@ -20,8 +19,6 @@ public class GamePanel extends JPanel {
|
|||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private static GamePanel instance;
|
private static GamePanel instance;
|
||||||
private static VerboseLoader loader = VerboseLoader.get();
|
private static VerboseLoader loader = VerboseLoader.get();
|
||||||
|
|
||||||
public Context context;
|
|
||||||
|
|
||||||
private GamePanel() {
|
private GamePanel() {
|
||||||
setFocusable(true);
|
setFocusable(true);
|
||||||
@@ -47,20 +44,7 @@ public class GamePanel extends JPanel {
|
|||||||
* @param context
|
* @param context
|
||||||
*/
|
*/
|
||||||
public void setContext(final Context c) {
|
public void setContext(final Context c) {
|
||||||
if(context != null) {
|
add(c.getApplet());
|
||||||
context.getApplet().setVisible(false);
|
|
||||||
}
|
|
||||||
context = c;
|
|
||||||
if(c == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final Applet gameApplet = context.getApplet();
|
|
||||||
if(!c.added) {
|
|
||||||
add(gameApplet);
|
|
||||||
c.added = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
gameApplet.setVisible(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ public abstract class ServerExecuter {
|
|||||||
Context context = Context.getInstance(provider);
|
Context context = Context.getInstance(provider);
|
||||||
BotToolbar.getInstance().addTab(context, serverName);
|
BotToolbar.getInstance().addTab(context, serverName);
|
||||||
context.load();
|
context.load();
|
||||||
PaintComponent.getInstance().startPainting(context.getPaintDebugger());
|
//PaintComponent.getInstance().startPainting(context.getPaintDebugger());
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user