minor changes to playworks converter, not a fix, just QOL
This commit is contained in:
BIN
dist/hpl-toolbox-0.1.7.exe
vendored
BIN
dist/hpl-toolbox-0.1.7.exe
vendored
Binary file not shown.
BIN
dist/hpl-toolbox-0.1.7.vsix
vendored
BIN
dist/hpl-toolbox-0.1.7.vsix
vendored
Binary file not shown.
@@ -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') {
|
||||
|
||||
@@ -161,11 +161,15 @@ function renderSourceSelection() {
|
||||
function setSource(path, baseName, dir) {
|
||||
srcEl.value = path || '';
|
||||
baseNameEl.value = baseName || '';
|
||||
if (!outEl.value && dir) { outEl.value = dir.replace(/[\\\/]+$/, '') + '\\\\Output'; outputDir = outEl.value; }
|
||||
if (!outEl.value && dir) { outEl.value = defaultOutputDir(dir); outputDir = outEl.value; }
|
||||
renderSourceSelection();
|
||||
updateConvertBtn();
|
||||
}
|
||||
|
||||
function defaultOutputDir(dir) {
|
||||
return dir ? dir.replace(/[\\\/]+$/, '') + '\\Output' : '';
|
||||
}
|
||||
|
||||
function clearSource() {
|
||||
srcEl.value = '';
|
||||
baseNameEl.value = '';
|
||||
|
||||
Reference in New Issue
Block a user