(title, hidden, functi0n)
| 1424 | this.addEventListener(this.game, "mousedown touchend", hideMenu); |
| 1425 | const parent = this.createElement("ul"); |
| 1426 | const addButton = (title, hidden, functi0n) => { |
| 1427 | //<li><a href="#" onclick="return false">'+title+'</a></li> |
| 1428 | const li = this.createElement("li"); |
| 1429 | if (hidden) li.hidden = true; |
| 1430 | const a = this.createElement("a"); |
| 1431 | if (functi0n instanceof Function) { |
| 1432 | this.addEventListener(li, "click", (e) => { |
| 1433 | e.preventDefault(); |
| 1434 | functi0n(); |
| 1435 | }); |
| 1436 | } |
| 1437 | a.href = "#"; |
| 1438 | a.onclick = "return false"; |
| 1439 | a.innerText = this.localization(title); |
| 1440 | li.appendChild(a); |
| 1441 | parent.appendChild(li); |
| 1442 | hideMenu(); |
| 1443 | return li; |
| 1444 | } |
| 1445 | let screenshotUrl; |
| 1446 | const screenshot = addButton("Take Screenshot", false, () => { |
| 1447 | if (screenshotUrl) URL.revokeObjectURL(screenshotUrl); |
nothing calls this directly
no test coverage detected