A RuneTek3 client (377) that is deobfuscated, converted to Kotlin, and includes QoL improvements.
0

Configure Feed

Select the types of activity you want to include in your feed.

Merge remote-tracking branch 'upstream/master' into theblackparade

+47 -41
+31 -26
src/main/java/com/jagex/runescape/GameFrame.java
··· 1 1 package com.jagex.runescape; 2 2 3 - import java.awt.Frame; 4 - import java.awt.Graphics; 3 + import javax.swing.*; 4 + import java.awt.*; 5 5 6 6 @SuppressWarnings("serial") 7 - public class GameFrame extends Frame { 8 - private final GameShell gameStub; 7 + public class GameFrame extends JFrame { 8 + private final GameShell gameStub; 9 + 10 + public GameFrame(GameShell gameStub, int width, int height) { 11 + this.gameStub = gameStub; 12 + pack(); 13 + setTitle("Jagex"); 14 + setResizable(false); 15 + gameStub.extraWidth = getInsets().left + getInsets().right; 16 + gameStub.extraHeight = getInsets().top + getInsets().bottom; 17 + setSize(width + gameStub.extraWidth, height + gameStub.extraHeight); 18 + setVisible(true); 19 + toFront(); 9 20 10 - public GameFrame(GameShell gameStub, int width, int height) { 11 - this.gameStub = gameStub; 12 - setTitle("Jagex"); 13 - setResizable(false); 14 - setSize(width, height + 22); 15 - setVisible(true); 16 - toFront(); 17 - } 21 + 22 + } 18 23 19 - @Override 20 - public Graphics getGraphics() { 21 - Graphics graphics = super.getGraphics(); 22 - graphics.translate(0, 22); 23 - return graphics; 24 - } 24 + @Override 25 + public Graphics getGraphics() { 26 + Graphics graphics = super.getGraphics(); 27 + graphics.translate(gameStub.extraWidth, gameStub.extraHeight); 28 + return graphics; 29 + } 25 30 26 - @Override 27 - public void update(Graphics graphics) { 28 - gameStub.update(graphics); 29 - } 31 + @Override 32 + public void update(Graphics graphics) { 33 + gameStub.update(); 34 + } 30 35 31 - @Override 32 - public void paint(Graphics graphics) { 33 - gameStub.paint(graphics); 34 - } 36 + @Override 37 + public void paint(Graphics graphics) { 38 + gameStub.paint(); 39 + } 35 40 36 41 }
+16 -15
src/main/java/com/jagex/runescape/GameShell.java
··· 11 11 public class GameShell extends Canvas implements Runnable, MouseListener, MouseMotionListener, KeyListener, 12 12 MouseWheelListener, FocusListener, WindowListener { 13 13 14 + 14 15 private int gameState; 15 16 private int deltime = 20; 16 17 public int mindel = 1; ··· 19 20 public boolean dumpRequested = false; 20 21 public int width; 21 22 public int height; 23 + public int extraWidth = 0; 24 + public int extraHeight = 22; 22 25 public Graphics gameGraphics; 23 26 public ProducingGraphicsBuffer imageProducer; 24 27 public ImageRGB aClass50_Sub1_Sub1_Sub1Array16[] = new ImageRGB[6]; ··· 52 55 height = _height; 53 56 gameFrame = new GameFrame(this, width, height); 54 57 gameGraphics = gameFrame.getGraphics(); 58 + // this.height = this.height + this.extraHeight; 59 + // gameGraphics.translate(extraWidth, extraHeight); 55 60 imageProducer = new ProducingGraphicsBuffer(width, height, gameFrame); 56 61 // this.setPreferredSize(new Dimension(width, height)); 57 62 // this.setMaximumSize(new Dimension(width, height)); ··· 65 70 public final void initializeApplet(int width, int height) { 66 71 this.width = width; 67 72 this.height = height; 68 - gameGraphics = getParentComponent().getGraphics(); 73 + gameGraphics = gameFrame.getGraphics(); 69 74 imageProducer = new ProducingGraphicsBuffer(this.width, this.height, getParentComponent()); 70 75 startRunnable(this, 1); 71 76 } ··· 201 206 exit(); 202 207 } 203 208 204 - public void update(Graphics graphics) { 205 - if (gameGraphics == null) 206 - gameGraphics = graphics; 209 + public void update() { 207 210 clearScreen = true; 208 211 redraw(); 209 212 } 210 213 211 - public void paint(Graphics graphics) { 212 - if (gameGraphics == null) 213 - gameGraphics = graphics; 214 + public void paint() { 214 215 clearScreen = true; 215 216 redraw(); 216 217 } ··· 219 220 int mouseX = mouseevent.getX(); 220 221 int mouseY = mouseevent.getY(); 221 222 if (gameFrame != null) { 222 - // mouseX -= 2; 223 - mouseY -= 24; 223 + mouseX -= extraWidth; 224 + mouseY -= 2 + extraHeight; 224 225 } 225 226 idleTime = 0; 226 227 eventClickX = mouseX; ··· 263 264 int mouseX = mouseevent.getX(); 264 265 int mouseY = mouseevent.getY(); 265 266 if (gameFrame != null) { 266 - // mouseX -= 2; 267 - mouseY -= 24; 267 + mouseX -= extraWidth; 268 + mouseY -= 2 + extraHeight; 268 269 } 269 270 if (mouseWheelDown) { 270 271 mouseY = mouseWheelX - mouseevent.getX(); ··· 287 288 int mouseX = mouseevent.getX(); 288 289 int mouseY = mouseevent.getY(); 289 290 if (gameFrame != null) { 290 - // mouseX -= 2; 291 - mouseY -= 24; 291 + mouseX -= extraWidth; 292 + mouseY -= 2 + extraHeight; 292 293 } 293 294 idleTime = 0; 294 295 this.mouseX = mouseX; ··· 532 533 533 534 public void drawLoadingText(int percent, String desc) { 534 535 while (gameGraphics == null) { 535 - gameGraphics = getParentComponent().getGraphics(); 536 + gameGraphics = gameFrame.getGraphics(); 536 537 try { 537 - getParentComponent().repaint(); 538 + gameFrame.repaint(); 538 539 } catch (Exception _ex) { 539 540 } 540 541 try {