Skip to content

Commit bdfa4af

Browse files
committed
Adjust web GUI
Change the following: - Make one place where the form is for choosing options - Redo said form for a slightly cleaner look - Make certain fields in the star system table appear only if there's more than one star in the system, so we have less unnecessary N/A values
1 parent 079ca2e commit bdfa4af

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

web-gui/static/index.html

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@ <h3>Welcome!</h3>
1212
<p>The majority of the information is not game-specific, however, and is useful to anyone.</p>
1313
</div>
1414
<form id="generation" action="starsystem">
15-
<h3>Options</h3>
15+
<h3>Customization Options</h3>
1616
<p>
17-
You can select some options about the star system, or leave it completely random.
17+
You can select some options about the star system, or leave it completely random. <br />
1818
The rules often generate hostile systems, as garden-type worlds are fairly rare. If you need to generate a system with such a world, it is preferable to force it.
19-
Note that even a garden-type world may be very cold or hot, as long as it falls in a range that humans can live in!
19+
Note that even a garden-type world may be very cold or hot, as long as it falls in a range that humans can live in! <br />
20+
If you want your star system to be located in an open cluster (which makes for close neighboring systems to explore) check the box. <br />
21+
You can also choose to force a specific number of stars, values 1-3 are possible (other values are ignored).
2022
</p>
21-
Force star system with garden world? <input id="garden" type="checkbox" name="must_have_garden" value="True" /> <br/>
22-
Should the star system be in an open cluster? <input id="open_cluster" type="checkbox" name="open_cluster" value="True" /> <br/>
23-
Do you want to force a specific number of stars? 1-3 are possible, other values are treated as random. <input id="num_stars" type="number" name="num_stars" /> <br/>
23+
<hr />
24+
<input id="garden" type="checkbox" name="must_have_garden" value="True" /> Force garden world <br/>
25+
<input id="open_cluster" type="checkbox" name="open_cluster" value="True" /> Location: Open cluster <br/>
26+
<input id="num_stars" type="number" name="num_stars" /> Number of stars in the system <br/>
2427
<input id="generate" type="submit" value="Generate star system"/>
2528
</form>
2629

web-gui/static/mainstyle.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,8 @@ tr {
3232
tr:last-child {
3333
border-bottom: 2px solid #222;
3434
}
35+
36+
/**** Form Styling ****/
37+
#num_stars {
38+
width: 3em;
39+
}

web-gui/templates/overview.html

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ <h2>Star system properties</h2>
2424
<table>
2525
<tr>
2626
<th>Name</th>
27+
{% if starsystem.stars|count > 1 %}
2728
<th>Orbital Radius</th>
2829
<th>Orbital Period</th>
30+
{% endif %}
2931
<th>Sequence</th>
3032
<th>Mass*</th>
3133
<th>Avg. Temp.</th>
@@ -34,16 +36,18 @@ <h2>Star system properties</h2>
3436
<th>Inner Limit</th>
3537
<th>Outer Limit</th>
3638
<th>Snow Line</th>
39+
{% if starsystem.stars|count > 1 %}
3740
<th>Forbidden Zone</th>
41+
{% endif %}
3842
<th>Planetary System</th>
3943
</tr>
4044
{% for star in starsystem.stars %}
4145
<tr>
4246
<td>{{star.get_letter()}}</td>
43-
{% if star.get_letter() == 'A' %}
44-
<td>N/A</td>
45-
<td>N/A</td>
46-
{% else %}
47+
{% if star.get_letter() == 'A' and starsystem.stars|count > 1 %}
48+
<td>-</td>
49+
<td>-</td>
50+
{% elif star.get_letter() != 'A' %}
4751
<td>{{starsystem.get_orbits()[loop.index0 - 1][0]|round(2)}} AU</td>
4852
<td>{{starsystem.get_period()[loop.index0 - 1]|round(1, 'common')}} days</td>
4953
{% endif %}
@@ -55,10 +59,10 @@ <h2>Star system properties</h2>
5559
<td>{{star.get_orbit_limits()[0]|round(2)}} AU</td>
5660
<td>{{star.get_orbit_limits()[1]|round(2)}} AU</td>
5761
<td>{{star.get_snowline()|round(2)}} AU</td>
58-
{% if star.get_letter() != 'A' %}
62+
{% if star.get_letter() == 'A' and starsystem.stars|count > 1 %}
63+
<td>-</td>
64+
{% elif star.get_letter() != 'A' %}
5965
<td>{{star.get_forbidden_zone()[0]|round(2)}} AU - {{star.get_forbidden_zone()[1]|round(2)}} AU</td>
60-
{% else %}
61-
<td>N/A</td>
6266
{% endif %}
6367
{% if star.planetsystem.get_orbitcontents()|count > 0 %}
6468
<td>
@@ -77,16 +81,8 @@ <h2>Star system properties</h2>
7781
</div>
7882
<br/>
7983
<br/>
80-
<div id="form-container">
81-
<div id="question-text">
82-
Do you want to generate a new star system?<br/>
83-
</div>
84-
<form id="generation" action="starsystem">
85-
<input id="garden" type="checkbox" name="must_have_garden" value="True" /> Force star system with garden world? <br/>
86-
<input id="open_cluster" type="checkbox" name="open_cluster" value="True" /> Should the star system be an open cluster? <br/>
87-
<input id="num_stars" type="number" name="num_stars" /> Do you want to force a specific number of stars? 1-3 possible <br/>
88-
<input id="generate" type="submit" value="Generate star system"/>
89-
</form>
84+
<div id="go-again">
85+
<p>If you want to generate a new star system with the same constraints, just refresh the page. If you want to change the constraints, go back to the <a href="index.html">generator</a> page.</p>
9086
</div>
9187
</body>
9288
</html>

0 commit comments

Comments
 (0)