Thread: Make an interface moving

Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11  
    Interfacing with your sister

    Streax's Avatar
    Join Date
    Jun 2009
    Posts
    2,308
    Thanks given
    784
    Thanks received
    175
    Rep Power
    229
    Quote Originally Posted by RememberM3 View Post
    Thanks for you reply,
    This is what I did.
    I added this into the RSInterface class:
    Code:
    public static RSInterface addSlideInterface(int id) {
    		RSInterface rsi = interfaceCache[id] = new RSInterface();
    		rsi.id = id;
    		rsi.parentID = id;
    		rsi.interfaceType = 7;
    		rsi.width = 512;
    		rsi.height = 334;
    		return rsi;
    	}
    and I added this into the buildInterfaceMenu:
    Code:
    if(class9_1.interfaceType == 7)
    			{
    				for (int x = -190; x > 5; x++) {
    					buildInterfaceMenu(x, class9_1, k, j2, i1, class9_1.scrollPosition);
    					if(class9_1.scrollMax > class9_1.height)
    						method65(i2 + class9_1.width, class9_1.height, k, x, class9_1, j2, true, class9_1.scrollMax);
    				}
    			}
    but then the interface didn't show up at all, so I added the for loop into the interfaceType == 0
    and the interface did show up, but no movement at all.
    If you got any time to reply to this, that'd be awesome.
    I may have said what I said wrongly. I meant to say assign it a unique contentType, not an interfaceType or atActionType. A unique contentType I use is 901, and another is 902. Then you can process the updating of it's position in the updateInterfaceSettings method, and draw it immediately after each update. If you cant find the method, search for:

    Code:
    if (j == 600) {
                class9.message = reportAbuseInput + (loopCycle % 20 < 10 ? "|" : " ");
                return;
    }
    or something similar, then create a unique block like this:

    Code:
    if (j == 901) {
        
        return;
    }
    then add your interface updating there.

    Basically this method allows you to update interface settings using a contentType. Changing the interface type is not a good idea since the interface type will determine if it's a layer component, text component, sprite component, or etc.

    Edit: In theory it should work, use some basic checks to ensure that the interface is enabled, also use a basic check to only update it when it's not in the position it should be, which will prevent the for loop to run when not necessary.
    Attached image
    Reply With Quote  
     

  2. #12  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Quote Originally Posted by Dev Az View Post
    I may have said what I said wrongly. I meant to say assign it a unique contentType, not an interfaceType or atActionType. A unique contentType I use is 901, and another is 902. Then you can process the updating of it's position in the updateInterfaceSettings method, and draw it immediately after each update. If you cant find the method, search for:

    Code:
    if (j == 600) {
                class9.message = reportAbuseInput + (loopCycle % 20 < 10 ? "|" : " ");
                return;
    }
    or something similar, then create a unique block like this:

    Code:
    if (j == 901) {
        
        return;
    }
    then add your interface updating there.

    Basically this method allows you to update interface settings using a contentType. Changing the interface type is not a good idea since the interface type will determine if it's a layer component, text component, sprite component, or etc.

    Edit: In theory it should work, use some basic checks to ensure that the interface is enabled, also use a basic check to only update it when it's not in the position it should be, which will prevent the for loop to run when not necessary.
    Ah that's why. Thanks for explaining what interfaceType is for, do you mind explaining what the other things are for, like contentType, atActionType. Thanks for helping me even though you're on vacation. Have fun!

    EDIT: I tried adding the contentType and to check I added this line:
    Code:
    System.out.prinln("content type:" + j);
    under:
    Code:
    int j = class9.contentType;
    and when I open the interface I don't even get the message "content type: 900".
    the other contenttypes do show up, but 900 doesn't.
    btw. I only have a method called: promptUserForInput and in there it looks like this:
    Code:
    private boolean promptUserForInput(RSInterface class9) {
    		int j = class9.contentType;
    		System.out.println("content type: " + j);
    		if(anInt900 == 2) {
    			if(j == 201) {
    				inputTaken = true;
    				inputDialogState = 0;
    				messagePromptRaised = true;
    				promptInput = "";
    				friendsListAction = 1;
    				aString1121 = "Enter name of friend to add to list";
    			}
    			if(j == 202) {
    				inputTaken = true;
    				inputDialogState = 0;
    				messagePromptRaised = true;
    				promptInput = "";
    				friendsListAction = 2;
    				aString1121 = "Enter name of friend to delete from list";
    			}
    		}
    		if(j == 205) {
    			anInt1011 = 250;
    			return true;
    		}
    		if(j == 501) {
    			inputTaken = true;
    			inputDialogState = 0;
    			messagePromptRaised = true;
    			promptInput = "";
    			friendsListAction = 4;
    			aString1121 = "Enter name of player to add to list";
    		}
    		if(j == 502) {
    			inputTaken = true;
    			inputDialogState = 0;
    			messagePromptRaised = true;
    			promptInput = "";
    			friendsListAction = 5;
    			aString1121 = "Enter name of player to delete from list";
    		}
    		if(j == 550) {
    			inputTaken = true;
    			inputDialogState = 0;
    			messagePromptRaised = true;
    			promptInput = "";
    			friendsListAction = 6;
    			aString1121 = "Enter the name of the chat you wish to join";
    		}
    		if(j == 549) {
    			inputTaken = true;
    			inputDialogState = 0;
    			messagePromptRaised = true;
    			promptInput = "";
    			friendsListAction = 7;
    			aString1121 = "Enter a new name for your clanchat";
    		}
    		if(j >= 300 && j <= 313) {
    			int k = (j - 300) / 2;
    			int j1 = j & 1;
    			int i2 = anIntArray1065[k];
    			if(i2 != -1) {
    				do {
    					if(j1 == 0 && --i2 < 0)
    						i2 = IdentityKit.length - 1;
    					if(j1 == 1 && ++i2 >= IdentityKit.length)
    						i2 = 0;
    				} while(IdentityKit.cache[i2].aBoolean662 || IdentityKit.cache[i2].anInt657 != k + (aBoolean1047 ? 0 : 7));
    				anIntArray1065[k] = i2;
    				aBoolean1031 = true;
    			}
    		}
    		if(j >= 314 && j <= 323) {
    			int l = (j - 314) / 2;
    			int k1 = j & 1;
    			int j2 = anIntArray990[l];
    			if(k1 == 0 && --j2 < 0)
    				j2 = anIntArrayArray1003[l].length - 1;
    			if(k1 == 1 && ++j2 >= anIntArrayArray1003[l].length)
    				j2 = 0;
    			anIntArray990[l] = j2;
    			aBoolean1031 = true;
    		}
    		if(j == 324 && !aBoolean1047) {
    			aBoolean1047 = true;
    			method45();
    		}
    		if(j == 325 && aBoolean1047) {
    			aBoolean1047 = false;
    			method45();
    		}
    		if(j == 326) {
    			stream.createFrame(101);
    			stream.writeWordBigEndian(aBoolean1047 ? 0 : 1);
    			for(int i1 = 0; i1 < 7; i1++)
    				stream.writeWordBigEndian(anIntArray1065[i1]);
    
    			for(int l1 = 0; l1 < 5; l1++)
    				stream.writeWordBigEndian(anIntArray990[l1]);
    
    			return true;
    		}
    		if(j == 613)
    			canMute = !canMute;
    		if(j >= 601 && j <= 612) {
    			clearTopInterfaces();
    			if(reportAbuseInput.length() > 0) {
    				stream.createFrame(218);
    				stream.writeQWord(TextClass.longForName(reportAbuseInput));
    				stream.writeWordBigEndian(j - 601);
    				stream.writeWordBigEndian(canMute ? 1 : 0);
    			}
    		}
    		if (j == 900) {
    			//TODO
    		}
    		return false;
    	}
    Reply With Quote  
     

  3. #13  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  4. #14  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  5. #15  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

  6. #16  
    Registered Member Rememberm3's Avatar
    Join Date
    Aug 2013
    Posts
    1,716
    Thanks given
    56
    Thanks received
    108
    Rep Power
    129
    Bump
    Attached image
    Reply With Quote  
     

Page 2 of 2 FirstFirst 12

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. How do I make an Interface!
    By archsage78 in forum Help
    Replies: 3
    Last Post: 09-12-2009, 01:20 AM
  2. Help with making an interface?
    By nathan0507 in forum Help
    Replies: 1
    Last Post: 03-22-2009, 04:02 PM
  3. Replies: 2
    Last Post: 03-20-2009, 03:58 AM
  4. how to make an interface walkable
    By runescapedds in forum Requests
    Replies: 3
    Last Post: 12-24-2008, 04:32 PM
  5. Making an npc move
    By delta11 in forum Tutorials
    Replies: 5
    Last Post: 10-20-2007, 09:43 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
  •