more ansi support, will have to map colours back to mIRC for it to work better, and also fix the font stuff
This commit is contained in:
父節點
5fad917fa8
當前提交
4aa9879283
|
@ -175,23 +175,51 @@ export default {
|
|||
|
||||
ansiWidth = 0;
|
||||
|
||||
for (let j = 0; j <= ansiArray[i].length-1; j++) {
|
||||
for (let j = 0; j <= ansiArray[i].length - 1; j++) {
|
||||
let ansiParse = Anser.ansiToJson(ansiArray[i]);
|
||||
|
||||
for (let l = 0; l <= ansiParse.length-1; l++) {
|
||||
for (let l = 0; l <= ansiParse.length - 1; l++) {
|
||||
var contentArray = ansiParse[l].content.split("");
|
||||
|
||||
var curBlock = {
|
||||
fg: ansiParse[l].fg,
|
||||
bg: ansiParse[l].bg,
|
||||
fg: this.mircColors.indexOf(`rgb(${ansiParse[l].fg})`),
|
||||
bg: this.mircColors.indexOf(`rgb(${ansiParse[l].bg})`),
|
||||
char: null,
|
||||
};
|
||||
|
||||
for (let k = 0; k <= contentArray.length-1; k++) {
|
||||
// If we had no matches in our mIRC RGB lookup, then we have to try match
|
||||
// the ASNI colours to the best mIRC colour
|
||||
|
||||
if (contentArray[k] === "\r") {
|
||||
continue
|
||||
if (curBlock.fg === -1) {
|
||||
switch (ansiParse[l].fg) {
|
||||
case "187, 187, 0": // orangeish yellow
|
||||
curBlock.fg = 8;
|
||||
break;
|
||||
|
||||
case "187, 0, 0": // red
|
||||
curBlock.fg = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (curBlock.bg === -1) {
|
||||
switch (ansiParse[l].bg) {
|
||||
case "187, 187, 0": // orangeish yellow
|
||||
curBlock.bg = 8;
|
||||
break;
|
||||
|
||||
case "187, 0, 0": // red
|
||||
curBlock.bg = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (let k = 0; k <= contentArray.length - 1; k++) {
|
||||
if (contentArray[k] === "\r") {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.mircColors.indexOf(`rgb(${ansiParse[l].fg})`);
|
||||
|
||||
curBlock.char = contentArray[k];
|
||||
|
||||
|
|
|
@ -9,6 +9,24 @@ const vuexLocal = new VuexPersistence({
|
|||
|
||||
export default new Vuex.Store({
|
||||
state: {
|
||||
|
||||
// 0 => 'white',
|
||||
// 1 => 'black',
|
||||
// 2 => 'navy',
|
||||
// 3 => 'green',
|
||||
// 4 => 'red',
|
||||
// 5 => 'brown',
|
||||
// 6 => 'purple',
|
||||
// 7 => 'olive',
|
||||
// 8 => 'yellow', # dark yellow
|
||||
// 9 => 'lime', # ltgreen
|
||||
// 10 => 'teal',
|
||||
// 11 => 'cyan',
|
||||
// 12 => 'blue', # ltblue,
|
||||
// 13 => 'fuchsia', # pink
|
||||
// 14 => 'grey',
|
||||
// 15 => 'lightgrey',
|
||||
|
||||
mircColors: [
|
||||
'rgb(255,255,255)',
|
||||
'rgb(0,0,0)',
|
||||
|
|
載入中…
新增問題並參考