Purpose: To add hovering for your world map icon, and giving it an actionID. Difficulty: 1/10, if you have common sense and basic client/Java knowledge. Assumed Knowledge: Basic client knowledge, basic Java knowledge. Classes Modified: client.java and Sprite.java Client Base: [Only registered and activated users can see links. ]
I do not give permission for my tutorials to be converted to non-renamed and released.
NOTE: This will only work right away for my refactored base. You can configure it for yours, but this is for mine.
Step 1: Getting the sprite to load.
Download this sprite(save it): [Only registered and activated users can see links. ]. Make sure it is saved as mapiconh.png, in the Sprites folder.
Now, to make the sprite load correctly, we must edit Sprite.java, and client.java. First, lets do Sprite.java. In Sprite.java, find:
Code:
} else if (img.equalsIgnoreCase("mapicon")) {
simply replace it with:
Code:
} else if (img.equalsIgnoreCase("mapicon") || img.equalsIgnoreCase("mapiconh")) {
Now save and close Sprite.java. Open up client.java, and find:
Code:
worldMapIcon = new Sprite("mapicon");
Under it, add:
Code:
worldMapIconH = new Sprite("mapiconh");
Find:
Code:
private Sprite worldMapIcon;
Under it, add:
Code:
private Sprite worldMapIconH;
Find:
Code:
worldMapIcon = null;
Under it, add:
Code:
worldMapIconH = null;
That will load the sprite. But you aren't finished.
Step 2: Getting the mouse-over to work.
Find "public int logIconHPos = 0;", and below that add:
Code:
public int worldMapHPos = 0;
Then find "public void processMapAreaClick() {", and replace that method with:
No, you need a renamed. This is for renamed clients and I suggest you start using them. This tutorial only works 100% for my renamed client, so download it.
[Only registered and activated users can see links. ]