Skip to content

Commit 135e150

Browse files
authored
Merge pull request #91 from louis-e/settings-menu
Added settings menu including scale option and custom bbox input
2 parents 5cb749b + a284f77 commit 135e150

File tree

6 files changed

+292
-33
lines changed

6 files changed

+292
-33
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,12 @@ Feel free to choose an item from the To-Do or Known Bugs list, or bring your own
7070
- [ ] Refactor fountain structure implementation
7171
- [ ] Automatic new world creation instead of using an existing world
7272
- [ ] Tool for mapping real coordinates to Minecraft coordinates
73-
- [ ] Setup fork of [https://github.com/aaronr/bboxfinder.com](https://github.com/aaronr/bboxfinder.com) for easy bbox picking
7473
- [ ] Add interior to buildings
7574
- [ ] Evaluate and implement elevation
76-
- [ ] Generate a few big cities using high performance hardware and make them available to download
7775
- [ ] Implement memory mapped storing of chunks to reduce memory usage
7876
- [x] Design and implement a GUI
7977
- [x] Fix faulty empty chunks ([https://github.com/owengage/fastnbt/issues/120](https://github.com/owengage/fastnbt/issues/120)) (workaround found)
78+
- [x] Setup fork of [https://github.com/aaronr/bboxfinder.com](https://github.com/aaronr/bboxfinder.com) for easy bbox picking
8079

8180
## :trophy: Open Source
8281
#### Key objectives of this project

gui-src/css/styles.css

Lines changed: 123 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ a:hover {
5555
display: flex;
5656
gap: 20px;
5757
justify-content: center;
58-
align-items: stretch; /* Ensures both sections take full height */
58+
align-items: stretch;
5959
margin-top: 5px;
6060
}
6161

@@ -73,7 +73,6 @@ a:hover {
7373
padding: 20px;
7474
border-radius: 8px;
7575
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
76-
/* No display: flex here, so buttons and content aren't stretched */
7776
}
7877

7978
.controls-content {
@@ -83,7 +82,7 @@ a:hover {
8382
}
8483

8584
.controls-box .progress-section {
86-
margin-top: auto; /* Keeps the progress section at the bottom */
85+
margin-top: auto;
8786
}
8887

8988
.map-container {
@@ -112,11 +111,11 @@ button {
112111
transition: border-color 0.25s;
113112
box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2);
114113
margin-top: 10px;
115-
width: auto; /* Ensures buttons don’t stretch */
114+
width: auto;
116115
}
117116

118117
button:hover {
119-
border-color: #396cd8;
118+
border-color: #656565;
120119
}
121120

122121
#selected-directory {
@@ -238,4 +237,122 @@ button:hover {
238237

239238
.controls-box button {
240239
width: 100%;
241-
}
240+
}
241+
242+
/* Customization Settings */
243+
.modal {
244+
position: fixed;
245+
z-index: 1000;
246+
left: 0;
247+
top: 0;
248+
width: 100%;
249+
height: 100%;
250+
overflow: auto;
251+
background-color: rgba(0, 0, 0, 0.4);
252+
display: flex;
253+
justify-content: center;
254+
align-items: center;
255+
}
256+
257+
.modal-content {
258+
background-color: #797979;
259+
padding: 20px;
260+
border: 1px solid #797979;
261+
border-radius: 10px;
262+
width: 400px;
263+
box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
264+
}
265+
266+
.close-button {
267+
color: #e9e9e9;
268+
float: right;
269+
font-size: 28px;
270+
font-weight: bold;
271+
cursor: pointer;
272+
}
273+
274+
.close-button:hover {
275+
color: #ffffff;
276+
}
277+
278+
#winter-toggle {
279+
accent-color: #fecc44;
280+
}
281+
282+
.winter-toggle-container, .scale-slider-container {
283+
margin: 15px 0;
284+
}
285+
286+
.scale-slider-container label {
287+
display: block;
288+
margin-bottom: 5px;
289+
}
290+
291+
#scale-value-slider {
292+
accent-color: #fecc44;
293+
}
294+
295+
#slider-value {
296+
margin-left: 10px;
297+
font-weight: bold;
298+
}
299+
300+
.bbox-input-container {
301+
margin-bottom: 20px;
302+
}
303+
304+
.bbox-input-container label {
305+
display: block;
306+
margin-bottom: 5px;
307+
}
308+
309+
#bbox-coords {
310+
width: 100%;
311+
padding: 8px;
312+
border: 1px solid #ccc;
313+
border-radius: 4px;
314+
font-size: 14px;
315+
}
316+
317+
#bbox-coords:focus {
318+
outline: none;
319+
border-color: #fecc44;
320+
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
321+
}
322+
323+
324+
.button-container {
325+
display: flex;
326+
align-items: center;
327+
justify-content: flex-start;
328+
gap: 5px;
329+
}
330+
331+
.start-button {
332+
padding: 10px 20px;
333+
border: none;
334+
border-radius: 5px;
335+
font-size: 16px;
336+
cursor: pointer;
337+
transition: background-color 0.3s;
338+
}
339+
340+
.start-button:hover {
341+
background-color: #4caf50;
342+
}
343+
344+
.settings-button {
345+
width: 40px !important;
346+
height: 38px;
347+
border-radius: 5px;
348+
display: flex;
349+
justify-content: center;
350+
align-items: center;
351+
cursor: pointer;
352+
transition: background-color 0.3s, border-color 0.3s;
353+
}
354+
355+
.settings-button .gear-icon::before {
356+
content: "⚙️";
357+
font-size: 18px;
358+
}

gui-src/index.html

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ <h2>Select Location</h2>
3434
<section class="section controls-box">
3535
<div class="controls-content">
3636
<h2>Select World</h2>
37-
37+
3838
<!-- Updated Tooltip Structure -->
3939
<div class="tooltip" style="width: 100%;">
4040
<button type="button" onclick="pickDirectory()" style="padding: 10px; line-height: 1.2; width: 100%;">
@@ -48,12 +48,15 @@ <h2>Select World</h2>
4848
Please select a Minecraft world that can be overwritten, as the generation process will replace existing structures in the chosen world!
4949
</span>
5050
</div>
51-
52-
<br>
53-
54-
<button type="button" onclick="startGeneration()">Start Generation</button>
51+
52+
<div class="button-container">
53+
<button type="button" id="start-button" class="start-button" onclick="startGeneration()">Start Generation</button>
54+
<button type="button" class="settings-button" onclick="openSettings()">
55+
<i class="gear-icon"></i>
56+
</button>
57+
</div>
5558
<br><br>
56-
59+
5760
<div class="progress-section">
5861
<h2>Progress</h2>
5962
<div class="progress-bar-container">
@@ -68,6 +71,33 @@ <h2>Progress</h2>
6871
</section>
6972
</div>
7073

74+
<!-- Settings Modal -->
75+
<div id="settings-modal" class="modal" style="display: none;">
76+
<div class="modal-content">
77+
<span class="close-button" onclick="closeSettings()">&times;</span>
78+
<h2>Customization Settings</h2>
79+
80+
<!-- Winter Mode Toggle Button -->
81+
<!-- <div class="winter-toggle-container">
82+
<label for="winter-toggle">Winter:</label>
83+
<input type="checkbox" id="winter-toggle" name="winter-toggle">
84+
</div> -->
85+
86+
<!-- World Scale Slider -->
87+
<div class="scale-slider-container">
88+
<label for="scale-value-slider">World Scale:</label>
89+
<input type="range" id="scale-value-slider" name="scale-value-slider" min="0.50" max="2.5" step="0.25" value="1">
90+
<span id="slider-value">1.00</span>
91+
</div>
92+
93+
<!-- Bounding Box Input -->
94+
<div class="bbox-input-container">
95+
<label for="bbox-coords">Custom Bounding Box:</label>
96+
<input type="text" id="bbox-coords" name="bbox-coords" maxlength="55" style="width: 280px;" autocomplete="one-time-code" placeholder="Format: lat,lng,lat,lng">
97+
</div>
98+
</div>
99+
</div>
100+
71101
<!-- Footer -->
72102
<footer class="footer">
73103
<a href="https://github.com/louis-e/arnis" target="_blank" class="footer-link">
@@ -77,4 +107,4 @@ <h2>Progress</h2>
77107
</main>
78108
</body>
79109

80-
</html>
110+
</html>

0 commit comments

Comments
 (0)