|04-27-2002, 09:49 PM||#1|
Currently using MudOS driver (newest) and a self created mudlib.
I was implementing the "standard" color codes you usually find in MudOS mudlibs (%^RED%^, etc). I created an ansi.h include file with a small function called do_ansi that returns a mapping of all colors with their corresponding ansi (colors["white"] is "\033[37m").
After creating this I caught myself wondering where to put the code to interpret these. I finally placed them in the receive_message function on our user object. I have it test the termtype, check if there is one at the beginning of the text, then while-loop sscanf the rest of the text. It works just fine.
Out of curiousity though I was wondering if there was in fact a more viable solution than this, or if anyone had any other suggestions on how to implement this.
I also wish to add a user-configurable terminal daemon, allowing them to change certain mud colors based on the class passed through message(). The only way I can think of doing this is through the receive_message as well, any ideas?
|Color Codes in LPC - Similar Threads|
|Thread||Thread Starter||Forum||Replies||Last Post|
|MUDs with no color||DarkOzma||Tavern of the Blue Hand||22||08-03-2006 12:50 PM|
|Color Obsession||Rathik||Tavern of the Blue Hand||19||08-03-2006 02:27 AM|
|To color or not to color||rockcrusher_sargon||MUD Builders and Areas||12||01-24-2004 02:18 AM|
|Staff of a different color...||Sally||Advertising for Staff||0||03-24-2003 10:00 PM|
|This ikonboard color scheme||crymerci||Bugs and Suggestions||0||01-16-2003 06:02 PM|