better C00,00 import support but still not perfect

Этот коммит содержится в:
Hugh Bord 2021-03-31 11:14:33 +10:00
родитель a6a2c5eaa0
Коммит 7b1e04767b
3 изменённых файлов: 17 добавлений и 7 удалений

Просмотреть файл

@ -340,6 +340,11 @@ export default {
colourChar2 = `${asciiStringArray[1]}`;
parsedColour = parseInt(`${colourChar1}${colourChar2}`);
if (parseInt(colourChar1) === 0 && parseInt(colourChar2) >= 0) {
asciiStringArray.shift();
theWidth += 1;
}
if (isNaN(parsedColour)) {
curBlock.bg = parseInt(colourChar1);
theWidth += 1;
@ -440,7 +445,12 @@ export default {
if (curBlock.bg !== prevBlock.bg || curBlock.fg !== prevBlock.fg) {
Object.assign(curBlock, currentAscii.blocks[y][x]);
const zeroPad = (num, places) => String(num).padStart(places, "0");
output.push(`\u0003${zeroPad(curBlock.fg ?? 0, 2)},${zeroPad(curBlock.bg ?? 1,2)}`);
output.push(
`\u0003${zeroPad(curBlock.fg ?? 0, 2)},${zeroPad(
curBlock.bg ?? 1,
2
)}`
);
}
output.push(curBlock.char ?? " ");
@ -467,8 +477,10 @@ export default {
};
// Check if txt already exists and append it
var filename = (currentAscii.title.slice(currentAscii.title.length - 3) === "txt") ? currentAscii.title : `${currentAscii.title}.txt`;
var filename =
currentAscii.title.slice(currentAscii.title.length - 3) === "txt"
? currentAscii.title
: `${currentAscii.title}.txt`;
downloadToFile(output.join(""), filename, "text/plain");
},
createClick() {

Просмотреть файл

@ -11,9 +11,7 @@ export default {
'blockWidth',
'blockHeight'],
created() {
console.log(this.data);
},
created() {},
data: () => ({
}),

Просмотреть файл

@ -324,7 +324,7 @@ export default {
let fillSameBg = fillStartBlock.bg;
}
console.log(fillStartBlock);
// console.log(fillStartBlock);
},
},
};