20 Apr, 2014, Grieffels wrote in the 1st comment:
Votes: 0
As of late, I have had a builder suggest something to me without actually saying it.
He has bad headaches and the colors mess with him, so instead of making color
completely off, he mainly wants to get rid of the room desc/name colors.

I tried using strip_color, which works but when you turn it off, first look gives
color, the second look is correct. This goes for every direction you go. After you've
saw the room, it'll stay removed.

I'm basically wanting a command that I can turn on and off at any given time to
turn color in descs off and on, same for room names. This means without it literally
removing the color codes from the descs/names.

Any help?

Just adding some stuff to this.
I have the commands basically: namecolor on or off, desccolor on or off.
When you turn the name or desc color back on, it doesn't show the original color. It keeps
it stripped.

if (!IS_NPC(ch) && !IS_SET(ch->pcdata->plradd, PLRADD_NAMECOLOR))
{
sprintf(buf,"{C%s{w",ch->in_room->name);
}
if (!IS_NPC(ch) && IS_SET(ch->pcdata->plradd, PLRADD_NAMECOLOR))
{
sprintf(buf,"%s", ch->in_room->name);
strip_color(buf);
}

send_to_char(buf,ch);
20 Apr, 2014, Nathan wrote in the 2nd comment:
Votes: 0
Kinda off topic, but it might be worth changing your code from this:

if (!IS_NPC(ch) && !IS_SET(ch->pcdata->plradd, PLRADD_NAMECOLOR)) 
{
sprintf(buf,"{C%s{w",ch->in_room->name);
}
if (!IS_NPC(ch) && IS_SET(ch->pcdata->plradd, PLRADD_NAMECOLOR))
{
sprintf(buf,"%s", ch->in_room->name);
strip_color(buf);
}


to this:

if ( !IS_NPC(ch) ) {
if( IS_SET(ch->pcdata->plradd, PLRADD_NAMECOLOR) )
{
sprintf(buf,"%s", ch->in_room->name);
strip_color(buf);
}
else
{
sprintf(buf,"{C%s{w",ch->in_room->name);
}
}


for the sake of clarity. I don't know much about the codebase, but you might want to check what is being done in strip_color to make sure that it does what you think it does and doesn't modify something else somehow. Might be worth a quick check over the IS_SET macro too (at least I assume it's a macro). How and where do you set/reset the option or flag that you are using to indicate whether the player wants to see color or not?

Are first look and second controlled by the same code or does your check, as described, need to be copied to somewhere else in the code too?
20 Apr, 2014, quixadhal wrote in the 3rd comment:
Votes: 0
First suggestion… don't hard code returning to "light grey", ever. You should always use the color you want, followed by the content, followed by a RESET code. If the user's preference is to have things be green, hard-coding that color makes bleed.

It might be worth the time to make a custom color system, like the one in SmaugFUSS. It allows players to simply specify what color they want any given system-generated message to be, rather than forcing them to be hard-coded or nothing.

The idea is simple enough. You create a new color token (in RoM I guess you'd use something like {First suggestion… don't hard code returning to "light grey", ever. You should always use the color you want, followed by the content, followed by a RESET code. If the user's preference is to have things be green, hard-coding that color makes bleed.

It might be worth the time to make a custom color system, like the one in SmaugFUSS. It allows players to simply specify what color they want any given system-generated message to be, rather than forcing them to be hard-coded or nothing.

The idea is simple enough. You create a new color token (in RoM I guess you'd use something like {[ ), which the color parser knows means "extended". Then you can place your extended tokens inside the brackets, ending with a closing bracket.

So, instead of "{C%s{w", which I guess means bright-cyan, content, light-grey? You'd use "{[ROOM_TITLE]%s{[RESET]".

Now, you have no need to play games with strip_color()… you simply give each player a default set of translations… so ROOM_TITLE => "{C", and RESET => whatever-RoM-uses-for-reset. If the user wants to change their room title color, they can just set it to red, or "" to not have one at all. If you want to avoid the secondary pass for color code processing, you can always make the mapping go directly to the ANSI sequence, although that will limit your ability to support multiple terminal types.

If you grab the SmaugFUSS codebase from their site, look in color.c. You'll see how I did the custom extension… the color theme code was already there, which is why they work differently.
20 Apr, 2014, Grieffels wrote in the 4th comment:
Votes: 0
Thanks guys, I got it working with using strip_color(buf) instead of directly striping ch->in_room->name. I also got the description
portion working correctly.

Also, quixadhal, I do plan on actually going that route soon. I plan to allow customization of color across the entire game
except for a few specific things but that will come later. My plans for now is to get a few more features in for specific people
and people like those people, so they can be happy. After that, back to finishing the rest of the professions. I did submit a little
snippet for everyone. Border coloring, if im not mistaken, I believe that is what I named it. If you guys would, give me some feedback
on that. That was something I done months ago. Im sure I can do a bit better, however, it's not a problem so I won't be focusing
on that until more is done with the main systems of the game. Classes, professions, and combat.
0.0/4