diff --git a/project/index.html b/project/index.html index 48c8b56..32aebf2 100644 --- a/project/index.html +++ b/project/index.html @@ -724,6 +724,11 @@ .info-sheet-btn.mobile-explorer-trigger { display: inline-flex; align-items: center; gap: 6px; } #obsidian-slot .mcb-obsidian__price { display: none; } } + + .qtool-list { padding: 10px 20px 14px; display: flex; flex-direction: column; gap: 2px; } + .qtool-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; width: fit-content; font-size: 12px; color: var(--text-low); cursor: pointer; transition: color .15s; } + .qtool-row img { width: 16px; height: 16px; image-rendering: pixelated; flex-shrink: 0; } + .qtool-row:hover { color: var(--accent); }
diff --git a/project/project.js b/project/project.js index 88f7ef7..f9e9931 100644 --- a/project/project.js +++ b/project/project.js @@ -1973,7 +1973,6 @@ function renderFileList() { } else { showHint = false; } - if (showHint) list.appendChild(hint); } if (currentPath.length > 0) { @@ -2038,6 +2037,26 @@ function renderFileList() { } list.appendChild(row); }); + + // quick tools: same actions as the create menu, listed under the files at the addon root + if (isAtRoot() && project?.project_type === "addon" && canEdit()) { + const tools = document.createElement("div"); + tools.className = "qtool-list"; + const items = [ + { icon: "item", label: "Create Item", run: () => openCreator("item") }, + { icon: "entity", label: "Create Entity", run: () => openCreator("entity") }, + { icon: "block", label: "Create Block", run: () => openCreator("block") }, + { icon: "texture", label: "Replace Texture", run: () => openReplaceTexture() } + ]; + items.forEach(it => { + const row = document.createElement("div"); + row.className = "qtool-row"; + row.innerHTML = `