forked from challenge-project/challenge-sandbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManialink.Script.txt
More file actions
56 lines (45 loc) · 1.32 KB
/
Copy pathManialink.Script.txt
File metadata and controls
56 lines (45 loc) · 1.32 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
// Manialink.Script.txt
// by BigBang1112
// part of Universe Library Set
// Cleaner construction of manialinks by seperating markup and script into two files.
// This library does depend on more libraries from the Universe Library Set:
// - File.Script.txt
// - Dictionary.Script.txt
// You only need to use the libraries above, although it's recommended to use the whole set.
*/
/*
// Compatible contexts:
// - CManiaApp
// - CMode
// - CServerPlugin?
*/
/*
// Text Construct(Text _Markup, Text _Script)
// Text FromFile(Text _ManialinkName, Boolean _Translate)
// Text FromFile(Text _ManialinkName)
*/
#Include "TextLib" as TextLib
#Include "Libs/BigBang1112/File.Script.txt" as File
#Include "Libs/BigBang1112/Dictionary.Script.txt" as Dictionary
Text Construct(Text _Markup, Text _Script) {
return """<manialink version="3">
{{{_Markup}}}
<script>
<![CDATA[{{{_Script}}}
]]>
</script>
</manialink>""";
}
Text FromFile(Text _ManialinkName, Boolean _Translate) {
declare Markup = File::Read(_ManialinkName^".xml");
declare Script = File::Read(_ManialinkName^".Script.txt");
if(_Translate) {
Markup = Dictionary::TranslateAllPhrases(Markup);
Script = Dictionary::TranslateAllPhrases(Script);
}
return Construct(Markup, Script);
}
Text FromFile(Text _ManialinkName) {
return FromFile(_ManialinkName, False);
}