Added function to show the library dialog when a blank pec is clicked.

This commit is contained in:
2025-07-21 15:52:20 -06:00
parent f0ec305bb2
commit 460a6128c3

16
main.js
View File

@@ -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 = "<p>+</p>";
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);
}