Advertisement
Guest User

Untitled

a guest
Apr 7th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 17.94 KB | None | 0 0
  1. import java.applet.Applet;
  2. import java.awt.*;
  3. import java.awt.event.*;
  4.  
  5. public class RSApplet extends Applet implements Runnable, MouseListener, MouseMotionListener, MouseWheelListener, KeyListener, FocusListener, WindowListener {
  6.  
  7.     private static final long serialVersionUID = 1L;
  8.  
  9.     private int anInt4;
  10.     private int delayTime;
  11.     int minDelay;
  12.     private final long aLongArray7[] = new long[10];
  13.     int fps;
  14.     boolean shouldDebug;
  15.     int myWidth;
  16.     int myHeight;
  17.     Graphics graphics;
  18.     RSImageProducer fullGameScreen;
  19.     RSFrame gameFrame;
  20.     private boolean shouldClearScreen;
  21.     boolean awtFocus;
  22.     int idleTime;
  23.     int clickMode2;
  24.     public int mouseX;
  25.     public int mouseY;
  26.     int clickMode1;
  27.     private int clickX;
  28.     private int clickY;
  29.     private long clickTime;
  30.     public long aLong29;
  31.     public int clickMode3;
  32.     public int saveClickX;
  33.     public int saveClickY;
  34.     final int keyArray[] = new int[128];
  35.     private final int charQueue[] = new int[128];
  36.     public boolean isLoading;
  37.     private int readIndex;
  38.     private int writeIndex;
  39.     public static int anInt34;
  40.     public boolean isApplet;
  41.     protected int rotationGliding;
  42.     public boolean resized;
  43.  
  44.     public void rebuildFrame(boolean undecorated, int width, int height, boolean resizable, boolean full) {
  45.         boolean createdByApplet = (isApplet && !full);
  46.         myWidth = width;
  47.         myHeight = height;
  48.         if(gameFrame != null) {
  49.             gameFrame.dispose();
  50.         }
  51.         if (!createdByApplet){
  52.             gameFrame = new RSFrame(this, width, height, undecorated, resizable);
  53.             gameFrame.addWindowListener(this);
  54.         }
  55.         graphics = (createdByApplet ? this : gameFrame).getGraphics();
  56.         if (!createdByApplet) {
  57.             setFocusTraversalKeysEnabled(false);
  58.             getGameComponent().addMouseWheelListener(this);
  59.             getGameComponent().addMouseListener(this);
  60.             getGameComponent().addMouseMotionListener(this);
  61.             getGameComponent().addKeyListener(this);
  62.             getGameComponent().addFocusListener(this);
  63.         }
  64.     }
  65.  
  66.     final void createClientFrame(int w, int h) {
  67.         isApplet = false;
  68.         myWidth = w;
  69.         myHeight = h;
  70.         gameFrame = new RSFrame(this, myWidth, myHeight, Configuration.clientSize == 2, Configuration.clientSize == 1);
  71.         setFocusTraversalKeysEnabled(false);
  72.         graphics = getGameComponent().getGraphics();
  73.         fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
  74.         startRunnable(this, 1);
  75.     }
  76.  
  77.     final void initClientFrame(int w, int h) {
  78.         isApplet = true;
  79.         myWidth = w;
  80.         setFocusTraversalKeysEnabled(false);
  81.         myHeight = h;
  82.         graphics = getGameComponent().getGraphics();
  83.         fullGameScreen = new RSImageProducer(myWidth, myHeight, getGameComponent());
  84.         startRunnable(this, 1);
  85.     }
  86.  
  87.     public void run()
  88.     {
  89.         setFocusTraversalKeysEnabled(false);
  90.         getGameComponent().addMouseListener(this);
  91.         getGameComponent().addMouseMotionListener(this);
  92.         getGameComponent().addKeyListener(this);
  93.         getGameComponent().addFocusListener(this);
  94.         getGameComponent().addMouseWheelListener(this);
  95.         if(gameFrame != null)
  96.         {
  97.             gameFrame.addWindowListener(this);
  98.         }
  99.         drawLoadingText(3, "Checking for updates");
  100.         startUp();
  101.         int i = 0;
  102.         int j = 256;
  103.         int k = 1;
  104.         int l = 0;
  105.         int i1 = 0;
  106.         for(int j1 = 0; j1 < 10; j1++)
  107.         {
  108.             aLongArray7[j1] = System.currentTimeMillis();
  109.         }
  110.         do
  111.         {
  112.             if(anInt4 < 0)
  113.             {
  114.                 break;
  115.             }
  116.             if(anInt4 > 0)
  117.             {
  118.                 anInt4--;
  119.                 if(anInt4 == 0)
  120.                 {
  121.                     exit();
  122.                     return;
  123.                 }
  124.             }
  125.             int k1 = j;
  126.             int i2 = k;
  127.             j = 300;
  128.             k = 1;
  129.             long l2 = System.currentTimeMillis();
  130.             if(aLongArray7[i] == 0L)
  131.             {
  132.                 j = k1;
  133.                 k = i2;
  134.             } else
  135.             if(l2 > aLongArray7[i])
  136.             {
  137.                 j = (int)((long)(2560 * delayTime) / (l2 - aLongArray7[i]));
  138.             }
  139.             if(j < 25)
  140.             {
  141.                 j = 25;
  142.             }
  143.             if(j > 256)
  144.             {
  145.                 j = 256;
  146.                 k = (int)((long)delayTime - (l2 - aLongArray7[i]) / 10L);
  147.             }
  148.             if(k > delayTime)
  149.             {
  150.                 k = delayTime;
  151.             }
  152.             aLongArray7[i] = l2;
  153.             i = (i + 1) % 10;
  154.             if(k > 1)
  155.             {
  156.                 for(int j2 = 0; j2 < 10; j2++)
  157.                 {
  158.                     if(aLongArray7[j2] != 0L)
  159.                     {
  160.                         aLongArray7[j2] += k;
  161.                     }
  162.                 }
  163.  
  164.             }
  165.             if(k < minDelay)
  166.             {
  167.                 k = minDelay;
  168.             }
  169.             try
  170.             {
  171.                 Thread.sleep(k);
  172.             }
  173.             catch(InterruptedException interruptedexception)
  174.             {
  175.                 i1++;
  176.             }
  177.             for(; l < 256; l += j)
  178.             {
  179.                 clickMode3 = clickMode1;
  180.                 saveClickX = clickX;
  181.                 saveClickY = clickY;
  182.                 clickMode1 = 0;
  183.                 processGameLoop();
  184.                 readIndex = writeIndex;
  185.             }
  186.  
  187.             l &= 0xff;
  188.             if(delayTime > 0)
  189.             {
  190.                 fps = (1000 * j) / (delayTime * 256);
  191.             }
  192.             processDrawing();
  193.             if(shouldDebug)
  194.             {
  195.                 System.out.println((new StringBuilder()).append("ntime:").append(l2).toString());
  196.                 for(int k2 = 0; k2 < 10; k2++)
  197.                 {
  198.                     int i3 = ((i - k2 - 1) + 20) % 10;
  199.                     System.out.println((new StringBuilder()).append("otim").append(i3).append(":").append(aLongArray7[i3]).toString());
  200.                 }
  201.  
  202.                 System.out.println((new StringBuilder()).append("fps:").append(fps).append(" ratio:").append(j).append(" count:").append(l).toString());
  203.                 System.out.println((new StringBuilder()).append("del:").append(k).append(" deltime:").append(delayTime).append(" mindel:").append(minDelay).toString());
  204.                 System.out.println((new StringBuilder()).append("intex:").append(i1).append(" opos:").append(i).toString());
  205.                 shouldDebug = false;
  206.                 i1 = 0;
  207.             }
  208.         } while(true);
  209.         if(anInt4 == -1)
  210.         {
  211.             exit();
  212.         }
  213.     }
  214.  
  215.     void drawLoadingText(int percentage, String loadingText) {
  216.         Client.getClient().checkSize();
  217.         while (graphics == null) {
  218.             graphics = (isApplet ? this : gameFrame).getGraphics();
  219.             try {
  220.                 getGameComponent().repaint();
  221.             } catch (Exception _ex) {
  222.             }
  223.             try {
  224.                 Thread.sleep(1000L);
  225.             } catch (Exception _ex) {
  226.             }
  227.         }
  228.         Font font = new Font("Helvetica", 1, 13);
  229.         FontMetrics fontmetrics = getGameComponent().getFontMetrics(font);
  230.         Font font1 = new Font("Helvetica", 0, 13);
  231.         FontMetrics fontmetrics1 = getGameComponent().getFontMetrics(font1);
  232.         if (shouldClearScreen) {
  233.             graphics.setColor(Color.black);
  234.             graphics.fillRect(0, 0, Configuration.clientWidth, Configuration.clientHeight);
  235.             shouldClearScreen = false;
  236.         }
  237.         Color color = new Color(140, 17, 17);
  238.         int y = Configuration.clientHeight / 2 - 18;
  239.         graphics.setColor(color);
  240.         graphics.drawRect(Configuration.clientWidth / 2 - 152, y, 304, 34);
  241.         graphics.fillRect(Configuration.clientWidth / 2 - 150, y + 2, percentage * 3,
  242.                 30);
  243.         graphics.setColor(Color.black);
  244.         graphics.fillRect((Configuration.clientWidth / 2 - 150) + percentage * 3,
  245.                 y + 2, 300 - percentage * 3, 30);
  246.         graphics.setFont(font);
  247.         graphics.setColor(Color.white);
  248.         graphics.drawString(
  249.                 loadingText,
  250.                 (Configuration.clientWidth - fontmetrics.stringWidth(loadingText)) / 2,
  251.                 y + 22);
  252.         graphics.drawString("",
  253.                 (Configuration.clientWidth - fontmetrics1.stringWidth("")) / 2, y - 8);
  254.     }
  255.  
  256.     private void exit()
  257.     {
  258.         anInt4 = -2;
  259.         cleanUpForQuit();
  260.         if(gameFrame != null)
  261.         {
  262.             try
  263.             {
  264.                 Thread.sleep(1000L);
  265.             }
  266.             catch(Exception exception) { }
  267.             try
  268.             {
  269.                 System.exit(0);
  270.             }
  271.             catch(Throwable throwable) { }
  272.         }
  273.     }
  274.  
  275.     final void method4(int i)
  276.     {
  277.         delayTime = 1000 / i;
  278.     }
  279.  
  280.     public final void start()
  281.     {
  282.         if(anInt4 >= 0)
  283.         {
  284.             anInt4 = 0;
  285.         }
  286.     }
  287.  
  288.     public final void stop()
  289.     {
  290.         if(anInt4 >= 0)
  291.         {
  292.             anInt4 = 4000 / delayTime;
  293.         }
  294.     }
  295.  
  296.     public final void destroy()
  297.     {
  298.         anInt4 = -1;
  299.         try
  300.         {
  301.             Thread.sleep(5000L);
  302.         }
  303.         catch(Exception exception) { }
  304.         if(anInt4 == -1)
  305.         {
  306.             exit();
  307.         }
  308.     }
  309.  
  310.     public final void update(Graphics g)
  311.     {
  312.         if(graphics == null)
  313.         {
  314.             graphics = g;
  315.         }
  316.         shouldClearScreen = true;
  317.         raiseWelcomeScreen();
  318.     }
  319.  
  320.     public final void paint(Graphics g)
  321.     {
  322.         if(graphics == null)
  323.         {
  324.             graphics = g;
  325.         }
  326.         shouldClearScreen = true;
  327.         raiseWelcomeScreen();
  328.     }
  329.  
  330.     public boolean canZoom = true;
  331.  
  332.     public void mouseWheelMoved(MouseWheelEvent event) {
  333.         int rotation = event.getWheelRotation();
  334.         handleInterfaceScrolling(event);
  335.         if(mouseX > 0 && mouseX < 512 && mouseY > Configuration.clientHeight - 165 && mouseY < Configuration.clientHeight - 25) {
  336.             int scrollPos = Client.anInt1089;
  337.             scrollPos -= rotation * 30;
  338.             if(scrollPos < 0) {
  339.                 scrollPos = 0;
  340.             }
  341.             if(scrollPos > Client.anInt1211 - 110) {
  342.                 scrollPos = Client.anInt1211 - 110;
  343.             }
  344.  
  345.             if(Client.anInt1089 != scrollPos) {
  346.                 Client.anInt1089 = scrollPos;
  347.                 Client.inputTaken = true;
  348.             }
  349.         }
  350.         if (Configuration.clientSize != 0 && Client.openInterfaceID == -1) {
  351.             if (canZoom) {
  352.                 if (rotation == -1) {
  353.                     if(mouseX > 0 && mouseX < 512 && mouseY > Configuration.clientHeight - 165 && mouseY < Configuration.clientHeight - 25) {
  354.                         return;
  355.                     }
  356.                     if (Client.cameraZoom > 200) {
  357.                         Client.cameraZoom -= 50;
  358.                     }
  359.                 } else {
  360.                     if (Client.cameraZoom < 900) {
  361.                         Client.cameraZoom += 50;
  362.                     }
  363.                 }
  364.             }
  365.         }
  366.     }
  367.  
  368.  
  369.     public void handleInterfaceScrolling(MouseWheelEvent event) {
  370.         int rotation = event.getWheelRotation();
  371.         int positionX = 0;
  372.         int positionY = 0;
  373.         int width = 0;
  374.         int height = 0;
  375.         int offsetX = 0;
  376.         int offsetY = 0;
  377.         int childID = 0;
  378.         /* Tab interface scrolling */
  379.         int tabInterfaceID = Client.tabInterfaceIDs[Client.tabID];
  380.         if (tabInterfaceID != -1) {
  381.             RSInterface tab = RSInterface.interfaceCache[tabInterfaceID];
  382.             offsetX = Configuration.clientSize == 0 ? Configuration.clientWidth - 218 : (Configuration.clientSize == 0 ? 28 : Configuration.clientWidth - 197);
  383.             offsetY = Configuration.clientSize == 0 ? Configuration.clientHeight - 298 : (Configuration.clientSize == 0 ? 37 : Configuration.clientHeight - (Configuration.clientWidth >= 900 ? 37 : 74) - 267);
  384.             if (tab.children == null) {
  385.                 return;
  386.             }
  387.             for (int index = 0; index < tab.children.length; index++) {
  388.                 if (RSInterface.interfaceCache[tab.children[index]].scrollMax > 0) {
  389.                     childID = index;
  390.                     positionX = tab.childX[index];
  391.                     positionY = tab.childY[index];
  392.                     width = RSInterface.interfaceCache[tab.children[index]].width;
  393.                     height = RSInterface.interfaceCache[tab.children[index]].height;
  394.                     break;
  395.                 }
  396.             }
  397.             if (mouseX > offsetX + positionX && mouseY > offsetY + positionY && mouseX < offsetX + positionX + width && mouseY < offsetY + positionY + height) {
  398.                 canZoom = false;
  399.             } else {
  400.                 canZoom = true;
  401.             }
  402.             if (mouseX > offsetX + positionX && mouseY > offsetY + positionY && mouseX < offsetX + positionX + width && mouseY < offsetY + positionY + height) {
  403.                 if (RSInterface.interfaceCache[tab.children[childID]].scrollPosition > 0) {
  404.                     RSInterface.interfaceCache[tab.children[childID]].scrollPosition += rotation * 30;
  405.                     return;
  406.                 } else {
  407.                     if (rotation > 0) {
  408.                         RSInterface.interfaceCache[tab.children[childID]].scrollPosition += rotation * 30;
  409.                         return;
  410.                     }
  411.                 }
  412.             }
  413.         }
  414.         /* Main interface scrolling */
  415.         if (Client.openInterfaceID != -1) {
  416.             RSInterface rsi = RSInterface.interfaceCache[Client.openInterfaceID];
  417.             offsetX = Configuration.clientSize == 0 ? 4 : (Configuration.clientWidth / 2) - 256;
  418.             offsetY = Configuration.clientSize == 0 ? 4 : (Configuration.clientHeight / 2) - 167;
  419.             for (int index = 0; index < rsi.children.length; index++) {
  420.                 if (RSInterface.interfaceCache[rsi.children[index]].scrollMax > 0) {
  421.                     childID = index;
  422.                     positionX = rsi.childX[index];
  423.                     positionY = rsi.childY[index];
  424.                     width = RSInterface.interfaceCache[rsi.children[index]].width;
  425.                     height = RSInterface.interfaceCache[rsi.children[index]].height;
  426.                     break;
  427.                 }
  428.             }
  429.             if (mouseX > offsetX + positionX && mouseY > offsetY + positionY && mouseX < offsetX + positionX + width && mouseY < offsetY + positionY + height) {
  430.                 canZoom = false;
  431.             } else {
  432.                 canZoom = true;
  433.             }
  434.             if (mouseX > offsetX + positionX && mouseY > offsetY + positionY && mouseX < offsetX + positionX + width && mouseY < offsetY + positionY + height) {
  435.                 if (RSInterface.interfaceCache[rsi.children[childID]].scrollPosition > 0) {
  436.                     RSInterface.interfaceCache[rsi.children[childID]].scrollPosition += rotation * 30;
  437.                     return;
  438.                 } else {
  439.                     if (rotation > 0) {
  440.                         RSInterface.interfaceCache[rsi.children[childID]].scrollPosition += rotation * 30;
  441.                         return;
  442.                     }
  443.                 }
  444.             }
  445.         }
  446.     }
  447.  
  448.     public int clickType;
  449.     public final int LEFT = 0;
  450.     public final int RIGHT = 1;
  451.     public final int DRAG = 2;
  452.     public final int RELEASED = 3;
  453.     public final int MOVE = 4;
  454.     public int releasedX;
  455.     public int releasedY;
  456.     public boolean mouseWheelDown;
  457.  
  458.     public final void mousePressed(MouseEvent mouseevent) {
  459.         int i = mouseevent.getX();
  460.         int j = mouseevent.getY();
  461.         if (gameFrame != null) {
  462.             Insets insets = gameFrame.getInsets();
  463.             i -= insets.left;// 4
  464.             j -= insets.top;// 22
  465.         }
  466.         idleTime = 0;
  467.         clickX = i;
  468.         clickY = j;
  469.         clickTime = System.currentTimeMillis();
  470.         if(mouseevent.getButton() == 2) {
  471.             mouseWheelDown = true;
  472.             mouseWheelX = i;
  473.             mouseWheelY = j;
  474.             return;
  475.         }
  476.         if (mouseevent.isMetaDown()) {
  477.             clickType = RIGHT;
  478.             clickMode1 = 2;
  479.             clickMode2 = 2;
  480.         } else {
  481.             clickType = LEFT;
  482.             clickMode1 = 1;
  483.             clickMode2 = 1;
  484.         }
  485.     }
  486.  
  487.  
  488.     public final void mouseReleased(MouseEvent e) {
  489.         int x = e.getX();
  490.         int y = e.getY();
  491.         if(gameFrame != null) {
  492.             Insets insets = gameFrame.getInsets();
  493.             x -= insets.left;//4
  494.             y -= insets.top;//22
  495.         }
  496.         releasedX = x;
  497.         releasedY = y;
  498.         idleTime = 0;
  499.         clickMode2 = 0;
  500.         clickType = RELEASED;
  501.         mouseWheelDown = false;
  502.     }
  503.  
  504.     public final void mouseClicked(MouseEvent mouseevent)
  505.     {
  506.     }
  507.  
  508.     public final void mouseEntered(MouseEvent mouseevent)
  509.     {
  510.     }
  511.  
  512.     public final void mouseExited(MouseEvent mouseevent)
  513.     {
  514.         idleTime = 0;
  515.         mouseX = -1;
  516.         mouseY = -1;
  517.     }
  518.  
  519.     public int mouseWheelX;
  520.     public int mouseWheelY;
  521.     public final void mouseDragged(MouseEvent mouseevent) {
  522.         if (Client.instance.variousSettings[314] == 0) {
  523.             int i = mouseevent.getX();
  524.             int j = mouseevent.getY();
  525.             if (gameFrame != null) {
  526.                 Insets insets = gameFrame.getInsets();
  527.                 i -= insets.left;
  528.                 j -= insets.top;
  529.             }
  530.             if (System.currentTimeMillis() - clickTime >= 250L
  531.                     || Math.abs(saveClickX - i) > 5 || Math.abs(saveClickY - j) > 5) {
  532.                 idleTime = 3;
  533.                 mouseX = i;
  534.                 mouseY = j;
  535.             }
  536.             if (mouseWheelDown) {
  537.                 j = mouseWheelX - mouseevent.getX();
  538.                 int k = mouseWheelY - mouseevent.getY();
  539.                 Client.instance.mouseWheelDragged(j, -k);
  540.                 mouseWheelX = mouseevent.getX();
  541.                 mouseWheelY = mouseevent.getY();
  542.                 return;
  543.             }
  544.             clickType = DRAG;
  545.         }
  546.     }
  547.  
  548.     void mouseWheelDragged(int param1, int param2) {
  549.  
  550.     }
  551.  
  552.     public final void mouseMoved(MouseEvent mouseevent) {
  553.         int x = mouseevent.getX();
  554.         int y = mouseevent.getY();
  555.         if(gameFrame != null) {
  556.             Insets insets = gameFrame.getInsets();
  557.             x -= insets.left;//4
  558.             y -= insets.top;//22
  559.         }
  560.         idleTime = 0;
  561.         mouseX = x;
  562.         mouseY = y;
  563.         clickType = MOVE;
  564.     }
  565.  
  566.     public final void keyPressed(KeyEvent keyevent) {
  567.         idleTime = 0;
  568.         int i = keyevent.getKeyCode();
  569.         int j = keyevent.getKeyChar();
  570.         if (i == KeyEvent.VK_F1) {
  571.             Client.setTab(3);
  572.         } else if (i == KeyEvent.VK_ESCAPE) {
  573.             Client.setTab(10);
  574.         } else if (i == KeyEvent.VK_F2) {
  575.             Client.setTab(4);
  576.         } else if (i == KeyEvent.VK_F3) {
  577.             Client.setTab(5);
  578.         } else if (i == KeyEvent.VK_F4) {
  579.             Client.setTab(6);
  580.         } else if (i == KeyEvent.VK_F5) {
  581.             Client.setTab(0);
  582.         }
  583.         if(j < 30)
  584.             j = 0;
  585.         if(i == 37)
  586.             j = 1;
  587.         if(i == 39)
  588.             j = 2;
  589.         if(i == 38)
  590.             j = 3;
  591.         if(i == 40)
  592.             j = 4;
  593.         if(i == 17)
  594.             j = 5;
  595.         if(i == 8)
  596.             j = 8;
  597.         if(i == 127)
  598.             j = 8;
  599.         if(i == 9)
  600.             j = 9;
  601.         if(i == 10)
  602.             j = 10;
  603.         if(i >= 112 && i <= 123)
  604.             j = (1008 + i) - 112;
  605.         if(i == 36)
  606.             j = 1000;
  607.         if(i == 35)
  608.             j = 1001;
  609.         if(i == 33)
  610.             j = 1002;
  611.         if(i == 34)
  612.             j = 1003;
  613.         if(j > 0 && j < 128)
  614.             keyArray[j] = 1;
  615.         if(j > 4)
  616.         {
  617.             charQueue[writeIndex] = j;
  618.             writeIndex = writeIndex + 1 & 0x7f;
  619.         }
  620.     }
  621.  
  622.     public final void keyReleased(KeyEvent keyevent)
  623.     {
  624.         idleTime = 0;
  625.         int i = keyevent.getKeyCode();
  626.         char c = keyevent.getKeyChar();
  627.         if(c < '\036')
  628.             c = '\0';
  629.         if(i == 37)
  630.             c = '\001';
  631.         if(i == 39)
  632.             c = '\002';
  633.         if(i == 38)
  634.             c = '\003';
  635.         if(i == 40)
  636.             c = '\004';
  637.         if(i == 17)
  638.             c = '\005';
  639.         if(i == 8)
  640.             c = '\b';
  641.         if(i == 127)
  642.             c = '\b';
  643.         if(i == 9)
  644.             c = '\t';
  645.         if(i == 10)
  646.             c = '\n';
  647.         if(c > 0 && c < '\200')
  648.             keyArray[c] = 0;
  649.     }
  650.  
  651.     public final void keyTyped(KeyEvent keyevent)
  652.     {
  653.     }
  654.  
  655.     final int readChar(int dummy)
  656.     {
  657.         while(dummy >= 0)
  658.         {
  659.             for(int j = 1; j > 0; j++);
  660.         }
  661.         int k = -1;
  662.         if(writeIndex != readIndex)
  663.         {
  664.             k = charQueue[readIndex];
  665.             readIndex = readIndex + 1 & 0x7f;
  666.         }
  667.         return k;
  668.     }
  669.  
  670.     public final void focusGained(FocusEvent focusevent)
  671.     {
  672.         awtFocus = true;
  673.         shouldClearScreen = true;
  674.         raiseWelcomeScreen();
  675.     }
  676.  
  677.     public final void focusLost(FocusEvent focusevent)
  678.     {
  679.         awtFocus = false;
  680.         for(int i = 0; i < 128; i++)
  681.         {
  682.             keyArray[i] = 0;
  683.         }
  684.  
  685.     }
  686.  
  687.     public final void windowActivated(WindowEvent windowevent)
  688.     {
  689.     }
  690.  
  691.     public final void windowClosed(WindowEvent windowevent)
  692.     {
  693.     }
  694.  
  695.     public final void windowClosing(WindowEvent windowevent)
  696.     {
  697.         destroy();
  698.  
  699.     }
  700.  
  701.     public final void windowDeactivated(WindowEvent windowevent)
  702.     {
  703.     }
  704.  
  705.     public final void windowDeiconified(WindowEvent windowevent)
  706.     {
  707.     }
  708.  
  709.     public final void windowIconified(WindowEvent windowevent)
  710.     {
  711.     }
  712.  
  713.     public final void windowOpened(WindowEvent windowevent)
  714.     {
  715.     }
  716.  
  717.     void startUp()
  718.     {
  719.     }
  720.  
  721.     void processGameLoop()
  722.     {
  723.     }
  724.  
  725.     void cleanUpForQuit()
  726.     {
  727.     }
  728.  
  729.     void processDrawing()
  730.     {
  731.     }
  732.  
  733.     void raiseWelcomeScreen()
  734.     {
  735.     }
  736.  
  737.     Component getGameComponent() {
  738.         if(gameFrame != null && !isApplet) {
  739.             return gameFrame;
  740.         } else {
  741.             return this;
  742.         }
  743.     }
  744.  
  745.     public void startRunnable(Runnable runnable, int i)
  746.     {
  747.         Thread thread = new Thread(runnable);
  748.         thread.start();
  749.         thread.setPriority(i);
  750.     }
  751.  
  752.  
  753.     RSApplet() {
  754.         delayTime = 20;
  755.         minDelay = 1;
  756.         shouldDebug = false;
  757.         shouldClearScreen = true;
  758.         awtFocus = true;
  759.     }
  760.  
  761. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement