-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
287 lines (283 loc) · 18 KB
/
index.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<!DOCTYPE html>
<html>
<head>
<title>
Risk of Rain 2 Language file Editor
</title>
<!-- Because google isn't indexing this? -->
<meta name="google-site-verification" content="hL0dJA3sewTEknEYd0JyJeghiZFZpSU2U62uGFdwwqI" />
<link rel="stylesheet" href="ror2languageeditor.css">
</head>
<!--
TODO:
More explanation of each section of file loading
-->
<body class="waiting">
<header>
<h1>Risk of Rain 2 Language File Editor</h1>
<p>Simplifies editing files like Items.txt and Equipment.txt for custom item names and descriptions.</p>
<details class="docs">
<summary>
<h2>What do I do? How does this work? Why?</h2>
</summary>
<section>
<h3>What to do, the quick version</h3>
<div>(To get detailed descriptions in game, and make any other changes you want)</div>
<ol>
<li>
Browse for and select all the files in <strong>steamapps/common/Risk of Rain 2/Risk of Rain 2_Data/StreamingAssets/Language/en</strong>
</li>
<li>
Make sure <strong>Tooltip/Pick-up text</strong> is still set to <strong>Only use description</strong>
</li>
<li>
<span class=cUserSetting>(Optional)</span> Load a pre-exisiting .patch.json file with changes
</li>
<li>
<span class=cUserSetting>(Optional)</span> Merge pre-modified language .txt files to import their changes
</li>
<li>
<span class=cUserSetting>(Optional)</span> Make any changes you want in the text boxes below each preview
<p><i>You can use the <strong>filter</strong> boxes to narrow down what you are looking for, or search the page with <strong>Ctrl+F</strong></i></p> </li>
<li>
Click <strong>Save standard patch</strong>, and place the file in the <strong>/en</strong> folder, and [re-]open your game
</li>
</ol>
</section>
<section>
<h3>Contact and support</h3>
<p>You can @Xuerian on the Risk of Rain 2 Modding discord, or <a href='https://github.com/Xuerian/RoR2LanguageEditor/issues'>open an issue on GitHub</a></p>
</section>
<section>
<h3>Questions and Answers</h3>
<dl>
<dt>How does this work?</dt>
<dd>
Risk of Rain 2's language files are json files. This compiles your modifications into a single json file that you use to override the text in game.
</dd>
<dt>Why not just edit the text files directly?</dt>
<dd>
If the game patches, those changes are lost. If you try to just copy the modified files over the new ones, you'll probably be missing new text.
</dd>
<dd>
Creating a patch preserves changes through game updates, and doesn't clobber the game's language updates.
</dd>
<dd>
Also, editing the language files in something like Notepad++ works, but is far more laborious than using the editing section in this tool.
</dd>
<dt>I thought you had to save individual modified text files?</dt>
<dd>
You can save your modifications in a single file. So long as it is alphabetically after any other .txt or .json files, it will apply over them
</dd>
<dt>How do language files work? Isn't their name important?</dt>
<dd>
Risk of Rain 2's language files are really json files with tokens and values, like "ITEM_BEAR_NAME": "Teddy Bear".
</dd>
<dd>
Each language file (Equipment.txt, Items.txt, etc) only contains one set of tokens (EQUIPMENT_*, ITEM_*) by default, and that's to make them easier to manage for the developers
</dd>
<dd>
However, since all the files are really a json table of {"Strings": {"ITEM_BEAR_NAME": "Teddy Bear", [etc]}, you can override lines from any file want in a separate, single file
</dd>
<dt>Why zz_*.patch.json?</dt>
<dd>
zz_ makes sure the game loads the file last. I prefer to use .json for the files, since they are json files. .patch is there to make it easy for this tool to suggest what files to open (It can only suggest extensions)
</dd>
<dd>
Any .txt or .json file name will work, so long as it is alphabetically last
</dd>
<dt>What if I want to make it a separate in-game language?</dt>
<dd>
<strong>(This is a good idea)</strong>
<ol>
<li>Make a new language folder next to /en</li>
<li>Copy language.json into it from English, and change "English" as desired</li>
<li>Save patch file into new language folder</li>
<li>Select new language in game</li>
<li>Switch to English and back to see changes in-game</li>
</ol>
</dd>
<dt>I've already modified the language files, how do I use this?</dt>
<dd>
<ol>
<li>Copy your modified files to another folder</li>
<li>Repair your game so the base language files are replaced (so the tool can tell what has been changed)</li>
<li>Open the base language files on the left</li>
<li>Open your modified language files on the right</li>
<li>Follow the instructions as normal. (I suggest making a separate language)</li>
</ol>
</dd>
<dt>What if I want to make it a mod for the Thunderstore?</dt>
<dd>
Make a new mod, depend on R2API, then include include a copy of the patch with the .language extension
</dd>
<dd>
See the mod RiskOfBrain as an example
</dd>
<dt>Will this page make any changes in my computer, or to my language files?</dt>
<dd>
No. You have to save the file yourself.
</dd>
<dt>What if I want to edit someone else's mod for myself?</dt>
<dd>
Open the base language files, then merge their .language file
</dd>
</dl>
</section>
</details>
</header>
<main>
<a href="https://github.com/Xuerian/RoR2LanguageEditor" class="github-corner" aria-label="View source on GitHub"><svg width="60" height="60" viewBox="0 0 250 250" style="fill:#151513; color:#fff; position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<fieldset class=load>
<legend>
Load language files to edit
</legend>
<fieldset class="fade-after">
<legend>Base game language</legend>
<p class="hide-after start">Start here!</p>
<input type=file id=INPUT_FILE_BASE accept=.txt,.json multiple>
<p class="doc"><i>Browse for and select all the files in <b><u>steamapps/common/Risk of Rain 2/Risk of Rain 2_Data/StreamingAssets/Language/en</u></b></i></p>
<dl class=_pickup>
<dt>Tooltip/Pick-up text:</dt>
<dd><label><input type=radio name=_pickup value=normal> Keep</label></dd>
<dd><label><input type=radio name=_pickup value=copy> Copy description</label></dd>
<dd><label><input type=radio name=_pickup value=desc checked> Only use description</label></dd>
</dl>
<!-- <p>Can load merged files as well</p> -->
</fieldset>
<fieldset class="patch">
<legend class="fade-before"><span class=cUserSetting>(Optional)</span> Pre-existing patch</legend>
<p class="doc hide-after bold">Base languages must be loaded before applying a patch</p>
<input class="hide-before" type=file id=INPUT_FILE_PATCH accept=".patch.language,.patch.json">
<p class="doc fade-before">A *.patch.json file generated by this tool</p>
</fieldset>
<fieldset class="merge">
<legend class="fade-before"><span class=cUserSetting>(Optional)</span> Merge files</legend>
<p class="doc hide-after bold">Base languages must be loaded before merging</p>
<input class="hide-before" type=file id=INPUT_FILE_MERGE accept=".txt,.language" multiple>
<p class="doc fade-before">You can merge manually-modified language files after opening the base language.</p>
<div class="_merge hide-before">
<label><input type=radio name=_merge value=all checked> Overwrite all</label>
<label><input type=radio name=_merge value=default> Only base</label>
</div>
<table class="_merge hide-before">
<tr>
<td><label><input type=checkbox class="merge-suffixes" value=NAME checked> _NAME</label></td>
<td><label><input type=checkbox class="merge-suffixes" value=PICKUP checked> _PICKUP</label></td>
</tr>
<tr>
<td><label><input type=checkbox class="merge-suffixes" value=DESC checked> _DESC</label></td>
<td><label><input type=checkbox class="merge-suffixes" value=LORE checked> _LORE</label></td>
</tr>
</table>
</fieldset>
<!--
<fieldset>
<legend>Replacements</legend>
<input type=file id=INPUT_FILE_REPLACEMENT accept=.r2lreplace.json multiple>
</fieldset>
<fieldset>
<legend>Convert Merged to Patches</legend>
<input type=file id=INPUT_FILE_REPLACEMENT accept=.txt multiple>
<p>Pre-existing modified language files can be loaded and parsed into patches automatically</p>
</fieldset>
-->
</fieldset>
<section class="hide-before export">
<fieldset>
<legend>Standard language patch</legend>
<button class="export-patch">Save standard patch</button>
<p class="doc"><strong class="cIsHealing">Save to <u>steamapps/common/Risk of Rain 2/Risk of Rain 2_Data/StreamingAssets/Language/en</u></strong></p>
</fieldset>
<fieldset>
<legend><span class=cUserSetting>(Optional)</span> R2API Language file</legend>
<button class="export-language">Save R2API language file</button>
<p class="doc">To load with R2API as a plugin, place .language file in BepInEx/Plugins/{SomeFolder}/</p>
<p class="doc">(This is just the patch file with a .language extension, which R2API will load)</p>
</fieldset>
</section>
<hr>
<!--
<details class=replacements>
<summary>Text replacements</summary>
<template class=replacement>
<dt>Replace..... ...with</dt>
<dd>
<textarea class=replacement-search></textarea>
<textarea class=replacement-replace></textarea>
</dd>
</template>
<dl>
</dl>
</details>
-->
<fieldset class="hide-before">
<legend>
Filter
</legend>
<label>
By key
<input type=text id=INPUT_FILTER_KEY>
</label>
<label>
By value
<input type=text id=INPUT_FILTER_VALUE>
</label>
<label><input type=radio checked name=INPUT_FILTER_MODIFIED value="all"> Show all</label>
<label><input type=radio name=INPUT_FILTER_MODIFIED value="modified"> Only modified</label>
<label><input type=checkbox id=INPUT_SHOW_BASE checked> Show base value</label>
<label><input type=checkbox id=INPUT_SHOW_LORE checked> Show lore</label>
</fieldset>
<div class=palette>
<span>In-game styles:</span>
<span class=cIsHealth>cIsHealth</span>
<span class=cIsDamage>cIsDamage</span>
<span class=cIsHealing>cIsHealing</span>
<span class=cIsUtility>cIsUtility</span>
<span class=cIsVoid>cIsVoid</span>
<span class=cHumanObjective>cHumanObjective</span>
<span class=cLunarObjective>cLunarObjective</span>
<span class=cStack>cStack</span>
<span class=cWorldEvent>cWorldEvent</span>
<span class=cArtifact>cArtifact</span>
<span class=cUserSetting>cUserSetting</span>
<span class=cDeath>cDeath</span>
<span class=cSub>cSub</span>
<span class=cMono>cMono</span>
<span class=cShrine>cShrine</span>
<span class=cEvent>cEvent</span>
<p class="doc">For example: <style=cIsHealth><span class=cIsHealth>Health-red text</span><style> <color=#FF00FF><span style="color: #FF00FF">Purple text</span></color> <i><i>Italic</i></i> <u><u>Underline</u></u> <s><s>Strikethrough</s></s></p>
<p class="doc">More styling options are usable in game, refer to <a href="http://digitalnativestudios.com/textmeshpro/docs/rich-text/" target="_blank">the documentation</a>. (Additional styling may not be visible in previews. See documentation for other supported HTML-like tags)</p>
</div>
<template class=file>
<details class=lang-file open>
<summary>
<h2 class=file-name></h2>
<span class="count"></span>
</summary>
<section>
</section>
</details>
</template>
<template class=file-pair>
<div class=pair>
<div class=key></div><div class=base-name></div>
<div class=preview></div>
<div class=edit><textarea class=edit-value></textarea></div>
<div class=base>
<div class=revert><button type=button><<</button></div>
<div>
<div class="preview base-preview"></div>
<div class=base-raw></div>
</div>
</div>
</div>
</template>
<div id=OUTPUT>
</div>
<div id=TEST>
</div>
</main>
<script src="ror2languageeditor.js"></script>
</body>
</html>