Stripping color codes in Torque Script
by Peter Simard · 09/05/2005 (6:55 pm) · 2 comments
Torque has a built in function for stripping out color codes but it is not exposed by default. To expose it add these lines to your console.cc file:
ConsoleFunction(stripColorCodes, const char*, 2,2, "(stringtoStrip) - remove color chars from the string.")
{
char* ret = Con::getReturnBuffer( dStrlen( argv[1] ) + 1 );
dStrcpy(ret, argv[1]);
stripColorChars(ret);
return ret;
}
Associate Ben Garney