Thread: Interface buttons

Results 1 to 8 of 8
  1. #1 Interface buttons 
    Registered Member
    Join Date
    Apr 2016
    Posts
    117
    Thanks given
    4
    Thanks received
    3
    Rep Power
    36
    I've added this interface
    Code:
        public static void NewTele(TextDrawingArea[] TDA){
        	RSInterface Interface = addTabInterface(33000);
        	addSprite(33001, 1, "NewTele/INTERFACE");
        	addHoverButton(33002, "NewTele/BUTTON", 1, 21, 21, "Close", 0, 33003, 3);
    		addHoveredButton(33003, "NewTele/BUTTON", 2, 21, 21, 33004);
    		addHoverButton(33005, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33006, 3);
    		addHoveredButton(33006, "NewTele/TELEBUTTON", 1, 94, 20, 33007);
    		addHoverButton(33008, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33009, 3);
    		addHoveredButton(33009, "NewTele/TELEBUTTON", 1, 94, 20, 33010);
    		addHoverButton(33011, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33012, 3);
    		addHoveredButton(33012, "NewTele/TELEBUTTON", 1, 94, 20, 33013);
    		addHoverButton(33014, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33015, 3);
    		addHoveredButton(33015, "NewTele/TELEBUTTON", 1, 94, 20, 33016);
    		addHoverButton(33017, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33018, 3);
    		addHoveredButton(33018, "NewTele/TELEBUTTON", 1, 94, 20, 33019);
        	addSprite(33020, 0, "NewTele/ARROW");
        	/* addText(ID, "Text", tda, Size, Colour, Centered); */
    		addText(33021, "Select a teleport", TDA, 1, 0xff981f, true);
    		addText(33022, "Training", TDA, 1, 0xff981f, true);
    		addText(33023, "Skilling", TDA, 1, 0xff981f, true);
    		addText(33024, "Bosses", TDA, 1, 0xff981f, true);
    		addText(33025, "Mini-Games", TDA, 1, 0xff981f, true);
    		addText(33026, "Player-Killing", TDA, 1, 0xff981f, true);// 2426
        	setChildren(20, Interface);
        	setBounds(33001, 180, 75, 0, Interface);
        	setBounds(33002, 308, 77, 1, Interface);
        	setBounds(33003, 308, 77, 2, Interface);
        	setBounds(33005, 208, 100, 3, Interface);
        	setBounds(33006, 208, 100, 4, Interface);
        	setBounds(33008, 208, 129, 5, Interface);
        	setBounds(33009, 208, 129, 6, Interface);
        	setBounds(33011, 208, 158, 7, Interface);
        	setBounds(33012, 208, 158, 8, Interface);
        	setBounds(33014, 208, 188, 9, Interface);
        	setBounds(33015, 208, 188, 10, Interface);
        	setBounds(33017, 208, 218, 11, Interface);
        	setBounds(33018, 208, 218, 12, Interface);
        	setBounds(33020, 193, 252, 13, Interface);
        	setBounds(33021, 266, 253, 14, Interface);
        	setBounds(33022, 256, 101, 15, Interface);
        	setBounds(33023, 256, 130, 16, Interface);
        	setBounds(33024, 256, 160, 17, Interface);
        	setBounds(33025, 254, 190, 18, Interface);
        	setBounds(33026, 253, 219, 19, Interface);
        }
    and when i click say Training i want it to show another interface which i added,
    Code:
      public static void TrainingNewTele(TextDrawingArea[] TDA){
        	RSInterface Interface = addTabInterface(34000);
        	addSprite(34001, 2, "NewTele/INTERFACE");
        	addSprite(34002, 1, "NewTele/MULTI");
        	addSprite(34003, 0, "NewTele/ARROW");
        	/*Start Of buttons*/
        	addHoverButton(34005, "NewTele/BACK", 1, 43, 29, "Back", 1, 34006, 3);
    		addHoveredButton(34006, "NewTele/BACK", 1, 43, 29, 34007);
    		addHoverButton(34008, "", 1, 94, 20, "", 1, 34009, 3);
    		addHoveredButton(34009, "NewTele/TELEBUTTON", 1, 94, 20, 34010);
    		addHoverButton(34011, "", 1, 94, 20, "", 1, 34012, 3);
    		addHoveredButton(34012, "NewTele/TELEBUTTON", 1, 94, 20, 34013);
    		addHoverButton(34014, "", 1, 94, 20, "", 1, 34015, 3);
    		addHoveredButton(34015, "NewTele/TELEBUTTON", 1, 94, 20, 34016);
    		addHoverButton(34017, "", 1, 94, 20, "", 1, 34018, 3);
    		addHoveredButton(34018, "NewTele/TELEBUTTON", 1, 94, 20, 34019);
    		addHoverButton(34020, "", 1, 94, 20, "", 1, 34021, 3);
    		addHoveredButton(34021, "NewTele/TELEBUTTON", 1, 94, 20, 34022);
    		addHoverButton(34023, "", 1, 94, 20, "", 1, 34024, 3);
    		addHoveredButton(34024, "NewTele/TELEBUTTON", 1, 94, 20, 34025);
    		addHoverButton(34026, "", 1, 94, 20, "", 1, 34027, 3);
    		addHoveredButton(34027, "NewTele/TELEBUTTON", 1, 94, 20, 34028);
    		addHoverButton(34029, "", 1, 94, 20, "", 1, 34030, 3);
    		addHoveredButton(34030, "NewTele/TELEBUTTON", 1, 94, 20, 34031);
    		addHoverButton(34041, "NewTele/BUTTON", 1, 21, 21, "", 0, 34042, 3);
    		addHoveredButton(34042, "NewTele/BUTTON", 2, 21, 21, 34043);	
    		/*End of buttons | Start Of texts*/
    		addText(34032, "Rock Crabs", TDA, 3, 0xff981f, true);
    		addText(34033, "Hill Giants", TDA, 1, 0xff981f, false);
    		addText(34034, "Fire Giants", TDA, 1, 0xff981f, false);
    		addText(34035, "Greater Demons", TDA, 1, 0xff981f, false);
    		addText(34036, "", TDA, 1, 0xff981f, false);
    		addText(34037, "", TDA, 1, 0xff981f, false);
    		addText(34038, "", TDA, 1, 0xff981f, false);
    		addText(34039, "", TDA, 1, 0xff981f, false);
    		addText(34040, "", TDA, 1, 0xff981f, false);
    		addText(34044, "Select a teleport by clicking a button.", TDA, 1, 0xff981f, false);
    		/*End of texts */
        	setChildren(33, Interface);
        	setBounds(34001, 25, 70, 0, Interface);
        	setBounds(34002, 150, 95, 1, Interface);
        	setBounds(34003, 37, 134, 2, Interface);
        	setBounds(34005, 422, 128, 3, Interface);
        	setBounds(34006, 422, 128, 4, Interface);
        	setBounds(34008, 36, 170, 5, Interface);
        	setBounds(34009, 36, 170, 6, Interface);
        	setBounds(34011, 136, 170, 7, Interface);
        	setBounds(34012, 136, 170, 8, Interface);
        	setBounds(34014, 136, 210, 9, Interface);
        	setBounds(34015, 136, 210, 10, Interface);
        	setBounds(34017, 36, 210, 11, Interface);
        	setBounds(34018, 36, 210, 12, Interface);
        	setBounds(34020, 272, 170, 13, Interface);
        	setBounds(34021, 272, 170, 14, Interface);
        	setBounds(34023, 372, 170, 15, Interface);
        	setBounds(34024, 372, 170, 16, Interface);
        	setBounds(34026, 271, 210, 17, Interface);
        	setBounds(34027, 271, 210, 18, Interface);
        	setBounds(34029, 371, 210, 19, Interface);
        	setBounds(34030, 371, 210, 20, Interface);
        	setBounds(34032, 263, 97, 21, Interface);
        	setBounds(34033, 39, 172, 22, Interface);
        	setBounds(34034, 39, 211, 23, Interface);
        	setBounds(34035, 139, 172, 24, Interface);
        	setBounds(34036, 139, 211, 25, Interface);
        	setBounds(34037, 274, 172, 26, Interface);
        	setBounds(34038, 374, 171, 27, Interface);
        	setBounds(34039, 373, 211, 28, Interface);
        	setBounds(34040, 274, 211, 29, Interface);
        	setBounds(34041, 450, 93, 30, Interface);
        	setBounds(34042, 450, 93, 31, Interface);
        	setBounds(34044, 62, 136, 32, Interface);
        }
    and so on, But i cant find the button IDs to put in clickingbuttons?
    i have tried this
    Code:
    case 33009: <-- This being from the red code in first [ CODE] tag, ive tried all of them
    				c.getPA().showInterface(33024); 
    				break;
    Reply With Quote  
     

  2. #2  
    Owner of Dawntained

    Mgt Madness's Avatar
    Join Date
    Oct 2011
    Age
    28
    Posts
    3,380
    Thanks given
    1,429
    Thanks received
    958
    Rep Power
    2168
    When you click a button, it should show a debug print in the console.

    If you keep scrolling up, you will find switch(buttonId) {
    or soemthing similair, add above that System.out.println(buttonId);

    it can be anything other than buttonId
    Attached image
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Apr 2016
    Posts
    117
    Thanks given
    4
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by Mgt Madness View Post
    When you click a button, it should show a debug print in the console.

    If you keep scrolling up, you will find switch(buttonId) {
    or soemthing similair, add above that System.out.println(buttonId);

    it can be anything other than buttonId
    Mine now looks like this
    Code:
    			System.out.println(actionButtonId);
    		switch (actionButtonId){
    Still not giving me ID's for that interface, others work but not the interfaces i added.
    Reply With Quote  
     

  4. #4  
    'Slutty McFur'

    Owain's Avatar
    Join Date
    Sep 2014
    Age
    26
    Posts
    2,894
    Thanks given
    2,360
    Thanks received
    2,200
    Rep Power
    5000
    Wouldn't it be tabinterface as well rather than just interface.
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Apr 2016
    Posts
    117
    Thanks given
    4
    Thanks received
    3
    Rep Power
    36
    Quote Originally Posted by A Mage View Post
    Wouldn't it be tabinterface as well rather than just interface.
    Naw.
    Reply With Quote  
     

  6. #6  
    Donator

    Join Date
    Nov 2012
    Posts
    790
    Thanks given
    47
    Thanks received
    42
    Rep Power
    12
    Quote Originally Posted by A Mage View Post
    Wouldn't it be tabinterface as well rather than just interface.
    lool
    Reply With Quote  
     

  7. #7  
    Registered Member
    Zivik's Avatar
    Join Date
    Oct 2007
    Age
    28
    Posts
    4,421
    Thanks given
    891
    Thanks received
    1,527
    Rep Power
    3285
    Your problem is the action that your trying to create. At least, that's the problem I can notice.

    Code:
    addHoverButton(33008, "NewTele/TELEBUTTON", 0, 94, 20, "Open", 1, 33009, 3)
    The yellow 3 indicates a close action, so I'm guessing when you click it, it closed the interface. Switch that to a "1" and see if that solves your issue. This is true for all of your hoverbuttons, "3" means the close action, "1" means it's an action button. When you click it, ideally it will print your server-side action id that you put in your case ####:
    Reply With Quote  
     

  8. #8  
    'Slutty McFur'

    Owain's Avatar
    Join Date
    Sep 2014
    Age
    26
    Posts
    2,894
    Thanks given
    2,360
    Thanks received
    2,200
    Rep Power
    5000
    Quote Originally Posted by Relentless View Post
    lool
    ?
    Sorry I misunderstood him.
    Reply With Quote  
     


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. Interfaces, Button Functions, Changing Text
    By Eportal in forum Tutorials
    Replies: 4
    Last Post: 02-21-2010, 04:08 AM
  2. Interface button thing [508]
    By mige5 in forum Help
    Replies: 2
    Last Post: 07-06-2009, 10:41 AM
  3. [iPanel] Force Interface Button
    By Roger in forum Configuration
    Replies: 2
    Last Post: 04-17-2009, 01:12 PM
  4. Summoning Interface buttons.
    By Silverz. in forum Help
    Replies: 4
    Last Post: 02-22-2009, 11:11 PM
  5. Packet 36 - Interface button Status
    By uber killer in forum Tutorials
    Replies: 9
    Last Post: 07-31-2007, 04:33 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •