From 460a6128c3677fe22245bbad97a35667d7571fff Mon Sep 17 00:00:00 2001 From: bluesaxman Date: Mon, 21 Jul 2025 15:52:20 -0600 Subject: [PATCH] Added function to show the library dialog when a blank pec is clicked. --- main.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/main.js b/main.js index 7e53894..2738315 100644 --- a/main.js +++ b/main.js @@ -2,13 +2,22 @@ // Why am I doing this? class auxillery_dialog { constructor (title) { + var me = this; this.root = document.createElement("div"); + this.root.classList.add("dialog"); this.title = "string" == typeof title ? title : ""; var title_bar = document.createElement("div"); title_bar.innerText = this.title; this.root.appendChild(title_bar); this.body = document.createElement("div"); - this.root.appendChild(this.body); + this.root.appendChild(me.body); + var close = document.createElement("span"); + close.innerText = "<"; + close.classList.add("close"); + title_bar.appendChild(close); + close.addEventListener("click", ()=>{ + me.root.classList.remove("focused"); + }); } } @@ -36,5 +45,10 @@ for (var x = 0; x < 16; x++) { thisPec.classList.add("pecSlot","empty"); thisPec.innerHTML = "

+

"; app.gui.view.appendChild(thisPec); + thisPec.addEventListener("click", (p,x)=>{ + app.currentPec = p; + app.currentPecIndex = x; + app.gui.library.root.classList.add("focused"); + }, thisPec, x); }