(key, label)
| 157 | |
| 158 | // helper to create a checkbox label |
| 159 | const checkbox = (key, label) => { |
| 160 | const el = document.createElement("label"); |
| 161 | const cb = document.createElement("input"); |
| 162 | cb.type = "checkbox"; |
| 163 | cb.checked = this.options[key]; |
| 164 | cb.addEventListener("change", () => { |
| 165 | this.options[key] = cb.checked; |
| 166 | game.repaint(); |
| 167 | }); |
| 168 | el.appendChild(cb); |
| 169 | el.appendChild(document.createTextNode(label)); |
| 170 | return el; |
| 171 | }; |
| 172 | |
| 173 | const toggleKey = |
| 174 | Object.keys(input.KEY).find((k) => { |