Browse Source

Make soul vore type a dropdown box. Fix incorrect defaults and loading for selects

tags/v1.1.0
Fen Dweller 5 years ago
parent
commit
afecd177c5
2 changed files with 16 additions and 11 deletions
  1. +12
    -11
      features.js
  2. +4
    -0
      game.js

+ 12
- 11
features.js View File

@@ -1679,26 +1679,27 @@ options = [
"type": "checkbox", "type": "checkbox",
"buttons": ["digest_soul"] "buttons": ["digest_soul"]
}, },
{
"type": "radio",
{
"name":"Soul vore type",
"type": "select",
"id": "soulVoreType", "id": "soulVoreType",
"default": "body", "default": "body",
"choices": "choices":
[ [
{ {
"name": "Released",
"value": "release"
"name": "Released",
"value": "release",
}, },
{ {
"name": "Trapped",
"value": "body"
"name": "Trapped",
"value": "body",
}, },
{ {
"name": "Digested",
"value": "oblivion"
}
]
}
"name": "Digested",
"value": "oblivion",
},
]
},
] ]
}, },
{ {


+ 4
- 0
game.js View File

@@ -5613,6 +5613,7 @@ function render_select_option(li, option) {
label.innerText = option.name; label.innerText = option.name;


let select = document.createElement("select"); let select = document.createElement("select");
select.setAttribute("id", option.id);
select.setAttribute("name", option.id); select.setAttribute("name", option.id);


option.choices.forEach(function(choice) { option.choices.forEach(function(choice) {
@@ -5620,6 +5621,9 @@ function render_select_option(li, option) {
sub_option.innerText = choice.name; sub_option.innerText = choice.name;
sub_option.setAttribute("value", choice.value); sub_option.setAttribute("value", choice.value);


if (option.default == choice.value) {
sub_option.defaultSelected = true;
}
select.appendChild(sub_option); select.appendChild(sub_option);
}); });




Loading…
Cancel
Save