Jump to content
  • 0

color code to this menu


Yuna

Question


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

I want to put a color code to the menu items in this script, but not sure how to do it. It's from the script: npc/merchants/elemental_trader.txt

		set .@menu$, "";
		for(set .@j,1; .@j<5; set .@j,.@j+1) {
			if (.@Items[.@j] != .@i) set .@menu$, .@menu$+getitemname(.@Items[.@j]);
			set .@menu$, .@menu$+":";
		}
		set .@menu$, .@menu$+"Cancel";
		set .@j, select(.@menu$);

Thanks~

Edited by Lilo
Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Then it'd go like this

set .@menu$, "";
		for(set .@j,1; .@j<5; set .@j,.@j+1) {
--			if (.@Items[.@j] != .@i) set .@menu$, .@menu$+getitemname(.@Items[.@j]);
++			if (.@Items[.@j] != .@i) set .@menu$, .@menu$+"^ff0000"+getitemname(.@Items[.@j])+"^000000";
			set .@menu$, .@menu$+":";
		}
		set .@menu$, .@menu$+"Cancel";
		set .@j, select(.@menu$);
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  31
  • Topics Per Day:  0.01
  • Content Count:  283
  • Reputation:   31
  • Joined:  07/08/14
  • Last Seen:  

Hello

 

Do you want to put the same color for each item or do you want to put different colors? If you want them to be different, how do you want to choose the color?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

Hello

 

Do you want to put the same color for each item or do you want to put different colors? If you want them to be different, how do you want to choose the color?

 

Same color is fine. ^FF0000

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  96
  • Reputation:   5
  • Joined:  03/16/16
  • Last Seen:  

 

Then it'd go like this

set .@menu$, "";
		for(set .@j,1; .@j<5; set .@j,.@j+1) {
--			if (.@Items[.@j] != .@i) set .@menu$, .@menu$+getitemname(.@Items[.@j]);
++			if (.@Items[.@j] != .@i) set .@menu$, .@menu$+"^ff0000"+getitemname(.@Items[.@j])+"^000000";
			set .@menu$, .@menu$+":";
		}
		set .@menu$, .@menu$+"Cancel";
		set .@j, select(.@menu$);

 

Thanks alot, it worked!  /no1

Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

you can also do it like this

set .@j, select( "^FF0000"+.@menu$+"^000000" );

this way it would reduce the length of the menu string and give up more slots for other menus since string have a limit of 2048 ~ 4096 characters.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...