mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-06 16:49:07 +00:00
Fixed client frame offsets/padding (#557)
This commit is contained in:
@@ -4813,9 +4813,6 @@ public class Game extends RSApplet {
|
|||||||
Component getGameComponent() {
|
Component getGameComponent() {
|
||||||
if (Signlink.mainapp != null) {
|
if (Signlink.mainapp != null) {
|
||||||
return Signlink.mainapp;
|
return Signlink.mainapp;
|
||||||
}
|
|
||||||
if (super.gameFrame != null) {
|
|
||||||
return super.gameFrame;
|
|
||||||
} else {
|
} else {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@
|
|||||||
// Jad home page: http://www.kpdus.com/jad.html
|
// Jad home page: http://www.kpdus.com/jad.html
|
||||||
// Decompiler options: packimports(3)
|
// Decompiler options: packimports(3)
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.applet.Applet;
|
import java.applet.Applet;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.FocusEvent;
|
import java.awt.event.FocusEvent;
|
||||||
@@ -29,7 +28,9 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseWh
|
|||||||
final void createClientFrame(int i, int j) {
|
final void createClientFrame(int i, int j) {
|
||||||
myWidth = j;
|
myWidth = j;
|
||||||
myHeight = i;
|
myHeight = i;
|
||||||
gameFrame = new RSFrame(this, myWidth, myHeight);
|
this.setPreferredSize(new Dimension(this.myWidth, this.myHeight));
|
||||||
|
|
||||||
|
gameFrame = new RSFrame(this);
|
||||||
graphics = getGameComponent().getGraphics();
|
graphics = getGameComponent().getGraphics();
|
||||||
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
|
fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
|
||||||
startRunnable(this, 1);
|
startRunnable(this, 1);
|
||||||
@@ -215,10 +216,6 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseWh
|
|||||||
public final void mousePressed(MouseEvent mouseevent) {
|
public final void mousePressed(MouseEvent mouseevent) {
|
||||||
int i = mouseevent.getX();
|
int i = mouseevent.getX();
|
||||||
int j = mouseevent.getY();
|
int j = mouseevent.getY();
|
||||||
if (gameFrame != null) {
|
|
||||||
i -= 4;
|
|
||||||
j -= 22;
|
|
||||||
}
|
|
||||||
idleTime = 0;
|
idleTime = 0;
|
||||||
clickX = i;
|
clickX = i;
|
||||||
clickY = j;
|
clickY = j;
|
||||||
@@ -265,11 +262,6 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseWh
|
|||||||
public final void mouseDragged(MouseEvent e) {
|
public final void mouseDragged(MouseEvent e) {
|
||||||
int x = e.getX();
|
int x = e.getX();
|
||||||
int y = e.getY();
|
int y = e.getY();
|
||||||
if(gameFrame != null) {
|
|
||||||
Insets insets = gameFrame.getInsets();
|
|
||||||
x -= insets.left;//4
|
|
||||||
y -= insets.top;//22
|
|
||||||
}
|
|
||||||
if (mouseWheelDown) {
|
if (mouseWheelDown) {
|
||||||
y = mouseWheelX - e.getX();
|
y = mouseWheelX - e.getX();
|
||||||
int k = mouseWheelY - e.getY();
|
int k = mouseWheelY - e.getY();
|
||||||
@@ -290,10 +282,6 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseWh
|
|||||||
public void mouseMoved(MouseEvent mouseevent) {
|
public void mouseMoved(MouseEvent mouseevent) {
|
||||||
int i = mouseevent.getX();
|
int i = mouseevent.getX();
|
||||||
int j = mouseevent.getY();
|
int j = mouseevent.getY();
|
||||||
if (gameFrame != null) {
|
|
||||||
i -= 4;
|
|
||||||
j -= 22;
|
|
||||||
}
|
|
||||||
idleTime = 0;
|
idleTime = 0;
|
||||||
mouseX = i;
|
mouseX = i;
|
||||||
mouseY = j;
|
mouseY = j;
|
||||||
@@ -498,11 +486,7 @@ public class RSApplet extends Applet implements Runnable, MouseListener, MouseWh
|
|||||||
}
|
}
|
||||||
|
|
||||||
Component getGameComponent() {
|
Component getGameComponent() {
|
||||||
if (gameFrame != null) {
|
return this;
|
||||||
return gameFrame;
|
|
||||||
} else {
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startRunnable(Runnable runnable, int priority) {
|
public void startRunnable(Runnable runnable, int priority) {
|
||||||
|
|||||||
@@ -6,22 +6,18 @@ import java.awt.*;
|
|||||||
|
|
||||||
final class RSFrame extends Frame {
|
final class RSFrame extends Frame {
|
||||||
|
|
||||||
public RSFrame(RSApplet RSApplet_, int i, int j) {
|
public RSFrame(RSApplet RSApplet_) {
|
||||||
rsApplet = RSApplet_;
|
rsApplet = RSApplet_;
|
||||||
setTitle(ClientSettings.SERVER_NAME + " World: " + ClientSettings.SERVER_WORLD);
|
setTitle(ClientSettings.SERVER_NAME + " World: " + ClientSettings.SERVER_WORLD);
|
||||||
setResizable(false);
|
this.setResizable(false);
|
||||||
setMinimumSize(new Dimension(i + 8, j + 28));
|
|
||||||
setVisible(true);
|
|
||||||
toFront();
|
|
||||||
setSize(i + 8, j + 28);
|
|
||||||
setLocationRelativeTo(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
this.setLayout(new BorderLayout());
|
||||||
public Graphics getGraphics() {
|
this.add(rsApplet);
|
||||||
Graphics g = super.getGraphics();
|
this.pack();
|
||||||
g.translate(4, 24);
|
|
||||||
return g;
|
this.setVisible(true);
|
||||||
|
this.toFront();
|
||||||
|
this.setLocationRelativeTo(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user