Thread: better variety for text color.(changing text color and not text) [Renamed]

Results 1 to 7 of 7
  1. #1 better variety for text color.(changing text color and not text) [Renamed] 
    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
    if wrong section plz move. (put here due to majority of code is client sided.)

    ok open client.java and find


    Code:
    				case 126:
    					String text = inStream.readString();
    then under that case add this

    Code:
    				case 127:
    					int textColor = inStream.method435();
    					int frame = inStream.method435();
    					setTextColour(textColor, frame);
    					pktType = -1;
    					return true;
    then add this method

    Code:
    	public void setTextColour(int str,int i) {
    		RSInterface.interfaceCache[i].textColor = str;
    		if(RSInterface.interfaceCache[i].parentID == tabInterfaceIDs[tabID])
    			needDrawTabArea = true;
    	}
    now open sizeconstants and change packet 127 to size 8.

    save and compile. then server sided add,

    Code:
    	static void sendTextColor(int s, int id) {
    		try {
    			c.outStream.createFrameVarSizeWord(127);
    			c.outStream.writeWordA(s);
    			c.outStream.writeWordA(id);
    			c.outStream.endFrameVarSizeWord();
    		} catch (Exception e) {
    		}
    	}
    save and compile.

    Explanation:

    instead of havin to change the text to change the color like so -
    Code:
    sendQuest("@[email protected]", ####);
    everytime you want to change a text's color. you can just use
    Code:
    setTextColor(0x######, linenumber);
    so now it is alot easier to change a color o the line. with out any text edits.

    this hasnt been tested wrote it now in this message. can someone plz test for me.
    ILY Stewie.
    Reply With Quote  
     

  2. #2  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,200
    Thanks given
    7,190
    Thanks received
    12,174
    Discord
    View profile
    Rep Power
    5000
    Beat you to it... [Only registered and activated users can see links. ]

    [Only registered and activated users can see links. ]



    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
    Quote Originally Posted by Scu11 View Post
    Beat you to it... [Only registered and activated users can see links. ]
    ooo shit i didnt see that =] ok well ile leave here anyways, peeps use which 1 they want too =]
    ILY Stewie.
    Reply With Quote  
     

  4. #4  




    Scu11's Avatar
    Join Date
    Aug 2007
    Age
    27
    Posts
    16,200
    Thanks given
    7,190
    Thanks received
    12,174
    Discord
    View profile
    Rep Power
    5000
    Quote Originally Posted by Rock-On View Post
    ooo shit i didnt see that =] ok well ile leave here anyways, peeps use which 1 they want too =]
    Mines better since it requires no server edits . Also its the way JaGeX use, so I'd say its probably better in their eyes also.

    [Only registered and activated users can see links. ]



    Reply With Quote  
     

  5. #5  
    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
    Quote Originally Posted by Scu11 View Post
    Mines better since it requires no server edits . Also its the way JaGeX use, so I'd say its probably better in their eyes also.
    only reason mine requires server edits is so u can dit the text color from server like quest lines...=] and the only server side edit is a method. =]
    ILY Stewie.
    Reply With Quote  
     

  6. #6  
    Member

    Join Date
    May 2008
    Posts
    1,288
    Thanks given
    50
    Thanks received
    92
    Rep Power
    0
    Theres already a frame for changing text color.
    It's what they used for the quests and stuff.
    Code:
        public void setInterfaceColor(int inter, int color){
    	outStream.createFrame(122);
    	outStream.writeWordBigEndianA(inter);
    	outStream.writeWordBigEndianA(color);
    	flushOutStream();
        }
    Code:
    setInterfaceColor(####, 0xFFFFFF);
    I'm pretty sure it does exactly the same thing that this does O.o
    Reply With Quote  
     

  7. #7  
    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
    o i c.

    Code:
    				case 122:
    					int l6 = inStream.method436();
    					int i14 = inStream.method436();
    					int i19 = i14 >> 10 & 0x1f;
    					int i22 = i14 >> 5 & 0x1f;
    					int l24 = i14 & 0x1f;
    					RSInterface.interfaceCache[l6].textColor = (i19 << 19) + (i22 << 11) + (l24 << 3);
    					pktType = -1;
    					return true;
    meh kk ile remove this. thanks guys didnt no it was already in there =].
    ILY Stewie.
    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

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