- for (const check of $.querySelectorAll("#gameOptions input")) {
- if (check.checked) options[ check.id.split("_")[1] ] = check.checked;
+ for (const input of $.querySelectorAll("#gameOptions input")) {
+ const variable = input.id.split("_")[1];
+ if (input.type == "number")
+ options[variable] = parseInt(input.value, 10); //TODO: real numbers?
+ else if (input.type == "checkbox")
+ options[variable] = input.checked;