[WebHost] weighted-settings: Add items-list, locations-list, and custom-list to JSON config file
This commit is contained in:
parent
3acd966241
commit
4e674e0380
|
@ -63,7 +63,10 @@ def create():
|
|||
|
||||
game_options = {}
|
||||
for option_name, option in all_options.items():
|
||||
if option.options:
|
||||
if option_name in handled_in_js:
|
||||
pass
|
||||
|
||||
elif option.options:
|
||||
game_options[option_name] = this_option = {
|
||||
"type": "select",
|
||||
"displayName": option.displayname if hasattr(option, "displayname") else option_name,
|
||||
|
@ -95,8 +98,30 @@ def create():
|
|||
"min": option.range_start,
|
||||
"max": option.range_end,
|
||||
}
|
||||
elif option_name in handled_in_js:
|
||||
pass
|
||||
|
||||
elif getattr(option, "verify_item_name", False):
|
||||
game_options[option_name] = {
|
||||
"type": "items-list",
|
||||
"displayName": option.displayname if hasattr(option, "displayname") else option_name,
|
||||
"description": option.__doc__ if option.__doc__ else "Please document me!",
|
||||
}
|
||||
|
||||
elif getattr(option, "verify_location_name", False):
|
||||
game_options[option_name] = {
|
||||
"type": "locations-list",
|
||||
"displayName": option.displayname if hasattr(option, "displayname") else option_name,
|
||||
"description": option.__doc__ if option.__doc__ else "Please document me!",
|
||||
}
|
||||
|
||||
elif hasattr(option, "valid_keys"):
|
||||
if option.valid_keys:
|
||||
game_options[option_name] = {
|
||||
"type": "custom-list",
|
||||
"displayName": option.displayname if hasattr(option, "displayname") else option_name,
|
||||
"description": option.__doc__ if option.__doc__ else "Please document me!",
|
||||
"options": list(option.valid_keys),
|
||||
}
|
||||
|
||||
else:
|
||||
logging.debug(f"{option} not exported to Web Settings.")
|
||||
|
||||
|
|
Loading…
Reference in New Issue