3 #include <common/command/command.qh>
5 // =========================================================
6 // Markup chat characters command code, reworked by Samual
7 // Last updated: December 28th, 2011
8 // =========================================================
10 void GenericCommand_markup_init()
16 markup_from[i] = "&alien"; markup_to[i] = "\x12"; ++i;
17 markup_from[i] = "&:-)"; markup_to[i] = "\x13"; ++i;
18 markup_from[i] = "&:-("; markup_to[i] = "\x14"; ++i;
19 markup_from[i] = "&x-P"; markup_to[i] = "\x15"; ++i;
20 markup_from[i] = "&:-/"; markup_to[i] = "\x16"; ++i;
21 markup_from[i] = "&:-D"; markup_to[i] = "\x17"; ++i;
22 markup_from[i] = "&<<"; markup_to[i] = "\x18"; ++i;
23 markup_from[i] = "&>>"; markup_to[i] = "\x19"; ++i;
24 markup_from[i] = "&dot"; markup_to[i] = "\x1a"; ++i;
25 markup_from[i] = "&^_"; markup_to[i] = "\x1b"; ++i;
26 markup_from[i] = "&ysplat"; markup_to[i] = "\x1c"; ++i;
27 markup_from[i] = "&-]"; markup_to[i] = "\x1d"; ++i;
28 markup_from[i] = "&--"; markup_to[i] = "\x1e"; ++i;
29 markup_from[i] = "&[-"; markup_to[i] = "\x1f"; ++i;
30 markup_from[i] = "&s<"; markup_to[i] = "\x2c"; ++i;
31 markup_from[i] = "&s>"; markup_to[i] = "\x2e"; ++i;
32 markup_from[i] = "&<-"; markup_to[i] = "\x7f"; ++i;
33 markup_from[i] = "&[="; markup_to[i] = "\x80"; ++i;
34 markup_from[i] = "&=="; markup_to[i] = "\x81"; ++i;
35 markup_from[i] = "&=]"; markup_to[i] = "\x82"; ++i;
36 markup_from[i] = "&r!"; markup_to[i] = "\x84"; ++i;
37 markup_from[i] = "&|o|"; markup_to[i] = "\x85"; ++i;
38 markup_from[i] = "&|u|"; markup_to[i] = "\x86"; ++i;
39 markup_from[i] = "&|i|"; markup_to[i] = "\x87"; ++i;
40 markup_from[i] = "&|c|"; markup_to[i] = "\x88"; ++i;
41 markup_from[i] = "&[c]"; markup_to[i] = "\x89"; ++i;
42 markup_from[i] = "&[n]"; markup_to[i] = "\x8a"; ++i;
43 markup_from[i] = "&[]"; markup_to[i] = "\x8b"; ++i;
44 markup_from[i] = "&r?"; markup_to[i] = "\x8c"; ++i;
45 markup_from[i] = "&|>"; markup_to[i] = "\x8d"; ++i;
46 markup_from[i] = "&splat0"; markup_to[i] = "\x8e"; ++i;
47 markup_from[i] = "&splat1"; markup_to[i] = "\x8f"; ++i;
48 markup_from[i] = "&[["; markup_to[i] = "\x90"; ++i;
49 markup_from[i] = "&]]"; markup_to[i] = "\x91"; ++i;
50 markup_from[i] = "&splat2"; markup_to[i] = "\x9a"; ++i;
51 markup_from[i] = "&)("; markup_to[i] = "\x9b"; ++i;
52 markup_from[i] = "&splat3"; markup_to[i] = "\x9c"; ++i;
53 markup_from[i] = "&(."; markup_to[i] = "\x9d"; ++i;
54 markup_from[i] = "&.."; markup_to[i] = "\x9e"; ++i;
55 markup_from[i] = "&.)"; markup_to[i] = "\x9f"; ++i;
56 markup_from[i] = "&<|"; markup_to[i] = "\xff"; ++i;
59 string GenericCommand_markup(string s2)
64 GenericCommand_markup_init();
71 for (i = 0; i < len; ++i)
73 for(j = 0; j < NUM_MARKUPS; ++j)
75 s3 = substring(s2, i, strlen(markup_from[j]));
76 if (s3 == markup_from[j])
78 s = strcat(s, markup_to[j]);
79 i += strlen(markup_from[j]) - 1;
86 if(substring(s2, i, 2) == "&&")
88 s = strcat(s, strconv(ccase, red, red, "&"));
91 else if(substring(s2, i, 2) == "&d")
97 else if(substring(s2, i, 2) == "&a")
103 else if(substring(s2, i, 2) == "&n")
110 s = strcat(s, strconv(ccase, red, red, substring(s2, i, 1)));