| @@ -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" | |||||
| }, | |||||
| ] | |||||
| } | |||||
| ] | |||||
| } | } | ||||
| ]; | ]; | ||||
| @@ -4883,6 +4883,34 @@ function construct_options() { | |||||
| return; | 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") { | if (option.type == "select") { | ||||
| let label = document.createElement("label"); | let label = document.createElement("label"); | ||||
| label.setAttribute("for", option.id); | label.setAttribute("for", option.id); | ||||
| @@ -446,7 +446,6 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| --> | |||||
| <div class="custom-category"> | <div class="custom-category"> | ||||
| <div class="custom-header-static">Brutality</div> | <div class="custom-header-static">Brutality</div> | ||||
| @@ -491,6 +490,7 @@ | |||||
| </li> | </li> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| --> | |||||
| <div class="custom-category"> | <div class="custom-category"> | ||||
| <div class="custom-header-static">Misc</div> | <div class="custom-header-static">Misc</div> | ||||