Thread: Custom Cursors drop my frames to 14 when I right click

Results 1 to 6 of 6
  1. #1 Custom Cursors drop my frames to 14 when I right click 
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Title basically explains it. Added the new runescape cursors but when I right click my frames drop significantly.





    Code:
    	public void processRightClick459() {
    		if (activeInterfaceType != 0)
    			return;
    		menuActionName[0] = "Cancel";
    		menuActionID[0] = 1107;
    		menuActionRow = 1;
    		if (fullscreenInterfaceID != -1) {
    			anInt886 = 0;
    			anInt1315 = 0;
    			buildInterfaceMenu(8,
    					RSInterface.interfaceCache[fullscreenInterfaceID],
    					super.mouseX, 8, super.mouseY, 0);
    			if (anInt886 != anInt1026) {
    				anInt1026 = anInt886;
    			}
    			if (anInt1315 != anInt1129) {
    				anInt1129 = anInt1315;
    			}
    			return;
    		}
    		buildSplitPrivateChatMenu();
    		anInt886 = 0;
    		if (super.mouseX > 4 && super.mouseY > 4 && super.mouseX < 516
    				&& super.mouseY < 338)
    			if (openInterfaceID != -1)
    				buildInterfaceMenu(4,
    						RSInterface.interfaceCache[openInterfaceID],
    						super.mouseX, 4, super.mouseY, 0);
    			else
    				build3dScreenMenu();
    		if (anInt886 != anInt1026)
    			anInt1026 = anInt886;
    		anInt886 = 0;
    		if (super.mouseX > 553 && super.mouseY > 205 && super.mouseX < 743
    				&& super.mouseY < 466)
    			if (invOverlayInterfaceID != -1)
    				buildInterfaceMenu(553,
    						RSInterface.interfaceCache[invOverlayInterfaceID],
    						super.mouseX, 205, super.mouseY, 0);
    			else if (tabInterfaceIDs[tabID] != -1)
    				buildInterfaceMenu(553,
    						RSInterface.interfaceCache[tabInterfaceIDs[tabID]],
    						super.mouseX, 205, super.mouseY, 0);
    		if (anInt886 != anInt1048) {
    			needDrawTabArea = true;
    			anInt1048 = anInt886;
    		}
    		if (anInt1315 != anInt1129) {
    			anInt1129 = anInt1315;
    		}
    		anInt886 = 0;
    		anInt1315 = 0;
    		/* Chat area clicking */
    		if (super.mouseX > 17 && super.mouseY > 357 && super.mouseX < 496
    				&& super.mouseY < 453)
    			if (backDialogID != -1)
    				buildInterfaceMenu(17,
    						RSInterface.interfaceCache[backDialogID], super.mouseX,
    						357, super.mouseY, 0);
    			else if (super.mouseY < 434 && super.mouseX < 426)
    				buildChatAreaMenu(super.mouseY - 357);
    		if (backDialogID != -1 && anInt886 != anInt1039) {
    			inputTaken = true;
    			anInt1039 = anInt886;
    		}
    		if (super.mouseX >= 515 && super.mouseY >= 0 && super.mouseX <= 765
    				&& super.mouseY <= 167)
    			if (openInterfaceID != -1)
    				buildInterfaceMenu(0,
    						RSInterface.interfaceCache[openInterfaceID],
    						super.mouseX, 0, super.mouseY, 0);
    		if (anInt886 != anInt1026)
    			anInt1026 = anInt886;
    		anInt886 = 0;
    		processMinimapActions459();
    		boolean flag = false;
    		while (!flag) {
    			flag = true;
    			for (int j = 0; j < menuActionRow - 1; j++)
    				if (menuActionID[j] < 1000 && menuActionID[j + 1] > 1000) {
    					String s = menuActionName[j];
    					menuActionName[j] = menuActionName[j + 1];
    					menuActionName[j + 1] = s;
    					int k = menuActionID[j];
    					menuActionID[j] = menuActionID[j + 1];
    					menuActionID[j + 1] = k;
    					k = menuActionCmd2[j];
    					menuActionCmd2[j] = menuActionCmd2[j + 1];
    					menuActionCmd2[j + 1] = k;
    					k = menuActionCmd3[j];
    					menuActionCmd3[j] = menuActionCmd3[j + 1];
    					menuActionCmd3[j + 1] = k;
    					k = menuActionCmd1[j];
    					menuActionCmd1[j] = menuActionCmd1[j + 1];
    					menuActionCmd1[j + 1] = k;
    					flag = false;
    				}
    		}
    	}
    I actually figured it out to be in this method

    Code:
    	private void drawMenu(int xOffSet, int yOffSet) {
    		//if (Config.NewCursors) {
    		super.setCursor(0);
    		//}
    		int xPos = menuOffsetX - (xOffSet - 4);
    		int yPos = (-yOffSet + 4) + menuOffsetY;
    		int menuW = menuWidth;
    		int menuH = menuHeight + 1;
    		inputTaken = true;
    		tabAreaAltered = true;
    		DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos, 0x706a5e, menuW);
    		DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 1, 0x706a5e,
    				menuW - 2);
    		DrawingArea.drawPixels(menuH, yPos, xPos + 2, 0x706a5e, menuW - 4);
    		DrawingArea.drawPixels(menuH - 2, yPos + 1, xPos + 3, 0x2d2822,
    				menuW - 6);
    		DrawingArea.drawPixels(menuH - 4, yPos + 2, xPos + 2, 0x2d2822,
    				menuW - 4);
    		DrawingArea.drawPixels(menuH - 6, yPos + 3, xPos + 1, 0x2d2822,
    				menuW - 2);
    		DrawingArea.drawPixels(menuH - 22, yPos + 19, xPos + 2, 0x524a3d,
    				menuW - 4);
    		DrawingArea.drawPixels(menuH - 22, yPos + 20, xPos + 3, 0x524a3d,
    				menuW - 6);
    		DrawingArea.drawPixels(menuH - 23, yPos + 20, xPos + 3, 0x2b271c,
    				menuW - 6);
    		DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x2a291b, yPos + 2);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a261b, yPos + 3);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x252116, yPos + 4);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x211e15, yPos + 5);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1e1b12, yPos + 6);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x1a170e, yPos + 7);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 2, 0x15120b, yPos + 8);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x100d08, yPos + 10);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 11);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x080703, yPos + 12);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 13);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 14);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 15);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x070802, yPos + 16);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x090a04, yPos + 17);
    		DrawingArea.fillPixels(xPos + 2, menuW - 4, 1, 0x2a291b, yPos + 18);
    		DrawingArea.fillPixels(xPos + 3, menuW - 6, 1, 0x564943, yPos + 19);
    		chatTextDrawingArea.method385(0xc6b895, "Choose Option", yPos + 14,
    				xPos + 3);
    		int mouseX = super.mouseX - (xOffSet);
    		int mouseY = (-yOffSet) + super.mouseY;
    		for (int l1 = 0; l1 < menuActionRow; l1++) {
    			int textY = yPos + 31 + (menuActionRow - 1 - l1) * 15;
    			int disColor = 0xc6b895;
    			if (mouseX > xPos && mouseX < xPos + menuW && mouseY > textY - 13
    					&& mouseY < textY + 3) {
    				DrawingArea.drawPixels(15, textY - 11, xPos + 3, 0x6f695d,
    						menuWidth - 6);
    				disColor = 0xeee5c6;
    			}
    			chatTextDrawingArea.method389(true, xPos + 3, disColor,
    					menuActionName[l1], textY);
    		}
    	}
    As soon as I uncomment that method it doesn't drop in frames but if I comment it out it will.
    Reply With Quote  
     

  2. #2  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    What does your setCursor(int) method look like?
    Reply With Quote  
     

  3. Thankful user:


  4. #3  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Joshua View Post
    What does your setCursor(int) method look like?
    Code:
    	public void setCursor(int id) {
    		Image image = getGameComponent().getToolkit().createImage(FileOperations.ReadFile(signlink.findcachedir()+ "Sprites/Gameframe/Cursors/Cursor "+id+".PNG"));
    		getGameComponent().setCursor(getGameComponent().getToolkit().createCustomCursor(image, new Point(0, 0), null));
    	}
    Reply With Quote  
     

  5. #4  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    Quote Originally Posted by Sunny++ View Post
    Code:
    	public void setCursor(int id) {
    		Image image = getGameComponent().getToolkit().createImage(FileOperations.ReadFile(signlink.findcachedir()+ "Sprites/Gameframe/Cursors/Cursor "+id+".PNG"));
    		getGameComponent().setCursor(getGameComponent().getToolkit().createCustomCursor(image, new Point(0, 0), null));
    	}
    Load your cursor images once on start up and save them to an array. You should never load files like that where you're repeatedly reloading the same image as many times per second as the client can manage.
    Reply With Quote  
     

  6. #5  
    Ex Rune-Scaper

    Join Date
    Jun 2008
    Posts
    3,534
    Thanks given
    457
    Thanks received
    1,257
    Rep Power
    990
    Quote Originally Posted by Joshua View Post
    Load your cursor images once on start up and save them to an array. You should never load files like that where you're repeatedly reloading the same image as many times per second as the client can manage.
    Could I also just pack them into my sprites? and use the cacheSprite method?
    Reply With Quote  
     

  7. #6  
    ಠ_ಠ

    Joshua's Avatar
    Join Date
    May 2010
    Posts
    1,903
    Thanks given
    397
    Thanks received
    708
    Rep Power
    803
    Quote Originally Posted by Sunny++ View Post
    Could I also just pack them into my sprites? and use the cacheSprite method?
    It doesn't matter where you load them from, just only load them once.
    Reply With Quote  
     

  8. Thankful users:



Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. Replies: 8
    Last Post: 02-23-2014, 07:56 PM
  2. Replies: 0
    Last Post: 11-07-2010, 01:01 PM
  3. Replies: 0
    Last Post: 08-20-2009, 08:54 AM
  4. How do I make it so when you right click...
    By Pray for plagues in forum Help
    Replies: 0
    Last Post: 03-08-2009, 09:11 PM
  5. making a pickpocket option when u right click a player!
    By k1ng 0f k1ngs in forum Tutorials
    Replies: 2
    Last Post: 07-06-2008, 11:57 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •