mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 20:21:32 -06:00
WebHost: Fix OptionDict
s that define valid_keys
from outputting as []
on Weighted Settings export. (#874)
* WebHost: Fix OptionDicts that define valid_keys from outputting as [] on Weighted Settings export
This commit is contained in:
@@ -110,7 +110,7 @@ def create():
|
|||||||
if option.default == "random":
|
if option.default == "random":
|
||||||
this_option["defaultValue"] = "random"
|
this_option["defaultValue"] = "random"
|
||||||
|
|
||||||
elif hasattr(option, "range_start") and hasattr(option, "range_end"):
|
elif issubclass(option, Options.Range):
|
||||||
game_options[option_name] = {
|
game_options[option_name] = {
|
||||||
"type": "range",
|
"type": "range",
|
||||||
"displayName": option.display_name if hasattr(option, "display_name") else option_name,
|
"displayName": option.display_name if hasattr(option, "display_name") else option_name,
|
||||||
@@ -121,7 +121,7 @@ def create():
|
|||||||
"max": option.range_end,
|
"max": option.range_end,
|
||||||
}
|
}
|
||||||
|
|
||||||
if hasattr(option, "special_range_names"):
|
if issubclass(option, Options.SpecialRange):
|
||||||
game_options[option_name]["type"] = 'special_range'
|
game_options[option_name]["type"] = 'special_range'
|
||||||
game_options[option_name]["value_names"] = {}
|
game_options[option_name]["value_names"] = {}
|
||||||
for key, val in option.special_range_names.items():
|
for key, val in option.special_range_names.items():
|
||||||
@@ -141,7 +141,7 @@ def create():
|
|||||||
"description": option.__doc__ if option.__doc__ else "Please document me!",
|
"description": option.__doc__ if option.__doc__ else "Please document me!",
|
||||||
}
|
}
|
||||||
|
|
||||||
elif hasattr(option, "valid_keys"):
|
elif issubclass(option, Options.OptionList) or issubclass(option, Options.OptionSet):
|
||||||
if option.valid_keys:
|
if option.valid_keys:
|
||||||
game_options[option_name] = {
|
game_options[option_name] = {
|
||||||
"type": "custom-list",
|
"type": "custom-list",
|
||||||
|
Reference in New Issue
Block a user