From 5bf16d4b584fa1e31889e346b0aee31d13d86ad3 Mon Sep 17 00:00:00 2001 From: unimatrixgit <95320811+unimatrixgit@users.noreply.github.com> Date: Sat, 28 Nov 2026 19:40:56 +0100 Subject: [PATCH] Keep staff item previews working during the menu transition --- website/control-panel/public/cp-v2/cp-v2-item-designer.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/control-panel/public/cp-v2/cp-v2-item-designer.mjs b/website/control-panel/public/cp-v2/cp-v2-item-designer.mjs index 84e5dd7d..6e290d73 100644 --- a/website/control-panel/public/cp-v2/cp-v2-item-designer.mjs +++ b/website/control-panel/public/cp-v2/cp-v2-item-designer.mjs @@ -16,7 +16,7 @@ export function mountItemDesigner(host,{fetcher=fetch,initialDesign=null,onApply const saved=select([['','Choose a saved draft']]),load=button('Load draft',()=>{const row=definitions.find(row=>row.id===saved.value);if(row){id=row.id;revision=row.revision;lastSaved=JSON.stringify(validateItemDesign(row.design));setDesign(row.design);status.textContent='Draft revision '+revision+' loaded.';}}),fresh=button('New item',()=>{id=crypto.randomUUID();revision=0;lastSaved="";setDesign(defaultItemDesign(template.value));status.textContent='New local draft. Save to record it in J.A.R.V.I.S.';}),refresh=button('Refresh drafts',()=>void readDefinitions()); const tools=el('div',undefined,'item-designer-tools');tools.append(field('Saved definitions',saved),load,fresh,refresh); const form=el('form'),fields=el('fieldset'),layout=el('div',undefined,'item-designer-layout'),preview=el('div',undefined,'item-designer-preview'); - const copyPreview=button('Copy ingame preview command',async()=>{const command='/dm previewitem '+id+' '+revision;try{await navigator.clipboard.writeText(command);status.textContent='Preview command copied. Paste it in Minecraft: '+command;}catch{status.textContent='Paste this command in Minecraft: '+command;}});copyPreview.disabled=true; + const copyPreview=button('Copy ingame preview command',async()=>{const command='/drgui previewitem '+id+' '+revision;try{await navigator.clipboard.writeText(command);status.textContent='Preview command copied. Paste it in Minecraft: '+command;}catch{status.textContent='Paste this command in Minecraft: '+command;}});copyPreview.disabled=true; const ids=Object.keys(itemTemplateCatalogue().templates),template=select(ids.map(id=>{const t=itemDesignTemplate(id);return[id,t.name+' · '+itemWords(t.quality)+' · MK '+itemRoman(t.equipmentMark)];}));template.setAttribute('aria-label','Item template'); const name=el('input');name.maxLength=64;name.required=true;const identity=el('p',undefined,'item-designer-identity'),enchants=el('div',undefined,'item-designer-enchantments'),lore=el('div',undefined,'item-designer-lore'); const addLore=button('Add lore line',()=>{if(loreRows.length<6){addLine({text:'',color:'#AAAAAA',bold:false,italic:false});paint();}});