Pārlūkot izejas kodu

More work on the new character screen

tags/v1.0.0
Fen Dweller pirms 6 gadiem
vecāks
revīzija
2df421ebb2
3 mainītis faili ar 92 papildinājumiem un 1 dzēšanām
  1. +63
    -0
      features.js
  2. +28
    -0
      game.js
  3. +1
    -1
      stroll.html

+ 63
- 0
features.js Parādīt failu

@@ -80,5 +80,68 @@ options = [
]
}
]
},
{
"name": "Brutality",
"id": "brutality",
"optional": false,
"entries":
[
{
"type": "radio",
"id": "brutality",
"default": "1",
"choices":
[
{
"name": "Non-fatal",
"value": "0"
},
{
"name": "Fatal",
"value": "1"
},
{
"name": "Gory",
"value": "2"
},
{
"name": "Sadistic",
"value": "3"
},
]
}
]
},
{
"name": "Victims",
"id": "victims",
"optional": false,
"entries":
[
{
"type": "checkbox",
"id": "victims",
"choices":
[
{
"name": "Human prey",
"value": "Human"
},
{
"name": "Military",
"value": "Military"
},
{
"name": "Other macros",
"value": "Macros"
},
{
"name": "Micros",
"value": "Micros"
},
]
}
]
}
];

+ 28
- 0
game.js Parādīt failu

@@ -4883,6 +4883,34 @@ function construct_options() {
return;
}

if (option.type == "checkbox") {
option.choices.forEach(function(choice) {
let li = document.createElement("li");

let input = document.createElement("input");
input.setAttribute("autocomplete", "off");
input.setAttribute("id", option.id + choice.value);
input.setAttribute("name", option.id + choice.value);
input.setAttribute("type", "checkbox");

if (choice.default) {
input.setAttribute("checked", true);
}

let label = document.createElement("label");
label.setAttribute("for", option.id + choice.value);
label.innerText = choice.name;

li.appendChild(input);
li.appendChild(label);
options_div.appendChild(li);

});

// we added n li elements; we need to skip the default one
return;
}

if (option.type == "select") {
let label = document.createElement("label");
label.setAttribute("for", option.id);


+ 1
- 1
stroll.html Parādīt failu

@@ -446,7 +446,6 @@
</div>
</div>
</div>
-->

<div class="custom-category">
<div class="custom-header-static">Brutality</div>
@@ -491,6 +490,7 @@
</li>
</div>
</div>
-->

<div class="custom-category">
<div class="custom-header-static">Misc</div>


Notiek ielāde…
Atcelt
Saglabāt