From 88fb0fbfc9f58dc93420b31ee5a5201d1a37ca85 Mon Sep 17 00:00:00 2001 From: Minteck Date: Tue, 15 Mar 2022 19:16:19 +0100 Subject: Fix: fixes issue #21 --- .DS_Store | Bin 8196 -> 10244 bytes .gitignore | 4 +++- .idea/dictionaries/Minteck.xml | 3 --- config/version.txt | 2 +- modules/colorlib.js | 1 + update/ponies/parse.js | 24 ++++++++++++++++++------ 6 files changed, 23 insertions(+), 11 deletions(-) delete mode 100755 .idea/dictionaries/Minteck.xml diff --git a/.DS_Store b/.DS_Store index a68536f..28e0e5d 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index f01ab20..6f5ac63 100755 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ demo.json modules/translate.php reports beta -stats \ No newline at end of file +stats +data (copy) +data copy \ No newline at end of file diff --git a/.idea/dictionaries/Minteck.xml b/.idea/dictionaries/Minteck.xml deleted file mode 100755 index c3fcce8..0000000 --- a/.idea/dictionaries/Minteck.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/config/version.txt b/config/version.txt index 7c226a8..1ac9117 100755 --- a/config/version.txt +++ b/config/version.txt @@ -1 +1 @@ -2.2.65 \ No newline at end of file +2.3.66 \ No newline at end of file diff --git a/modules/colorlib.js b/modules/colorlib.js index ec99d00..bc3fba5 100644 --- a/modules/colorlib.js +++ b/modules/colorlib.js @@ -40,6 +40,7 @@ const Color = require('color'); module.exports = (hex, debug) => { + console.log(hex); const color = Color(hex); const h = color.hsl().color[0]; diff --git a/update/ponies/parse.js b/update/ponies/parse.js index c4cc1d4..28ba1d8 100755 --- a/update/ponies/parse.js +++ b/update/ponies/parse.js @@ -93,27 +93,39 @@ global.ponies = {}; if (typeof box.coat !== "undefined") data.color = box.coat.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { return i.replace(//g, "").trim().replace(/\[([a-z.\/ \nA-Z0-9:]*)\/(.{6})\/ (.*)\]/gm, "$2").replace(/{{perbang\|([0-9A-Fa-f].{5})(.*)/g, "$1").replace(/\[(.*)\/(.*)\/ (.*)\]/g, "$2"); })[0]; try { - if (typeof box.coat !== "undefined") data.search.coat = box.coat.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { + index = 0; + cdata = box.coat.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { try { + console.log("eyes", index); return colorlib("#" + i.replace(//g, "").trim().replace(/\[([a-z.\/ \nA-Z0-9:]*)\/(.{6})\/ (.*)\]/gm, "$2").replace(/{{perbang\|([0-9A-Fa-f].{5})(.*)/g, "$1").replace(/\[(.*)\/(.*)\/ (.*)\]/g, "$2")); } catch (e) {} - }).filter(i => typeof i !== "number"); + index++; + }).filter(i => typeof i === "number"); + if (typeof box.coat !== "undefined") data.search.coat = [...new Set(cdata)]; } catch (e) {} try { - if (typeof box.eyes !== "undefined") data.search.eyes = box.eyes.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { + index = 0; + cdata = box.eyes.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { try { + console.log("eyes", index); return colorlib("#" + i.replace(//g, "").trim().replace(/\[([a-z.\/ \nA-Z0-9:]*)\/(.{6})\/ (.*)\]/gm, "$2").replace(/{{perbang\|([0-9A-Fa-f].{5})(.*)/g, "$1").replace(/\[(.*)\/(.*)\/ (.*)\]/g, "$2")); } catch (e) {} - }).filter(i => typeof i !== "number"); + index++; + }).filter(i => typeof i === "number") + if (typeof box.eyes !== "undefined") data.search.eyes = [...new Set(cdata)]; } catch (e) {} try { - if (typeof box.mane !== "undefined") data.search.mane = box.mane.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { + index = 0; + cdata = box.mane.trim().replace(/<( ||(|| )\/)( ||(|| )\/)(b|B)(r|R)( ||(|| )\/)( ||(|| )\/)>/gm, "|").split("|").map((i) => { try { + console.log("eyes", index); return colorlib("#" + i.replace(//g, "").trim().replace(/\[([a-z.\/ \nA-Z0-9:]*)\/(.{6})\/ (.*)\]/gm, "$2").replace(/{{perbang\|([0-9A-Fa-f].{5})(.*)/g, "$1").replace(/\[(.*)\/(.*)\/ (.*)\]/g, "$2")); } catch (e) {} - }).filter(i => typeof i !== "number"); + index++; + }).filter(i => typeof i === "number"); + if (typeof box.mane !== "undefined") data.search.mane = [...new Set(cdata)]; } catch (e) {} try { -- cgit