mirror of
https://github.com/MarioSpore/Grinch-AP.git
synced 2025-10-21 04:01:32 -06:00
add Toggle options back to player settings and remove unnecessary check (#1633)
This commit is contained in:
@@ -88,7 +88,7 @@ def create():
|
||||
if option_name in handled_in_js:
|
||||
pass
|
||||
|
||||
elif issubclass(option, Options.Choice) or issubclass(option, Options.TextChoice):
|
||||
elif issubclass(option, Options.Choice) or issubclass(option, Options.Toggle):
|
||||
game_options[option_name] = this_option = {
|
||||
"type": "select",
|
||||
"displayName": option.display_name if hasattr(option, "display_name") else option_name,
|
||||
@@ -97,28 +97,15 @@ def create():
|
||||
"options": []
|
||||
}
|
||||
|
||||
has_random_option = False
|
||||
for sub_option_id, sub_option_name in option.name_lookup.items():
|
||||
this_option["options"].append({
|
||||
"name": option.get_option_name(sub_option_id),
|
||||
"value": sub_option_name,
|
||||
})
|
||||
|
||||
if sub_option_name != "random":
|
||||
this_option["options"].append({
|
||||
"name": option.get_option_name(sub_option_id),
|
||||
"value": sub_option_name,
|
||||
})
|
||||
if sub_option_id == option.default:
|
||||
this_option["defaultValue"] = sub_option_name
|
||||
|
||||
if sub_option_name == "random":
|
||||
has_random_option = True
|
||||
|
||||
if not has_random_option:
|
||||
this_option["options"].append({
|
||||
"name": "random",
|
||||
"value": 'random',
|
||||
})
|
||||
|
||||
if option.default == "random":
|
||||
this_option["defaultValue"] = "random"
|
||||
|
||||
elif issubclass(option, Options.Range):
|
||||
game_options[option_name] = {
|
||||
"type": "range",
|
||||
|
Reference in New Issue
Block a user