Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Allow world to display their valid keys in yaml templates #3574

Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Options.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,7 @@ class VerifyKeys(metaclass=FreezeValidKeys):
verify_item_name: bool = False
verify_location_name: bool = False
value: typing.Any
display_valid_keys: bool = False # Should the full list of keys appear in templates
agilbert1412 marked this conversation as resolved.
Show resolved Hide resolved
agilbert1412 marked this conversation as resolved.
Show resolved Hide resolved

@classmethod
def verify_keys(cls, data: typing.Iterable[str]) -> None:
Expand Down
4 changes: 4 additions & 0 deletions data/options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ requires:
#
{%- endif -%}

{%- if option.valid_keys is defined and option.display_valid_keys %}
# Valid keys are {{ option.valid_keys }}
{%- endif -%}

{%- if option.range_start is defined and option.range_start is number %}
{{- range_option(option) -}}

Expand Down
1 change: 1 addition & 0 deletions worlds/stardew_valley/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ class Mods(OptionSet):
"""List of mods that will be included in the shuffling."""
internal_name = "mods"
display_name = "Mods"
display_valid_keys = True
valid_keys = {
ModNames.deepwoods, ModNames.tractor, ModNames.big_backpack,
ModNames.luck_skill, ModNames.magic, ModNames.socializing_skill, ModNames.archaeology,
Expand Down
Loading