-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhud_generator.html
More file actions
405 lines (370 loc) · 18.3 KB
/
hud_generator.html
File metadata and controls
405 lines (370 loc) · 18.3 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
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ItemsAdder HUD Generator</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
:root {
--primary-color: #2c3e50;
--secondary-color: #34495e;
--accent-color: #3498db;
}
body {
background-color: #f5f6fa;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
.navbar {
background-color: var(--primary-color);
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.card {
border: none;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
margin-bottom: 20px;
}
.card-header {
background-color: var(--secondary-color);
color: white;
border-radius: 10px 10px 0 0 !important;
}
.btn-primary {
background-color: var(--accent-color);
border: none;
}
.btn-primary:hover {
background-color: #2980b9;
}
.preview-area {
background-color: #2c3e50;
color: #ecf0f1;
font-family: 'Consolas', monospace;
padding: 15px;
border-radius: 5px;
max-height: 800px;
min-height: 600px;
overflow-y: auto;
}
.world-entry {
margin-bottom: 10px;
}
.world-entry .input-group {
margin-bottom: 5px;
}
</style>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark mb-4">
<div class="container">
<a class="navbar-brand" href="index.html">
<i class="fas fa-cube me-2"></i>
ItemsAdder Generators
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="itemsadder_generator.html">
<i class="fas fa-cube me-1"></i>Item Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="cooking_generator.html">
<i class="fas fa-fire me-1"></i>Cooking Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="crafting_generator.html">
<i class="fas fa-hammer me-1"></i>Crafting Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="loot_generator.html">
<i class="fas fa-gift me-1"></i>Loot Generator
</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="hud_generator.html">
<i class="fas fa-desktop me-1"></i>HUD Generator
</a>
</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">HUD Configuration</h5>
</div>
<div class="card-body">
<form id="hudForm">
<div class="mb-3">
<label class="form-label">HUD ID</label>
<input type="text" class="form-control" id="hudId" required>
<small class="text-muted">Unique identifier for your HUD (e.g., thirst_bar)</small>
</div>
<div class="mb-3">
<div class="form-check">
<input class="form-check-input" type="checkbox" id="enabled" checked>
<label class="form-check-label">Enabled</label>
</div>
</div>
<div class="mb-3">
<label class="form-label">World Settings</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="worldSettings" id="allWorlds" checked>
<label class="form-check-label">Enable in all worlds</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="worldSettings" id="specificWorlds">
<label class="form-check-label">Enable in specific worlds</label>
</div>
</div>
<div id="worldsList" class="mb-3" style="display: none;">
<div id="worldEntries">
<div class="world-entry">
<div class="input-group">
<input type="text" class="form-control" placeholder="World name (e.g., world_nether)">
<button type="button" class="btn btn-outline-danger" onclick="removeWorld(this)">
<i class="fas fa-times"></i>
</button>
</div>
<small class="text-muted">Use ! to exclude world (e.g., !world_the_end) or * for wildcard (e.g., world_*)</small>
</div>
</div>
<button type="button" class="btn btn-outline-primary mt-2" onclick="addWorld()">
<i class="fas fa-plus me-2"></i>Add World
</button>
</div>
<div class="mb-3">
<label class="form-label">HUD Type</label>
<select class="form-select" id="hudType" onchange="toggleHudType()">
<option value="frames">Frames HUD</option>
<option value="status">Status HUD</option>
<option value="custom">Custom HUD</option>
</select>
</div>
<!-- Frames HUD Settings -->
<div id="framesHudSettings" class="hud-type-section">
<h6 class="mb-3">Frames HUD Settings</h6>
<div class="mb-3">
<label class="form-label">Frame Path</label>
<input type="text" class="form-control" id="framePath" placeholder="hud/frames/health">
<small class="text-muted">Path to your frame texture</small>
</div>
<div class="mb-3">
<label class="form-label">Position</label>
<div class="row">
<div class="col-md-6">
<label class="form-label">X</label>
<input type="number" class="form-control" id="frameX" value="0">
</div>
<div class="col-md-6">
<label class="form-label">Y</label>
<input type="number" class="form-control" id="frameY" value="0">
</div>
</div>
</div>
</div>
<!-- Status HUD Settings -->
<div id="statusHudSettings" class="hud-type-section" style="display: none;">
<h6 class="mb-3">Status HUD Settings</h6>
<div class="mb-3">
<label class="form-label">Status Type</label>
<select class="form-select" id="statusType">
<option value="health">Health</option>
<option value="food">Food</option>
<option value="armor">Armor</option>
<option value="air">Air</option>
<option value="custom">Custom</option>
</select>
</div>
<div class="mb-3">
<label class="form-label">Position</label>
<div class="row">
<div class="col-md-6">
<label class="form-label">X</label>
<input type="number" class="form-control" id="statusX" value="0">
</div>
<div class="col-md-6">
<label class="form-label">Y</label>
<input type="number" class="form-control" id="statusY" value="0">
</div>
</div>
</div>
</div>
<!-- Custom HUD Settings -->
<div id="customHudSettings" class="hud-type-section" style="display: none;">
<h6 class="mb-3">Custom HUD Settings</h6>
<div class="mb-3">
<label class="form-label">Image Path</label>
<input type="text" class="form-control" id="customImagePath" placeholder="hud/custom/my_hud">
<small class="text-muted">Path to your custom HUD image</small>
</div>
<div class="mb-3">
<label class="form-label">Position</label>
<div class="row">
<div class="col-md-6">
<label class="form-label">X</label>
<input type="number" class="form-control" id="customX" value="0">
</div>
<div class="col-md-6">
<label class="form-label">Y</label>
<input type="number" class="form-control" id="customY" value="0">
</div>
</div>
</div>
</div>
<button type="submit" class="btn btn-primary">Generate Configuration</button>
</form>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card">
<div class="card-header">
<h5 class="mb-0">Preview</h5>
</div>
<div class="card-body">
<div class="preview-area" id="preview">
<pre>Configuration will appear here...</pre>
</div>
<button class="btn btn-primary mt-3" onclick="copyToClipboard()">
<i class="fas fa-copy me-2"></i>Copy to Clipboard
</button>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
// Toggle world settings visibility
document.querySelectorAll('input[name="worldSettings"]').forEach(radio => {
radio.addEventListener('change', function() {
document.getElementById('worldsList').style.display =
this.id === 'specificWorlds' ? 'block' : 'none';
});
});
// Toggle HUD type settings
function toggleHudType() {
const hudType = document.getElementById('hudType').value;
document.querySelectorAll('.hud-type-section').forEach(section => {
section.style.display = 'none';
});
document.getElementById(`${hudType}HudSettings`).style.display = 'block';
}
// Add new world entry
function addWorld() {
const worldEntries = document.getElementById('worldEntries');
const newEntry = document.createElement('div');
newEntry.className = 'world-entry';
newEntry.innerHTML = `
<div class="input-group">
<input type="text" class="form-control" placeholder="World name (e.g., world_nether)">
<button type="button" class="btn btn-outline-danger" onclick="removeWorld(this)">
<i class="fas fa-times"></i>
</button>
</div>
<small class="text-muted">Use ! to exclude world (e.g., !world_the_end) or * for wildcard (e.g., world_*)</small>
`;
worldEntries.appendChild(newEntry);
// Add listeners to new input
newEntry.querySelector('input').addEventListener('input', generateConfig);
}
// Remove world entry
function removeWorld(button) {
button.closest('.world-entry').remove();
}
// Generate configuration
document.getElementById('hudForm').addEventListener('submit', function(e) {
e.preventDefault();
generateConfig();
});
// Add real-time update listeners
const formInputs = document.querySelectorAll('#hudForm input, #hudForm select');
formInputs.forEach(input => {
input.addEventListener('input', generateConfig);
input.addEventListener('change', generateConfig);
});
function generateConfig() {
const hudId = document.getElementById('hudId').value;
const enabled = document.getElementById('enabled').checked;
const useSpecificWorlds = document.getElementById('specificWorlds').checked;
const hudType = document.getElementById('hudType').value;
let config = `huds:
${hudId}:
enabled: ${enabled}`;
// Add world settings if specific worlds are selected
if (useSpecificWorlds) {
const worldInputs = document.querySelectorAll('#worldEntries input');
const worlds = Array.from(worldInputs)
.map(input => input.value)
.filter(value => value.trim() !== '');
if (worlds.length > 0) {
config += `\n worlds:`;
worlds.forEach(world => {
config += `\n - "${world}"`;
});
}
}
// Add HUD type specific settings
switch (hudType) {
case 'frames':
const framePath = document.getElementById('framePath').value;
const frameX = document.getElementById('frameX').value;
const frameY = document.getElementById('frameY').value;
config += `\n type: frames
path: ${framePath}
x: ${frameX}
y: ${frameY}`;
break;
case 'status':
const statusType = document.getElementById('statusType').value;
const statusX = document.getElementById('statusX').value;
const statusY = document.getElementById('statusY').value;
config += `\n type: status
status_type: ${statusType}
x: ${statusX}
y: ${statusY}`;
break;
case 'custom':
const customImagePath = document.getElementById('customImagePath').value;
const customX = document.getElementById('customX').value;
const customY = document.getElementById('customY').value;
config += `\n type: custom
path: ${customImagePath}
x: ${customX}
y: ${customY}`;
break;
}
document.getElementById('preview').innerHTML = `<pre>${config}</pre>`;
}
function copyToClipboard() {
const preview = document.getElementById('preview').textContent;
navigator.clipboard.writeText(preview).then(() => {
alert('Configuration copied to clipboard!');
});
}
// Initialize the form
document.addEventListener('DOMContentLoaded', function() {
toggleHudType();
// Prevent form submission on Enter key
document.getElementById('hudForm').addEventListener('keydown', function(e) {
if (e.key === 'Enter') {
e.preventDefault();
}
});
});
</script>
</body>
</html>