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;
|
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('pickSrc').addEventListener('click', () => vscode.postMessage({ type: 'pickSource' }));
|
||||||
document.getElementById('pickOut').addEventListener('click', () => vscode.postMessage({ type: 'pickOutput' }));
|
document.getElementById('pickOut').addEventListener('click', () => vscode.postMessage({ type: 'pickOutput' }));
|
||||||
document.getElementById('selectAll').addEventListener('click', () => {
|
document.getElementById('selectAll').addEventListener('click', () => {
|
||||||
@@ -596,8 +600,8 @@ ${getToolWebviewStyles()}
|
|||||||
srcNameEl.textContent = msg.path.split(/[\\\\/]/).filter(Boolean).pop() || msg.path;
|
srcNameEl.textContent = msg.path.split(/[\\\\/]/).filter(Boolean).pop() || msg.path;
|
||||||
baseNameEl.value = msg.baseName || '';
|
baseNameEl.value = msg.baseName || '';
|
||||||
if (!outEl.value && msg.dir) {
|
if (!outEl.value && msg.dir) {
|
||||||
outEl.value = msg.dir;
|
outEl.value = defaultOutputDir(msg.dir);
|
||||||
outputDir = msg.dir;
|
outputDir = outEl.value;
|
||||||
}
|
}
|
||||||
updateConvertBtn();
|
updateConvertBtn();
|
||||||
} else if (msg.type === 'outputPicked') {
|
} else if (msg.type === 'outputPicked') {
|
||||||
|
|||||||
@@ -161,11 +161,15 @@ function renderSourceSelection() {
|
|||||||
function setSource(path, baseName, dir) {
|
function setSource(path, baseName, dir) {
|
||||||
srcEl.value = path || '';
|
srcEl.value = path || '';
|
||||||
baseNameEl.value = baseName || '';
|
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();
|
renderSourceSelection();
|
||||||
updateConvertBtn();
|
updateConvertBtn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function defaultOutputDir(dir) {
|
||||||
|
return dir ? dir.replace(/[\\\/]+$/, '') + '\\Output' : '';
|
||||||
|
}
|
||||||
|
|
||||||
function clearSource() {
|
function clearSource() {
|
||||||
srcEl.value = '';
|
srcEl.value = '';
|
||||||
baseNameEl.value = '';
|
baseNameEl.value = '';
|
||||||
|
|||||||
Reference in New Issue
Block a user