Top Mud Sites Forum

Top Mud Sites Forum (http://www.topmudsites.com/forums/index.php)
-   MUD Coding (http://www.topmudsites.com/forums/forumdisplay.php?f=9)
-   -   Color Codes in LPC (http://www.topmudsites.com/forums/showthread.php?t=500)

kaylus1 04-27-2002 09:49 PM

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?

Kaylus@Solice


All times are GMT -4. The time now is 05:26 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Top Mud Sites.com 2022