Jump to content

Check if the menu is of item...


Soldtodie

Recommended Posts

	public static Rectangle getItemRectangleInBank(int slot) {
		Rectangle rect = getItemRectangle(slot);
		rect.width += 4; 
		return rect;
	}
	
	public static Rectangle getItemRectangle(int slot) {
		int freeSpaceX = 11;
		int freeSpaceY = 5;
		int width = 31;
		int height = 31;
		int x = 563;
		int y = 213;
		
		int newX = x + ((slot % 4) * width) + ((slot % 4) * freeSpaceX);
		int newY = y + ((slot / 4) * height) + ((slot / 4) * freeSpaceY);

		return new Rectangle(newX, newY, width, height);
	}

why :(

Link to comment
Share on other sites

Ok let me help you out there buddy. Like they said thats a bit hard core. I'm not really sure what you trying to do here.

To get the rec of the item use abstract mouse destination class. For bank use BankSlotDestination and for inventory use inventoryslotdestination. Osb already did all the hard coding for us.

To get slot of item in bank or inventory use the itemcontainer abstract class

Use the menu class, it has great methods like select action.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...