]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/lib/string.qh
Merge branch 'master' into TimePath/unified_weapons
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / string.qh
1 #ifndef STRING_H
2 #define STRING_H
3
4 #ifndef SVQC
5 float stringwidth_colors(string s, vector theSize)
6 {
7         return stringwidth(s, true, theSize);
8 }
9
10 float stringwidth_nocolors(string s, vector theSize)
11 {
12         return stringwidth(s, false, theSize);
13 }
14 #endif
15
16 // Timer (#5)
17 //
18 // TODO: macro
19 string seconds_tostring(float sec)
20 {
21         float minutes;
22         minutes = floor(sec / 60);
23
24         sec -= minutes * 60;
25         return sprintf("%d:%02d", minutes, sec);
26 }
27
28 int ColorTranslateMode;
29
30 string ColorTranslateRGB(string s)
31 {
32         if(ColorTranslateMode & 1)
33                 return strdecolorize(s);
34         else
35                 return s;
36 }
37
38 #endif