• Welcome to Valhalla Legends Archive.
 

Parsing the colors

Started by Networks, May 04, 2004, 08:58 AM

Previous topic - Next topic
|

Skywing

Quote from: DarkMinion on May 13, 2004, 03:42 PM
Updated for you sane C++ users


   char *pPtr = strtok(szTxtToAppend, "Á");
   while(pPtr != NULL){
      switch(pPtr[0]){
         case 'Q':
            AppendText(GRAY, pPtr + 1);
            break;
         case 'R':
            AppendText(GREEN, pPtr + 1);
            break;
         case 'S':
         case 'X':
         case 'Z':
            AppendText(YELLOW, pPtr + 1);
            break;
         case 'T':
         case 'U':
         case 'V':
            AppendText(LIGHTBLUE, pPtr + 1);
            break;
         case 'P':
         case 'W':
            AppendText(WHITE, pPtr + 1);
            break;
         case 'Y':
            AppendText(GRAY, pPtr + 1);
            break;
         default:
            AppendText(Color, pPtr);
            break;
      }
      pPtr = strtok(NULL, "Á");
   }

How about updated with complete UTF-8 processing? :p

DarkMinion


|