@jjlmoya/utils-games-development 1.50.0 → 1.52.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/category/index.ts +3 -1
- package/src/entries.ts +8 -1
- package/src/tests/locale_completeness.test.ts +2 -2
- package/src/tests/tool_validation.test.ts +2 -2
- package/src/tool/audioLoopPointFinder/audio-loop-point-finder.css +322 -0
- package/src/tool/audioLoopPointFinder/audio-player.ts +84 -0
- package/src/tool/audioLoopPointFinder/bibliography.astro +6 -0
- package/src/tool/audioLoopPointFinder/bibliography.ts +16 -0
- package/src/tool/audioLoopPointFinder/client.ts +262 -0
- package/src/tool/audioLoopPointFinder/component.astro +147 -0
- package/src/tool/audioLoopPointFinder/dom-utils.ts +55 -0
- package/src/tool/audioLoopPointFinder/entry.ts +27 -0
- package/src/tool/audioLoopPointFinder/i18n/de.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/en.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/es.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/fr.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/id.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/it.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/ja.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/ko.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/nl.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/pl.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/pt.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/ru.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/sv.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/tr.ts +211 -0
- package/src/tool/audioLoopPointFinder/i18n/zh.ts +211 -0
- package/src/tool/audioLoopPointFinder/index.ts +11 -0
- package/src/tool/audioLoopPointFinder/logic.test.ts +72 -0
- package/src/tool/audioLoopPointFinder/logic.ts +214 -0
- package/src/tool/audioLoopPointFinder/metadata-parser.ts +94 -0
- package/src/tool/audioLoopPointFinder/seo.astro +15 -0
- package/src/tool/audioLoopPointFinder/ui.ts +42 -0
- package/src/tool/audioLoopPointFinder/waveform-renderer.ts +53 -0
- package/src/tool/saveFileEditor/bibliography.astro +6 -0
- package/src/tool/saveFileEditor/bibliography.ts +12 -0
- package/src/tool/saveFileEditor/component.astro +351 -0
- package/src/tool/saveFileEditor/entry.ts +28 -0
- package/src/tool/saveFileEditor/game-save-file-editor.css +250 -0
- package/src/tool/saveFileEditor/i18n/de.ts +182 -0
- package/src/tool/saveFileEditor/i18n/en.ts +182 -0
- package/src/tool/saveFileEditor/i18n/es.ts +182 -0
- package/src/tool/saveFileEditor/i18n/fr.ts +182 -0
- package/src/tool/saveFileEditor/i18n/id.ts +182 -0
- package/src/tool/saveFileEditor/i18n/it.ts +182 -0
- package/src/tool/saveFileEditor/i18n/ja.ts +182 -0
- package/src/tool/saveFileEditor/i18n/ko.ts +182 -0
- package/src/tool/saveFileEditor/i18n/nl.ts +182 -0
- package/src/tool/saveFileEditor/i18n/pl.ts +182 -0
- package/src/tool/saveFileEditor/i18n/pt.ts +182 -0
- package/src/tool/saveFileEditor/i18n/ru.ts +182 -0
- package/src/tool/saveFileEditor/i18n/sv.ts +182 -0
- package/src/tool/saveFileEditor/i18n/tr.ts +182 -0
- package/src/tool/saveFileEditor/i18n/zh.ts +182 -0
- package/src/tool/saveFileEditor/index.ts +11 -0
- package/src/tool/saveFileEditor/logic.test.ts +69 -0
- package/src/tool/saveFileEditor/logic.ts +139 -0
- package/src/tool/saveFileEditor/seo.astro +15 -0
- package/src/tool/saveFileEditor/ui.ts +24 -0
- package/src/tools.ts +5 -0
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { SaveFileEditorUI } from './ui';
|
|
3
|
+
import './game-save-file-editor.css';
|
|
4
|
+
|
|
5
|
+
interface Props {
|
|
6
|
+
ui: SaveFileEditorUI;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
const { ui: t } = Astro.props;
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
<div
|
|
13
|
+
class="save-editor-main-card"
|
|
14
|
+
id="save-editor-root"
|
|
15
|
+
data-decode-error={t.decodeError}
|
|
16
|
+
data-bytes-unit={t.bytesUnit}
|
|
17
|
+
>
|
|
18
|
+
<div style="display: none;">
|
|
19
|
+
<span>{t.title}</span>
|
|
20
|
+
<span>{t.subtitle}</span>
|
|
21
|
+
</div>
|
|
22
|
+
|
|
23
|
+
<div class="form-group">
|
|
24
|
+
<label for="save-file-input" class="form-label">{t.dropSaveFile}</label>
|
|
25
|
+
<div class="dropzone" id="drop-zone">
|
|
26
|
+
<input type="file" id="save-file-input" style="display: none;" accept=".json,.sav,.txt,.dat" />
|
|
27
|
+
<p>{t.dropSaveFile}</p>
|
|
28
|
+
<button type="button" class="btn-secondary" id="browse-btn">{t.orSelectFile}</button>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
|
|
32
|
+
<div class="editor-unified-layout">
|
|
33
|
+
<div class="control-panel">
|
|
34
|
+
<h3 class="panel-section-title">{t.decodePanelTitle}</h3>
|
|
35
|
+
|
|
36
|
+
<div class="options-row">
|
|
37
|
+
<div class="form-group">
|
|
38
|
+
<label class="form-label">{t.encryptionMethod}</label>
|
|
39
|
+
<div class="method-chip-group" id="enc-method-group">
|
|
40
|
+
<button type="button" class="chip-btn active" data-value="base64">{t.methodBase64}</button>
|
|
41
|
+
<button type="button" class="chip-btn" data-value="xor">{t.methodXor}</button>
|
|
42
|
+
<button type="button" class="chip-btn" data-value="raw">{t.methodRaw}</button>
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<div class="form-group" id="xor-key-group">
|
|
47
|
+
<label for="xor-key-input" class="form-label">{t.xorKeyLabel}</label>
|
|
48
|
+
<input type="text" id="xor-key-input" class="input-text" placeholder={t.xorKeyPlaceholder} />
|
|
49
|
+
</div>
|
|
50
|
+
</div>
|
|
51
|
+
|
|
52
|
+
<div id="decode-error" class="error-banner" style="display: none;"></div>
|
|
53
|
+
|
|
54
|
+
<div class="form-group" style="flex: 1; display: flex; flex-direction: column;">
|
|
55
|
+
<label for="json-code-input" class="form-label">{t.jsonRawTitle}</label>
|
|
56
|
+
<textarea id="json-code-input" class="textarea-code" spellcheck="false" style="flex: 1; min-height: 340px;"></textarea>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="control-panel">
|
|
61
|
+
<h3 class="panel-section-title">{t.exportPanelTitle}</h3>
|
|
62
|
+
|
|
63
|
+
<div class="stats-grid">
|
|
64
|
+
<div class="stat-item">
|
|
65
|
+
<span class="stat-val" id="stat-format">BASE64</span>
|
|
66
|
+
<span class="stat-lbl">{t.detectedFormat}</span>
|
|
67
|
+
</div>
|
|
68
|
+
<div class="stat-item">
|
|
69
|
+
<span class="stat-val" id="stat-keys">0</span>
|
|
70
|
+
<span class="stat-lbl">{t.decodedKeysCount}</span>
|
|
71
|
+
</div>
|
|
72
|
+
<div class="stat-item">
|
|
73
|
+
<span class="stat-val" id="stat-size">0 B</span>
|
|
74
|
+
<span class="stat-lbl">{t.dataSize}</span>
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div class="form-group" style="flex: 1; display: flex; flex-direction: column;">
|
|
79
|
+
<label for="export-preview" class="form-label">{t.exportPreviewLabel}</label>
|
|
80
|
+
<textarea id="export-preview" class="textarea-code" readonly style="flex: 1; min-height: 340px;"></textarea>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<div style="display: flex; gap: 0.5rem; flex-wrap: wrap;">
|
|
84
|
+
<button type="button" class="btn-primary" id="export-download-btn" style="flex: 1;">{t.encodeAndDownload}</button>
|
|
85
|
+
<button type="button" class="btn-secondary" id="export-copy-btn">{t.copyEncoded}</button>
|
|
86
|
+
</div>
|
|
87
|
+
<span id="copied-notice" class="copied-notice" style="display: none;">{t.copiedNotice}</span>
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
</div>
|
|
91
|
+
|
|
92
|
+
<script>
|
|
93
|
+
import { decodeSaveData, encodeSaveData, detectFormat, bytesToBase64, applyXor, strToUtf8Bytes } from './logic';
|
|
94
|
+
|
|
95
|
+
const STORAGE_KEY_RAW = 'save_editor_last_raw';
|
|
96
|
+
const STORAGE_KEY_METHOD = 'save_editor_last_method';
|
|
97
|
+
const STORAGE_KEY_KEY = 'save_editor_last_key';
|
|
98
|
+
|
|
99
|
+
const DEFAULT_SAMPLE = {
|
|
100
|
+
player: { name: 'ShadowKnight', level: 45, gold: 12500, health: 100, mana: 80 },
|
|
101
|
+
inventory: ['Legendary Sword', 'Health Potion x5', 'Dragon Armor'],
|
|
102
|
+
unlockedLevels: [1, 2, 3, 4, 5],
|
|
103
|
+
settings: { difficulty: 'hard', sound: true }
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
let currentJsonData: unknown = DEFAULT_SAMPLE;
|
|
107
|
+
let rawSourceContent: string = '';
|
|
108
|
+
let selectedMethod: 'base64' | 'xor' | 'raw' = 'base64';
|
|
109
|
+
|
|
110
|
+
const rootCard = document.getElementById('save-editor-root');
|
|
111
|
+
const defaultDecodeErrorMsg = rootCard?.dataset.decodeError || '';
|
|
112
|
+
const bytesUnit = rootCard?.dataset.bytesUnit || 'B';
|
|
113
|
+
|
|
114
|
+
const encMethodGroup = document.getElementById('enc-method-group');
|
|
115
|
+
const xorKeyInput = document.getElementById('xor-key-input') as HTMLInputElement;
|
|
116
|
+
const decodeError = document.getElementById('decode-error');
|
|
117
|
+
|
|
118
|
+
const jsonCodeInput = document.getElementById('json-code-input') as HTMLTextAreaElement;
|
|
119
|
+
const exportPreview = document.getElementById('export-preview') as HTMLTextAreaElement;
|
|
120
|
+
const exportDownloadBtn = document.getElementById('export-download-btn');
|
|
121
|
+
const exportCopyBtn = document.getElementById('export-copy-btn');
|
|
122
|
+
const copiedNotice = document.getElementById('copied-notice');
|
|
123
|
+
|
|
124
|
+
const statFormat = document.getElementById('stat-format');
|
|
125
|
+
const statKeys = document.getElementById('stat-keys');
|
|
126
|
+
const statSize = document.getElementById('stat-size');
|
|
127
|
+
|
|
128
|
+
const dropZone = document.getElementById('drop-zone');
|
|
129
|
+
const fileInput = document.getElementById('save-file-input') as HTMLInputElement;
|
|
130
|
+
const browseBtn = document.getElementById('browse-btn');
|
|
131
|
+
|
|
132
|
+
function updateChipGroupActiveState(selectedValue: string) {
|
|
133
|
+
if (!encMethodGroup) return;
|
|
134
|
+
const chips = encMethodGroup.querySelectorAll<HTMLButtonElement>('.chip-btn');
|
|
135
|
+
chips.forEach((chip) => {
|
|
136
|
+
chip.classList.toggle('active', chip.dataset.value === selectedValue);
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function setMethod(method: 'base64' | 'xor' | 'raw') {
|
|
141
|
+
selectedMethod = method;
|
|
142
|
+
updateChipGroupActiveState(method);
|
|
143
|
+
saveStateToLocalStorage();
|
|
144
|
+
performDecode();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
encMethodGroup?.querySelectorAll<HTMLButtonElement>('.chip-btn').forEach((btn) => {
|
|
148
|
+
btn.addEventListener('click', () => {
|
|
149
|
+
const val = btn.dataset.value as 'base64' | 'xor' | 'raw';
|
|
150
|
+
setMethod(val);
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
function saveStateToLocalStorage() {
|
|
155
|
+
try {
|
|
156
|
+
localStorage.setItem(STORAGE_KEY_RAW, rawSourceContent);
|
|
157
|
+
localStorage.setItem(STORAGE_KEY_METHOD, selectedMethod);
|
|
158
|
+
if (xorKeyInput) localStorage.setItem(STORAGE_KEY_KEY, xorKeyInput.value);
|
|
159
|
+
} catch {
|
|
160
|
+
void 0;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function updateEditorWithData(data: unknown, format: string) {
|
|
165
|
+
currentJsonData = data;
|
|
166
|
+
const jsonStr = JSON.stringify(data, null, 2);
|
|
167
|
+
if (jsonCodeInput && document.activeElement !== jsonCodeInput) {
|
|
168
|
+
jsonCodeInput.value = jsonStr;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
if (statFormat) statFormat.textContent = format.toUpperCase();
|
|
172
|
+
if (statKeys && typeof data === 'object' && data !== null) {
|
|
173
|
+
statKeys.textContent = String(Object.keys(data as object).length);
|
|
174
|
+
}
|
|
175
|
+
if (statSize) {
|
|
176
|
+
statSize.textContent = `${jsonStr.length} ${bytesUnit}`;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
updateExportPreview();
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function updateExportPreview() {
|
|
183
|
+
if (!exportPreview) return;
|
|
184
|
+
const key = xorKeyInput?.value || '';
|
|
185
|
+
const encoded = encodeSaveData(currentJsonData, { method: selectedMethod, xorKey: key });
|
|
186
|
+
exportPreview.value = encoded;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function renderDecodeError(errorMsg?: string) {
|
|
190
|
+
if (!decodeError) return;
|
|
191
|
+
if (errorMsg) {
|
|
192
|
+
decodeError.textContent = errorMsg;
|
|
193
|
+
decodeError.style.display = 'block';
|
|
194
|
+
} else {
|
|
195
|
+
decodeError.style.display = 'none';
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function performDecode() {
|
|
200
|
+
if (!rawSourceContent) return;
|
|
201
|
+
const key = xorKeyInput?.value || '';
|
|
202
|
+
const res = decodeSaveData(rawSourceContent, { method: selectedMethod, xorKey: key });
|
|
203
|
+
|
|
204
|
+
if (res.success && res.data) {
|
|
205
|
+
renderDecodeError();
|
|
206
|
+
updateEditorWithData(res.data, selectedMethod);
|
|
207
|
+
saveStateToLocalStorage();
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
renderDecodeError(res.error || defaultDecodeErrorMsg);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
function encodeRawStringFallback(val: string): string {
|
|
215
|
+
const key = xorKeyInput?.value || '';
|
|
216
|
+
const utf8 = strToUtf8Bytes(val);
|
|
217
|
+
|
|
218
|
+
if (selectedMethod === 'base64') {
|
|
219
|
+
return bytesToBase64(utf8);
|
|
220
|
+
}
|
|
221
|
+
if (selectedMethod === 'xor' && key) {
|
|
222
|
+
return bytesToBase64(applyXor(utf8, key));
|
|
223
|
+
}
|
|
224
|
+
return val;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
function updateUnparsedPreview() {
|
|
228
|
+
if (exportPreview && jsonCodeInput?.value.trim()) {
|
|
229
|
+
exportPreview.value = encodeRawStringFallback(jsonCodeInput.value);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
function updateJsonStats(val: string, parsed: object) {
|
|
234
|
+
if (statKeys) {
|
|
235
|
+
statKeys.textContent = String(Object.keys(parsed).length);
|
|
236
|
+
}
|
|
237
|
+
if (statSize) {
|
|
238
|
+
statSize.textContent = `${val.length} ${bytesUnit}`;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
function handleJsonInputChange() {
|
|
243
|
+
if (!jsonCodeInput) return;
|
|
244
|
+
try {
|
|
245
|
+
const parsed = JSON.parse(jsonCodeInput.value);
|
|
246
|
+
currentJsonData = parsed;
|
|
247
|
+
if (typeof parsed === 'object' && parsed !== null) {
|
|
248
|
+
updateJsonStats(jsonCodeInput.value, parsed as object);
|
|
249
|
+
}
|
|
250
|
+
updateExportPreview();
|
|
251
|
+
} catch {
|
|
252
|
+
updateUnparsedPreview();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
jsonCodeInput?.addEventListener('input', handleJsonInputChange);
|
|
257
|
+
jsonCodeInput?.addEventListener('keyup', handleJsonInputChange);
|
|
258
|
+
jsonCodeInput?.addEventListener('change', handleJsonInputChange);
|
|
259
|
+
|
|
260
|
+
xorKeyInput?.addEventListener('input', () => {
|
|
261
|
+
saveStateToLocalStorage();
|
|
262
|
+
performDecode();
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
exportCopyBtn?.addEventListener('click', () => {
|
|
266
|
+
if (!exportPreview) return;
|
|
267
|
+
navigator.clipboard.writeText(exportPreview.value);
|
|
268
|
+
if (copiedNotice) {
|
|
269
|
+
copiedNotice.style.display = 'inline';
|
|
270
|
+
setTimeout(() => {
|
|
271
|
+
copiedNotice.style.display = 'none';
|
|
272
|
+
}, 2000);
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
exportDownloadBtn?.addEventListener('click', () => {
|
|
277
|
+
if (!exportPreview) return;
|
|
278
|
+
const blob = new Blob([exportPreview.value], { type: 'text/plain;charset=utf-8' });
|
|
279
|
+
const url = URL.createObjectURL(blob);
|
|
280
|
+
const a = document.createElement('a');
|
|
281
|
+
a.href = url;
|
|
282
|
+
a.download = 'save_data.sav';
|
|
283
|
+
a.click();
|
|
284
|
+
URL.revokeObjectURL(url);
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
function processFileContent(content: string) {
|
|
288
|
+
rawSourceContent = content.trim();
|
|
289
|
+
const autoDetected = detectFormat(rawSourceContent, xorKeyInput?.value || '');
|
|
290
|
+
setMethod(autoDetected);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
function readFileAndProcess(file: File) {
|
|
294
|
+
const reader = new FileReader();
|
|
295
|
+
reader.onload = (evt) => {
|
|
296
|
+
if (evt.target?.result) {
|
|
297
|
+
processFileContent(evt.target.result as string);
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
reader.readAsText(file);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
browseBtn?.addEventListener('click', () => fileInput?.click());
|
|
304
|
+
fileInput?.addEventListener('change', (e) => {
|
|
305
|
+
const file = (e.target as HTMLInputElement).files?.[0];
|
|
306
|
+
if (file) readFileAndProcess(file);
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
if (dropZone) {
|
|
310
|
+
dropZone.addEventListener('dragover', (e) => e.preventDefault());
|
|
311
|
+
dropZone.addEventListener('drop', (e) => {
|
|
312
|
+
e.preventDefault();
|
|
313
|
+
const file = e.dataTransfer?.files?.[0];
|
|
314
|
+
if (file) readFileAndProcess(file);
|
|
315
|
+
});
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function getLocalStorageValue(key: string): string {
|
|
319
|
+
try {
|
|
320
|
+
return localStorage.getItem(key) || '';
|
|
321
|
+
} catch {
|
|
322
|
+
return '';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function restoreSavedState(): boolean {
|
|
327
|
+
const savedRaw = getLocalStorageValue(STORAGE_KEY_RAW);
|
|
328
|
+
if (!savedRaw) return false;
|
|
329
|
+
|
|
330
|
+
rawSourceContent = savedRaw;
|
|
331
|
+
const savedMethod = getLocalStorageValue(STORAGE_KEY_METHOD);
|
|
332
|
+
if (savedMethod === 'base64' || savedMethod === 'xor' || savedMethod === 'raw') {
|
|
333
|
+
selectedMethod = savedMethod;
|
|
334
|
+
updateChipGroupActiveState(savedMethod);
|
|
335
|
+
}
|
|
336
|
+
const savedKey = getLocalStorageValue(STORAGE_KEY_KEY);
|
|
337
|
+
if (xorKeyInput && savedKey) xorKeyInput.value = savedKey;
|
|
338
|
+
|
|
339
|
+
performDecode();
|
|
340
|
+
return true;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function initTool() {
|
|
344
|
+
if (restoreSavedState()) return;
|
|
345
|
+
|
|
346
|
+
rawSourceContent = encodeSaveData(DEFAULT_SAMPLE, { method: 'base64', xorKey: '' });
|
|
347
|
+
setMethod('base64');
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
initTool();
|
|
351
|
+
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { GamesToolEntry, ToolLocaleContent } from '../../types';
|
|
2
|
+
import type { SaveFileEditorUI } from './ui';
|
|
3
|
+
|
|
4
|
+
export type { SaveFileEditorUI };
|
|
5
|
+
|
|
6
|
+
export type SaveFileEditorLocaleContent = ToolLocaleContent<SaveFileEditorUI>;
|
|
7
|
+
|
|
8
|
+
export const saveFileEditor: GamesToolEntry<SaveFileEditorUI> = {
|
|
9
|
+
id: 'save-file-editor',
|
|
10
|
+
icons: { bg: 'mdi:gamepad-variant', fg: 'mdi:file-lock-outline' },
|
|
11
|
+
i18n: {
|
|
12
|
+
de: () => import('./i18n/de').then((m) => m.content),
|
|
13
|
+
en: () => import('./i18n/en').then((m) => m.content),
|
|
14
|
+
es: () => import('./i18n/es').then((m) => m.content),
|
|
15
|
+
fr: () => import('./i18n/fr').then((m) => m.content),
|
|
16
|
+
id: () => import('./i18n/id').then((m) => m.content),
|
|
17
|
+
it: () => import('./i18n/it').then((m) => m.content),
|
|
18
|
+
ja: () => import('./i18n/ja').then((m) => m.content),
|
|
19
|
+
ko: () => import('./i18n/ko').then((m) => m.content),
|
|
20
|
+
nl: () => import('./i18n/nl').then((m) => m.content),
|
|
21
|
+
pl: () => import('./i18n/pl').then((m) => m.content),
|
|
22
|
+
pt: () => import('./i18n/pt').then((m) => m.content),
|
|
23
|
+
ru: () => import('./i18n/ru').then((m) => m.content),
|
|
24
|
+
sv: () => import('./i18n/sv').then((m) => m.content),
|
|
25
|
+
tr: () => import('./i18n/tr').then((m) => m.content),
|
|
26
|
+
zh: () => import('./i18n/zh').then((m) => m.content),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
.save-editor-main-card {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
gap: 1.5rem;
|
|
5
|
+
padding: 1.5rem;
|
|
6
|
+
border-radius: 1rem;
|
|
7
|
+
background: var(--bg-surface, #fff);
|
|
8
|
+
border: 1px solid var(--border-base, #e2e8f0);
|
|
9
|
+
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
|
|
10
|
+
color: var(--text-base, #0f172a);
|
|
11
|
+
transition: background-color 0.2s, border-color 0.2s;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.theme-dark .save-editor-main-card,
|
|
15
|
+
:global(.theme-dark) .save-editor-main-card {
|
|
16
|
+
background: var(--bg-surface, #0f172a);
|
|
17
|
+
border-color: var(--border-base, #1e293b);
|
|
18
|
+
color: var(--text-base, #f8fafc);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.editor-unified-layout {
|
|
22
|
+
display: grid;
|
|
23
|
+
grid-template-columns: 1fr;
|
|
24
|
+
gap: 1.5rem;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (min-width: 900px) {
|
|
28
|
+
.editor-unified-layout {
|
|
29
|
+
grid-template-columns: 1fr 1fr;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.control-panel {
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: 1rem;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.dropzone {
|
|
40
|
+
border: 2px dashed var(--border-base, #cbd5e1);
|
|
41
|
+
border-radius: 0.75rem;
|
|
42
|
+
padding: 2rem 1rem;
|
|
43
|
+
text-align: center;
|
|
44
|
+
background: rgba(59, 130, 246, 0.03);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
transition: background-color 0.2s;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.theme-dark .dropzone,
|
|
50
|
+
:global(.theme-dark) .dropzone {
|
|
51
|
+
border-color: var(--border-base, #334155);
|
|
52
|
+
background: rgba(30, 41, 59, 0.3);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.dropzone:hover {
|
|
56
|
+
background: rgba(59, 130, 246, 0.08);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.panel-section-title {
|
|
60
|
+
font-size: 1rem;
|
|
61
|
+
font-weight: 700;
|
|
62
|
+
margin: 0 0 0.25rem;
|
|
63
|
+
color: var(--text-base, #0f172a);
|
|
64
|
+
opacity: 0.9;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.theme-dark .panel-section-title,
|
|
68
|
+
:global(.theme-dark) .panel-section-title {
|
|
69
|
+
color: var(--text-base, #f8fafc);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.options-row {
|
|
73
|
+
display: grid;
|
|
74
|
+
grid-template-columns: 1fr;
|
|
75
|
+
gap: 0.75rem;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@media (min-width: 500px) {
|
|
79
|
+
.options-row {
|
|
80
|
+
grid-template-columns: 1fr 1fr;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.form-group {
|
|
85
|
+
display: flex;
|
|
86
|
+
flex-direction: column;
|
|
87
|
+
gap: 0.35rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.form-label {
|
|
91
|
+
font-size: 0.8125rem;
|
|
92
|
+
font-weight: 600;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.input-select, .input-text, .textarea-code {
|
|
96
|
+
width: 100%;
|
|
97
|
+
padding: 0.6rem 0.8rem;
|
|
98
|
+
border-radius: 0.5rem;
|
|
99
|
+
border: 1px solid var(--border-base, #cbd5e1);
|
|
100
|
+
background: var(--bg-surface, #fff);
|
|
101
|
+
color: var(--text-base, #0f172a);
|
|
102
|
+
font-size: 0.875rem;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.method-chip-group {
|
|
106
|
+
display: flex;
|
|
107
|
+
gap: 0.35rem;
|
|
108
|
+
background: var(--bg-surface, #fff);
|
|
109
|
+
padding: 0.25rem;
|
|
110
|
+
border-radius: 0.5rem;
|
|
111
|
+
border: 1px solid var(--border-base, #cbd5e1);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.theme-dark .method-chip-group,
|
|
115
|
+
:global(.theme-dark) .method-chip-group {
|
|
116
|
+
background: var(--bg-surface, #0f172a);
|
|
117
|
+
border-color: var(--border-base, #334155);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.chip-btn {
|
|
121
|
+
flex: 1;
|
|
122
|
+
padding: 0.45rem 0.5rem;
|
|
123
|
+
border-radius: 0.375rem;
|
|
124
|
+
border: none;
|
|
125
|
+
background: transparent;
|
|
126
|
+
color: var(--text-base, #64748b);
|
|
127
|
+
font-size: 0.75rem;
|
|
128
|
+
font-weight: 600;
|
|
129
|
+
cursor: pointer;
|
|
130
|
+
transition: all 0.15s ease;
|
|
131
|
+
text-align: center;
|
|
132
|
+
white-space: nowrap;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.theme-dark .chip-btn,
|
|
136
|
+
:global(.theme-dark) .chip-btn {
|
|
137
|
+
color: var(--text-base, #94a3b8);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.chip-btn.active {
|
|
141
|
+
background: var(--accent-base, #3b82f6);
|
|
142
|
+
color: var(--text-inverse, #fff);
|
|
143
|
+
box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.chip-btn:hover:not(.active) {
|
|
147
|
+
background: rgba(59, 130, 246, 0.08);
|
|
148
|
+
color: var(--accent-base, #3b82f6);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.textarea-code {
|
|
152
|
+
min-height: 250px;
|
|
153
|
+
resize: vertical;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.btn-primary {
|
|
157
|
+
padding: 0.75rem 1.25rem;
|
|
158
|
+
border-radius: 0.5rem;
|
|
159
|
+
border: none;
|
|
160
|
+
background: var(--accent-base, #3b82f6);
|
|
161
|
+
color: var(--text-inverse, #fff);
|
|
162
|
+
font-weight: 700;
|
|
163
|
+
cursor: pointer;
|
|
164
|
+
transition: all 0.2s;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.btn-primary:hover {
|
|
168
|
+
background: var(--accent-base, #2563eb);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.btn-secondary {
|
|
172
|
+
padding: 0.5rem 1rem;
|
|
173
|
+
border-radius: 0.5rem;
|
|
174
|
+
border: 1px solid var(--border-base, #cbd5e1);
|
|
175
|
+
background: transparent;
|
|
176
|
+
color: inherit;
|
|
177
|
+
font-weight: 600;
|
|
178
|
+
font-size: 0.875rem;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.theme-dark .btn-secondary,
|
|
183
|
+
:global(.theme-dark) .btn-secondary {
|
|
184
|
+
border-color: var(--border-base, #334155);
|
|
185
|
+
color: var(--text-base, #e2e8f0);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
.error-banner {
|
|
189
|
+
padding: 0.75rem 1rem;
|
|
190
|
+
border-radius: 0.5rem;
|
|
191
|
+
background: rgba(239, 68, 68, 0.1);
|
|
192
|
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
|
193
|
+
color: var(--text-danger, #ef4444);
|
|
194
|
+
font-size: 0.875rem;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.stats-grid {
|
|
198
|
+
display: grid;
|
|
199
|
+
grid-template-columns: repeat(3, 1fr);
|
|
200
|
+
gap: 0.75rem;
|
|
201
|
+
padding: 1rem;
|
|
202
|
+
border-radius: 0.75rem;
|
|
203
|
+
background: rgba(0, 0, 0, 0.02);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.theme-dark .stats-grid,
|
|
207
|
+
:global(.theme-dark) .stats-grid {
|
|
208
|
+
background: rgba(255, 255, 255, 0.02);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.stat-item {
|
|
212
|
+
display: flex;
|
|
213
|
+
flex-direction: column;
|
|
214
|
+
align-items: center;
|
|
215
|
+
text-align: center;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.stat-val {
|
|
219
|
+
font-size: 1.125rem;
|
|
220
|
+
font-weight: 800;
|
|
221
|
+
color: var(--accent-base, #3b82f6);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.stat-lbl {
|
|
225
|
+
font-size: 0.75rem;
|
|
226
|
+
opacity: 0.7;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.copied-notice {
|
|
230
|
+
color: var(--accent-base, #10b981);
|
|
231
|
+
font-size: 0.875rem;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.tree-view-container {
|
|
235
|
+
display: flex;
|
|
236
|
+
flex-direction: column;
|
|
237
|
+
gap: 1rem;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.tree-toolbar {
|
|
241
|
+
display: flex;
|
|
242
|
+
gap: 0.5rem;
|
|
243
|
+
flex-wrap: wrap;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.tree-node {
|
|
247
|
+
margin-left: 1rem;
|
|
248
|
+
padding-left: 0.5rem;
|
|
249
|
+
border-left: 1px dashed var(--border-subtle, #cbd5e1);
|
|
250
|
+
}
|