Search in sources :

Example 26 with ObfuscatedSignature

use of net.runelite.mapping.ObfuscatedSignature in project runelite by runelite.

the class GameEngine method error.

@ObfuscatedName("ax")
@ObfuscatedSignature(signature = "(Ljava/lang/String;I)V", garbageValue = "-1241225209")
@Export("error")
protected void error(String var1) {
    if (!this.hasErrored) {
        this.hasErrored = true;
        System.out.println("error_game_" + var1);
        try {
            this.getAppletContext().showDocument(new URL(this.getCodeBase(), "error_game_" + var1 + ".ws"), "_self");
        } catch (Exception var3) {
            ;
        }
    }
}
Also used : URL(java.net.URL) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 27 with ObfuscatedSignature

use of net.runelite.mapping.ObfuscatedSignature in project runelite by runelite.

the class GameEngine method replaceCanvas.

@ObfuscatedName("ap")
@ObfuscatedSignature(signature = "(I)V", garbageValue = "-645526426")
@Export("replaceCanvas")
final synchronized void replaceCanvas() {
    Container var1 = this.container();
    if (this.canvas != null) {
        this.canvas.removeFocusListener(this);
        var1.remove(this.canvas);
    }
    Sequence.canvasWidth = Math.max(var1.getWidth(), this.field672);
    class45.canvasHeight = Math.max(var1.getHeight(), this.field674);
    Insets var2;
    if (this.frame != null) {
        var2 = this.frame.getInsets();
        Sequence.canvasWidth -= var2.right + var2.left;
        class45.canvasHeight -= var2.bottom + var2.top;
    }
    this.canvas = new GameCanvas(this);
    var1.add(this.canvas);
    this.canvas.setSize(Sequence.canvasWidth, class45.canvasHeight);
    this.canvas.setVisible(true);
    this.canvas.setBackground(Color.BLACK);
    if (var1 == this.frame) {
        var2 = this.frame.getInsets();
        this.canvas.setLocation(this.field660 + var2.left, this.field657 + var2.top);
    } else {
        this.canvas.setLocation(this.field660, this.field657);
    }
    this.canvas.addFocusListener(this);
    this.canvas.requestFocus();
    this.field692 = true;
    if (class324.rasterProvider != null && Sequence.canvasWidth == class324.rasterProvider.width && class45.canvasHeight == class324.rasterProvider.height) {
        ((MainBufferProvider) class324.rasterProvider).replaceComponent(this.canvas);
        class324.rasterProvider.drawFull(0, 0);
    } else {
        class324.rasterProvider = new MainBufferProvider(Sequence.canvasWidth, class45.canvasHeight, this.canvas);
    }
    this.field682 = false;
    this.field665 = ScriptVarType.method28();
}
Also used : Container(java.awt.Container) Insets(java.awt.Insets) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 28 with ObfuscatedSignature

use of net.runelite.mapping.ObfuscatedSignature in project runelite by runelite.

the class GameEngine method setUpKeyboard.

@ObfuscatedName("a")
@ObfuscatedSignature(signature = "(I)V", garbageValue = "1115910435")
@Export("setUpKeyboard")
protected final void setUpKeyboard() {
    if (class241.javaVendor.toLowerCase().indexOf("microsoft") != -1) {
        KeyFocusListener.KeyHandler_keyCodes[186] = 57;
        KeyFocusListener.KeyHandler_keyCodes[187] = 27;
        KeyFocusListener.KeyHandler_keyCodes[188] = 71;
        KeyFocusListener.KeyHandler_keyCodes[189] = 26;
        KeyFocusListener.KeyHandler_keyCodes[190] = 72;
        KeyFocusListener.KeyHandler_keyCodes[191] = 73;
        KeyFocusListener.KeyHandler_keyCodes[192] = 58;
        KeyFocusListener.KeyHandler_keyCodes[219] = 42;
        KeyFocusListener.KeyHandler_keyCodes[220] = 74;
        KeyFocusListener.KeyHandler_keyCodes[221] = 43;
        KeyFocusListener.KeyHandler_keyCodes[222] = 59;
        KeyFocusListener.KeyHandler_keyCodes[223] = 28;
    } else {
        KeyFocusListener.KeyHandler_keyCodes[44] = 71;
        KeyFocusListener.KeyHandler_keyCodes[45] = 26;
        KeyFocusListener.KeyHandler_keyCodes[46] = 72;
        KeyFocusListener.KeyHandler_keyCodes[47] = 73;
        KeyFocusListener.KeyHandler_keyCodes[59] = 57;
        KeyFocusListener.KeyHandler_keyCodes[61] = 27;
        KeyFocusListener.KeyHandler_keyCodes[91] = 42;
        KeyFocusListener.KeyHandler_keyCodes[92] = 74;
        KeyFocusListener.KeyHandler_keyCodes[93] = 43;
        KeyFocusListener.KeyHandler_keyCodes[192] = 28;
        KeyFocusListener.KeyHandler_keyCodes[222] = 58;
        KeyFocusListener.KeyHandler_keyCodes[520] = 59;
    }
    Canvas var1 = this.canvas;
    var1.setFocusTraversalKeysEnabled(false);
    var1.addKeyListener(KeyFocusListener.keyboard);
    var1.addFocusListener(KeyFocusListener.keyboard);
}
Also used : Canvas(java.awt.Canvas) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 29 with ObfuscatedSignature

use of net.runelite.mapping.ObfuscatedSignature in project runelite by runelite.

the class GameEngine method method891.

@ObfuscatedName("ab")
@ObfuscatedSignature(signature = "(I)V", garbageValue = "-1141037424")
void method891() {
    Container var1 = this.container();
    long var2 = ScriptVarType.method28();
    long var4 = field667[class173.field2242];
    field667[class173.field2242] = var2;
    class173.field2242 = class173.field2242 + 1 & 31;
    if (0L != var4 && var2 > var4) {
        int var6 = (int) (var2 - var4);
        FPS = ((var6 >> 1) + 32000) / var6;
    }
    if (++field680 - 1 > 50) {
        field680 -= 50;
        this.field692 = true;
        this.canvas.setSize(Sequence.canvasWidth, class45.canvasHeight);
        this.canvas.setVisible(true);
        if (var1 == this.frame) {
            Insets var7 = this.frame.getInsets();
            this.canvas.setLocation(var7.left + this.field660, var7.top + this.field657);
        } else {
            this.canvas.setLocation(this.field660, this.field657);
        }
    }
    if (this.field682) {
        this.method921();
    }
    this.method892();
    this.methodDraw(this.field692);
    if (this.field692) {
        this.method885();
    }
    this.field692 = false;
}
Also used : Container(java.awt.Container) Insets(java.awt.Insets) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Example 30 with ObfuscatedSignature

use of net.runelite.mapping.ObfuscatedSignature in project runelite by runelite.

the class GameEngine method drawLoadingScreen.

@ObfuscatedName("af")
@ObfuscatedSignature(signature = "(ILjava/lang/String;ZI)V", garbageValue = "1952519462")
@Export("drawLoadingScreen")
protected final void drawLoadingScreen(int var1, String var2, boolean var3) {
    try {
        Graphics var4 = this.canvas.getGraphics();
        if (IndexFile.field2249 == null) {
            IndexFile.field2249 = new java.awt.Font("Helvetica", 1, 13);
            CacheFile.field1676 = this.canvas.getFontMetrics(IndexFile.field2249);
        }
        if (var3) {
            var4.setColor(Color.black);
            var4.fillRect(0, 0, Sequence.canvasWidth, class45.canvasHeight);
        }
        Color var5 = new Color(140, 17, 17);
        try {
            if (Size.field348 == null) {
                Size.field348 = this.canvas.createImage(304, 34);
            }
            Graphics var6 = Size.field348.getGraphics();
            var6.setColor(var5);
            var6.drawRect(0, 0, 303, 33);
            var6.fillRect(2, 2, var1 * 3, 30);
            var6.setColor(Color.black);
            var6.drawRect(1, 1, 301, 31);
            var6.fillRect(var1 * 3 + 2, 2, 300 - var1 * 3, 30);
            var6.setFont(IndexFile.field2249);
            var6.setColor(Color.white);
            var6.drawString(var2, (304 - CacheFile.field1676.stringWidth(var2)) / 2, 22);
            var4.drawImage(Size.field348, Sequence.canvasWidth / 2 - 152, class45.canvasHeight / 2 - 18, (ImageObserver) null);
        } catch (Exception var9) {
            int var7 = Sequence.canvasWidth / 2 - 152;
            int var8 = class45.canvasHeight / 2 - 18;
            var4.setColor(var5);
            var4.drawRect(var7, var8, 303, 33);
            var4.fillRect(var7 + 2, var8 + 2, var1 * 3, 30);
            var4.setColor(Color.black);
            var4.drawRect(var7 + 1, var8 + 1, 301, 31);
            var4.fillRect(var1 * 3 + var7 + 2, var8 + 2, 300 - var1 * 3, 30);
            var4.setFont(IndexFile.field2249);
            var4.setColor(Color.white);
            var4.drawString(var2, var7 + (304 - CacheFile.field1676.stringWidth(var2)) / 2, var8 + 22);
        }
    } catch (Exception var10) {
        this.canvas.repaint();
    }
}
Also used : Graphics(java.awt.Graphics) Color(java.awt.Color) Export(net.runelite.mapping.Export) ObfuscatedSignature(net.runelite.mapping.ObfuscatedSignature) ObfuscatedName(net.runelite.mapping.ObfuscatedName)

Aggregations

ObfuscatedSignature (net.runelite.mapping.ObfuscatedSignature)72 ObfuscatedName (net.runelite.mapping.ObfuscatedName)71 Iterator (java.util.Iterator)30 Export (net.runelite.mapping.Export)22 IOException (java.io.IOException)10 LinkedList (java.util.LinkedList)10 List (java.util.List)6 Container (java.awt.Container)5 Insets (java.awt.Insets)5 HashSet (java.util.HashSet)5 JSObject (netscape.javascript.JSObject)5 URL (java.net.URL)4 HashMap (java.util.HashMap)4 ByteArrayInputStream (java.io.ByteArrayInputStream)3 URI (java.net.URI)3 Canvas (java.awt.Canvas)2 Graphics (java.awt.Graphics)2 BufferedImage (java.awt.image.BufferedImage)2 PixelGrabber (java.awt.image.PixelGrabber)2 File (java.io.File)2