Thread: [Galkon's Base]Adding World Map Hovering/Button

Page 1 of 3 123 LastLast
Results 1 to 10 of 28
  1. #1 [Galkon's Base]Adding World Map Hovering/Button 
    Retired. Stop PMing me.

    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,528
    Thanks given
    1,783
    Thanks received
    2,822
    Discord
    View profile
    Rep Power
    5000
    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:
    Code:
    	public void processMapAreaClick() {
    		if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23) {
    			logIconHPos = 1;
    		} else {
    			logIconHPos = 0;
    		}
    		if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
    			worldMapHPos = 1;
    		} else {
    			worldMapHPos = 0;
    		}
    	}
    Now find "public void drawWorldMapButton() {", and replace that whole method with:
    Code:
    	public void drawWorldMapButton() {
    		if(worldMapHPos == 0) {
    			worldMapIcon.drawSprite(8, 124);
    		} else if(worldMapHPos == 1) {
    			worldMapIconH.drawSprite(8, 124);
    		}
    	}
    This will make it so if you mouse over the world map icon, it draws the hover sprite.


    Step 3: Making it a button with an action.

    Find "public void rightClickMapArea() {", and replace the entire method with:
    Code:
    	private void rightClickMapArea() {
    		if(super.mouseX >= 742 && super.mouseX <= 764 && super.mouseY >= 1 && super.mouseY <= 23 && tabInterfaceIDs[10] != -1) {
    			menuActionName[1] = "Logout";
    			menuActionID[1] = 1004;
    			menuActionRow = 2;
    		} else if(super.mouseX >= 527 && super.mouseX <= 560 && super.mouseY >= 126 && super.mouseY <= 159) {
    			menuActionName[1] = "World Map";
    			menuActionID[1] = 1005;
    			menuActionRow = 2;
    		}
    	}
    Now find "if(l == 1004) {" and above that, add:
    Code:
    		if(l == 1005) {
    			//World map action
    			pushMessage("The world map feature is currently disabled.", 0, "");
    		}
    Now I don't know what you want it to do, but you can make it do anything you want by putting it in there.
    __________________________

    Now thats it, you're done. Save, compile, try it out. If you have any errors, feel free to ask about them.
    [Only registered and activated users can see links. ]
    Reply With Quote  
     

  2. #2  
    Registered Member

    Join Date
    Feb 2008
    Age
    25
    Posts
    1,079
    Thanks given
    26
    Thanks received
    14
    Rep Power
    574
    NICE! im using this!
    Reply With Quote  
     

  3. #3  
    Member Market Banned Market Banned

    Robin Spud's Avatar
    Join Date
    Aug 2008
    Age
    28
    Posts
    2,338
    Thanks given
    46
    Thanks received
    73
    Rep Power
    1068
    this is very nice lol =] now for your non renamed base
    ILY Stewie.
    Reply With Quote  
     

  4. #4  
    Registered Member

    Join Date
    Feb 2008
    Age
    25
    Posts
    1,079
    Thanks given
    26
    Thanks received
    14
    Rep Power
    574
    he made the renamed base for a reason, he wants people to change to renamed instead of non-renamed.
    Reply With Quote  
     

  5. #5  
    Registered Member partyhat101's Avatar
    Join Date
    Jun 2009
    Posts
    212
    Thanks given
    0
    Thanks received
    1
    Rep Power
    40
    I needa non renamed plox
    Reply With Quote  
     

  6. #6  
    Registered Member
    No Go_JoE's Avatar
    Join Date
    May 2008
    Posts
    1,358
    Thanks given
    44
    Thanks received
    142
    Rep Power
    480
    Nice, you're still beasting clients.
    Reply With Quote  
     

  7. #7  
    Retired. Stop PMing me.

    Galkon's Avatar
    Join Date
    Nov 2007
    Age
    14
    Posts
    7,528
    Thanks given
    1,783
    Thanks received
    2,822
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by partyhat101 View Post
    I needa non renamed plox
    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. ]
    Reply With Quote  
     

  8. #8  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    Used, Thanks
    Reply With Quote  
     

  9. #9  
    Donator

    F1NN's Avatar
    Join Date
    May 2008
    Posts
    504
    Thanks given
    28
    Thanks received
    16
    Rep Power
    156
    Im going to try to use... I am sort of confused with using renamed, been using non renamed for so long.
    Reply With Quote  
     

  10. #10  
    Respected Member


    Josh's Avatar
    Join Date
    Aug 2008
    Age
    27
    Posts
    2,863
    Thanks given
    6
    Thanks received
    1,342
    Rep Power
    5000
    Now I've done this, everytime I click the inventory sideIcon, I get the world map has been disabled message.

    How do I fix, it's really annoying
    Reply With Quote  
     

Page 1 of 3 123 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •