-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-lang-json.html
82 lines (64 loc) · 2.76 KB
/
update-lang-json.html
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<title>Hiii :3</title>
<script>
function update_lang_json(file) {
if (file === undefined) return;
var fr = new FileReader();
fr.onload = function(e) {
var json_string = e.target.result;
var i1 = json_string.indexOf('"subtitles_sisyphusPrime_defeated5"')
var i2 = json_string.indexOf("\"", i1+35)
var i3 = json_string.indexOf("\"", i2+1)+1
//var i3 = json_string.indexOf("\"",
var additionalData = `,
"subtitles_v2_jumpscare_1": "",
"subtitles_v2_jumpscare_2": "",
"subtitles_v2_windowsbreak": "",
"subtitles_v2_intro_1": "",
"subtitles_v2_intro_2": "",
"subtitles_v2_intro_3": "",
"subtitles_v2_taunt1": "",
"subtitles_v2_taunt2": "",
"subtitles_v2_taunt3": "",
"subtitles_v2_taunt4": "",
"subtitles_v2_taunt5": "",
"subtitles_v2_taunt6": "",
"subtitles_v2_death": "",
"subtitles_v2_outro1": "",
"subtitles_v2_outro2": "",
"subtitles_v2_outro3": "",
"subtitles_v2Second_intro1_1": "",
"subtitles_v2Second_intro1_2": "",
"subtitles_v2Second_intro1_3": "",
"subtitles_v2Second_intro2_1": "",
"subtitles_v2Second_intro2_2": "",
"subtitles_v2Second_intro2_3": "",
"subtitles_v2Second_taunt1": "",
"subtitles_v2Second_taunt2": "",
"subtitles_v2Second_taunt3": "",
"subtitles_v2Second_taunt4": "",
"subtitles_v2Second_enrage": "",
"subtitles_v2Second_fleeing1": "",
"subtitles_v2Second_fleeing2_1": "",
"subtitles_v2Second_fleeing2_2": "",
"subtitles_v2Second_death": ""`
var new_json = json_string.substring(0, i3) + additionalData + json_string.substring(i3,json_string.length);
var download_file = document.getElementById("download_file");
download_file.setAttribute("href", window.URL.createObjectURL(new Blob([new_json], {type: "application/json"})));
download_file.setAttribute("download", file.name);
download_file.click();
}
fr.readAsText(file);
}
</script>
</head>
<body>
<input type="file" id="file" accept=".json">
<br>
<br>
<button onclick="update_lang_json(document.getElementById('file').files[0])">Download updated version</button>
<a id="download_file"></a>
</body>
</html>