forked from friendlyhj/GrassUtils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGrassUtilsCot.zs
More file actions
34 lines (30 loc) · 799 Bytes
/
GrassUtilsCot.zs
File metadata and controls
34 lines (30 loc) · 799 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#loader contenttweaker
#priority 29998
import scripts.grassUtils.LoggerCot as Logger;
static pi as double = 3.14159265358979324;
static e as double = 2.71828182845904524;
function i18n(key as string) as string{
return game.localize(key);
}
function i18nValued(key as string, values as string[]) as string {
var value as string = i18n(key);
var temp as string = "";
var i as int = 0;
var t as int = 0;
while (i < value.length) {
var j as string = value[i];
var k as string = "";
if (i + 2 <= value.length) {
k = value.substring(i, i + 2);
}
if (k == "%s") {
temp ~= values[t];
t += 1;
i += 1;
} else {
temp ~= j;
}
i += 1;
}
return temp;
}