WebHost: Fix Named Range displays on Player Options page (#3521)

* Player Options: Fix Named Range displays

* Also add validation to the NamedRange class itself

* Don't break Stardew

* Comment

* Do replace first so title works correctly

* Bring change to Weighted Options as well
This commit is contained in:
NewSoupVi
2024-06-13 23:29:39 +02:00
committed by GitHub
parent 2ae51364d9
commit 533395d336
3 changed files with 9 additions and 3 deletions

View File

@@ -57,9 +57,9 @@
<select id="{{ option_name }}-select" data-option-name="{{ option_name }}" {{ "disabled" if option.default == "random" }}>
{% for key, val in option.special_range_names.items() %}
{% if option.default == val %}
<option value="{{ val }}" selected>{{ key }} ({{ val }})</option>
<option value="{{ val }}" selected>{{ key|replace("_", " ")|title }} ({{ val }})</option>
{% else %}
<option value="{{ val }}">{{ key }} ({{ val }})</option>
<option value="{{ val }}">{{ key|replace("_", " ")|title }} ({{ val }})</option>
{% endif %}
{% endfor %}
<option value="custom" hidden>Custom</option>

View File

@@ -41,7 +41,7 @@
The following values have special meanings, and may fall outside the normal range.
<ul>
{% for name, value in option.special_range_names.items() %}
<li>{{ value }}: {{ name }}</li>
<li>{{ value }}: {{ name|replace("_", " ")|title }}</li>
{% endfor %}
</ul>
{% endif %}