forked from dschu012/d2s-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.html
64 lines (62 loc) · 2.47 KB
/
constants.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/darkly/bootstrap.min.css"
crossorigin="anonymous">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />
<link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"
integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous">
<link href="css/app.css" rel="stylesheet" />
<script src="https://unpkg.com/[email protected]"></script>
<title>d2s - Example</title>
</head>
<body>
<div class="container">
<div class="row mt-2">
<p>
Click run. Then copy and paste the result to js/d2/constants.bundle.min.js
</p>
</div>
<div class="row mt-2">
<button id="run" class="btn btn-primary">Run</button>
</div>
<div class="row mt-2">
<code id="result"></code>
</div>
</div>
<script src="https://github.com/dschu012/d2s/releases/latest/download/d2s.bundle.min.js"></script>
<script>
const files = [
"data/local/LNG/ENG/string.txt",
"data/local/LNG/ENG/patchstring.txt",
"data/local/LNG/ENG/expansionstring.txt",
"data/global/excel/CharStats.txt",
"data/global/excel/PlayerClass.txt",
"data/global/excel/SkillDesc.txt",
"data/global/excel/Skills.txt",
"data/global/excel/RareSuffix.txt",
"data/global/excel/RarePrefix.txt",
"data/global/excel/MagicPrefix.txt",
"data/global/excel/MagicSuffix.txt",
"data/global/excel/Properties.txt",
"data/global/excel/ItemStatCost.txt",
"data/global/excel/Runes.txt",
"data/global/excel/SetItems.txt",
"data/global/excel/UniqueItems.txt",
"data/global/excel/ItemTypes.txt",
"data/global/excel/Armor.txt",
"data/global/excel/Weapons.txt",
"data/global/excel/Misc.txt",
"data/global/excel/Gems.txt",
]
document.getElementById("run").addEventListener("click", async function() {
let data = {};
for(const file of files) {
let response = await fetch(file);
data[file.substring(file.lastIndexOf('/') + 1, file.length)] = await response.text();
}
document.getElementById("result").innerText = `window.constants = {"constants": ${JSON.stringify(d2s.readConstantData(data))}}`;
});
</script>
</body>
</html>