Просмотр исходного кода

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

tags/v1.1.0
Fen Dweller 5 лет назад
Родитель
Сommit
afecd177c5
2 измененных файлов: 16 добавлений и 11 удалений
  1. +12
    -11
      features.js
  2. +4
    -0
      game.js

+ 12
- 11
features.js Просмотреть файл

@@ -1679,26 +1679,27 @@ options = [
"type": "checkbox",
"buttons": ["digest_soul"]
},
{
"type": "radio",
{
"name":"Soul vore type",
"type": "select",
"id": "soulVoreType",
"default": "body",
"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 Просмотреть файл

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

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

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

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



Загрузка…
Отмена
Сохранить