Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rectangle tab1 = new Rectangle(496, 345, 30, 30);
- //format is rectangle(xCORD, yCORD, WIDTH, HEIGHT)//
- Rectangle tab2 = new Rectangle(496, 345, 30, 30);
- int tab = 1;
- Point p;
- public void mouseClicked(MouseEvent e){
- p = e.getPoint();
- if(tab1.contains(p)){
- tab = 1;
- showPaint = true;
- }
- if(tab2.contains(p)){
- tab = 2;
- showPaint = false;
- }
- }
- public void mouseEntered(MouseEvent e){
- }
- public void mouseExited(MouseEvent e){
- }
- public void mouseReleased(MouseEvent e){
- }
- public void mousePressed(MouseEvent e){
- }
- public void onRepaint(Graphics g1) {
- Graphics2D g = (Graphics2D)g1;
- if (game.isLoggedIn() && !game.isWelcomeScreen())
- {
- millis = System.currentTimeMillis() - startTime;
- hours = millis / (1000 * 60 * 60);
- millis -= hours * (1000 * 60 * 60);
- minutes = millis / (1000 * 60);
- millis -= minutes * (1000 * 60);
- seconds = millis / 1000;
- currLevel = skills.getCurrentLevel(Skills.PRAYER);
- currXP = skills.getCurrentExp(Skills.PRAYER);
- lvlsGained = currLevel - startLevel;
- expGained = currXP - startExp;
- expToLevel = skills.getExpToNextLevel(Skills.PRAYER);
- percentTNL = skills.getPercentToNextLevel(skills.PRAYER);
- expHour = (int) ((expGained) * 3600000D / (System.currentTimeMillis() - startTime));
- final int percentBar = (int) (skills.getPercentToNextLevel(Skills.PRAYER)*0.52);
- if ((minutes > 0 || hours > 0 || seconds > 0) && expGained > 0) {
- sXP = (float) expGained
- / (float) (seconds + minutes * 60 + hours * 60 * 60);
- }
- mXP = sXP * 60;
- hXP = mXP * 60;
- if (sXP > 0) {
- STL = (int) (expToLevel / sXP);
- }
- if (STL >= 60) {
- MTL = STL / 60;
- STL -= MTL * 60;
- } else {
- MTL = 0;
- }
- if (MTL >= 60) {
- HTL = MTL / 60;
- MTL -= HTL * 60;
- } else {
- HTL = 0;
- }
- if (clicked != null) {
- final int mx = (int)mouse.getLocation().getX();
- final int my = (int)mouse.getLocation().getY();
- final long mpt = System.currentTimeMillis() - mouse.getPressTime();
- if (mouse.getPressTime() == -1 || mpt >= 300)
- g.drawImage(normal, mx - 10, my - 6, null);
- if (mpt < 300)
- g.drawImage(clicked, mx - 10, my - 6, null);
- }
- if(showPaint == true) {
- //this is so you can see where the location is at, you can delete these once you get the correct size and cords//
- g.setRenderingHints(antialiasing);
- g.setColor(color1);
- g.fillRect(279, 351, 214, 104);
- g.setStroke(stroke1);
- g.drawRect(279, 351, 214, 104);
- g.setColor(color2);
- g.fillRect(276, 348, 214, 104);
- g.setColor(color7);
- g.drawRect(276, 348, 214, 104);
- g.setFont(font1);
- g.drawString("Grave Digger", 312, 364);
- g.setFont(font2);
- g.drawString("v1.2", 424, 366);
- g.setFont(font3);
- g.drawString("Bones Burried : " + bonesburied , 282, 382);
- g.drawString("Exp Gained : " + expGained, 282, 394);
- g.drawString("Current Level : " + currLevel, 280, 408);
- g.drawString("Runtime : " +hours + ":" + minutes + ":" + seconds, 282, 436);
- g.drawString("Time TNL : " + HTL + ":" + MTL + ":" + STL, 282, 422);
- g.drawImage(Zomzom, 444, 392, null);
- g.setFont(font4);
- g.setColor(color3);
- g.drawString("© Ministry", 444, 448);
- g.drawImage(pBar, 461, 480, null);
- g.setColor(color4);
- g.fillRoundRect(461, 480, percentBar, 22, 5, 5);
- g.setFont(font3);
- g.setColor(color5);
- g.drawString( percentTNL + " %", 468, 497);
- tab = 1;
- }
- if (tab == 1){
- showPaint = true;
- g.drawImage(Himg, 496, 345, null);
- g.drawRect(tab1.x, tab1.y, tab1.width, tab1.height);}
- g.fillRect(496, 346, 14, 12);
- if (tab == 2) {
- showPaint = false;
- g.drawRect(tab2.x, tab2.y, tab1.width, tab2.height);
- g.fillRect(496, 346, 14, 12);
- g.drawImage(Simg, 496, 345, null);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment