minor changes to playworks converter, not a fix, just QOL

This commit is contained in:
2026-05-29 14:16:50 +08:00
parent a2d80d2660
commit 1c445e2771
4 changed files with 11 additions and 3 deletions

View File

@@ -546,6 +546,10 @@ ${getToolWebviewStyles()}
convertBtn.disabled = !srcEl.value || !outEl.value || !baseNameEl.value.trim() || !hasNet;
}
function defaultOutputDir(dir) {
return dir ? dir.replace(/[\\\\/]+$/, '') + '\\\\Output' : '';
}
document.getElementById('pickSrc').addEventListener('click', () => vscode.postMessage({ type: 'pickSource' }));
document.getElementById('pickOut').addEventListener('click', () => vscode.postMessage({ type: 'pickOutput' }));
document.getElementById('selectAll').addEventListener('click', () => {
@@ -596,8 +600,8 @@ ${getToolWebviewStyles()}
srcNameEl.textContent = msg.path.split(/[\\\\/]/).filter(Boolean).pop() || msg.path;
baseNameEl.value = msg.baseName || '';
if (!outEl.value && msg.dir) {
outEl.value = msg.dir;
outputDir = msg.dir;
outEl.value = defaultOutputDir(msg.dir);
outputDir = outEl.value;
}
updateConvertBtn();
} else if (msg.type === 'outputPicked') {