diff --git "a/icons/BN\346\217\222\344\273\266.png" "b/icons/BN\346\217\222\344\273\266.png" new file mode 100644 index 0000000..4b01988 Binary files /dev/null and "b/icons/BN\346\217\222\344\273\266.png" differ diff --git a/icons/JSON.png b/icons/JSON.png new file mode 100644 index 0000000..52ab878 Binary files /dev/null and b/icons/JSON.png differ diff --git a/icons/Nukkit.png b/icons/Nukkit.png new file mode 100644 index 0000000..854e71e Binary files /dev/null and b/icons/Nukkit.png differ diff --git "a/icons/\344\272\213\344\273\266.png" "b/icons/\344\272\213\344\273\266.png" new file mode 100644 index 0000000..c95899b Binary files /dev/null and "b/icons/\344\272\213\344\273\266.png" differ diff --git "a/icons/\344\275\215\347\275\256.png" "b/icons/\344\275\215\347\275\256.png" new file mode 100644 index 0000000..64ec7a9 Binary files /dev/null and "b/icons/\344\275\215\347\275\256.png" differ diff --git "a/icons/\345\207\275\346\225\260.png" "b/icons/\345\207\275\346\225\260.png" new file mode 100644 index 0000000..ffbc196 Binary files /dev/null and "b/icons/\345\207\275\346\225\260.png" differ diff --git "a/icons/\345\210\227\350\241\250.png" "b/icons/\345\210\227\350\241\250.png" new file mode 100644 index 0000000..61e4e2b Binary files /dev/null and "b/icons/\345\210\227\350\241\250.png" differ diff --git "a/icons/\345\210\233\344\270\226.png" "b/icons/\345\210\233\344\270\226.png" new file mode 100644 index 0000000..de81e41 Binary files /dev/null and "b/icons/\345\210\233\344\270\226.png" differ diff --git "a/icons/\345\217\230\351\207\217.png" "b/icons/\345\217\230\351\207\217.png" new file mode 100644 index 0000000..65dab0e Binary files /dev/null and "b/icons/\345\217\230\351\207\217.png" differ diff --git "a/icons/\345\255\227\347\254\246\344\270\262.png" "b/icons/\345\255\227\347\254\246\344\270\262.png" new file mode 100644 index 0000000..1eeefd0 Binary files /dev/null and "b/icons/\345\255\227\347\254\246\344\270\262.png" differ diff --git "a/icons/\345\256\236\347\224\250\345\267\245\345\205\267.png" "b/icons/\345\256\236\347\224\250\345\267\245\345\205\267.png" new file mode 100644 index 0000000..5468801 Binary files /dev/null and "b/icons/\345\256\236\347\224\250\345\267\245\345\205\267.png" differ diff --git "a/icons/\345\276\252\347\216\257.png" "b/icons/\345\276\252\347\216\257.png" new file mode 100644 index 0000000..2494436 Binary files /dev/null and "b/icons/\345\276\252\347\216\257.png" differ diff --git "a/icons/\346\213\223\345\261\225.png" "b/icons/\346\213\223\345\261\225.png" new file mode 100644 index 0000000..5b31d98 Binary files /dev/null and "b/icons/\346\213\223\345\261\225.png" differ diff --git "a/icons/\346\225\260\345\255\246.png" "b/icons/\346\225\260\345\255\246.png" new file mode 100644 index 0000000..8a3aadd Binary files /dev/null and "b/icons/\346\225\260\345\255\246.png" differ diff --git "a/icons/\346\226\271\345\235\227\347\211\251\345\223\201.png" "b/icons/\346\226\271\345\235\227\347\211\251\345\223\201.png" new file mode 100644 index 0000000..b8c63ad Binary files /dev/null and "b/icons/\346\226\271\345\235\227\347\211\251\345\223\201.png" differ diff --git "a/icons/\347\211\251\345\223\201\346\240\217.png" "b/icons/\347\211\251\345\223\201\346\240\217.png" new file mode 100644 index 0000000..52de184 Binary files /dev/null and "b/icons/\347\211\251\345\223\201\346\240\217.png" differ diff --git "a/icons/\347\216\251\345\256\266.png" "b/icons/\347\216\251\345\256\266.png" new file mode 100644 index 0000000..7721dbb Binary files /dev/null and "b/icons/\347\216\251\345\256\266.png" differ diff --git "a/icons/\347\224\237\347\211\251.png" "b/icons/\347\224\237\347\211\251.png" new file mode 100644 index 0000000..00baae6 Binary files /dev/null and "b/icons/\347\224\237\347\211\251.png" differ diff --git "a/icons/\347\252\227\345\217\243.png" "b/icons/\347\252\227\345\217\243.png" new file mode 100644 index 0000000..36800ba Binary files /dev/null and "b/icons/\347\252\227\345\217\243.png" differ diff --git "a/icons/\347\262\222\345\255\220.png" "b/icons/\347\262\222\345\255\220.png" new file mode 100644 index 0000000..c025e2b Binary files /dev/null and "b/icons/\347\262\222\345\255\220.png" differ diff --git "a/icons/\347\272\242\347\237\263\351\237\263\344\271\220.png" "b/icons/\347\272\242\347\237\263\351\237\263\344\271\220.png" new file mode 100644 index 0000000..7b50c0f Binary files /dev/null and "b/icons/\347\272\242\347\237\263\351\237\263\344\271\220.png" differ diff --git "a/icons/\351\200\273\350\276\221.png" "b/icons/\351\200\273\350\276\221.png" new file mode 100644 index 0000000..62e72c7 Binary files /dev/null and "b/icons/\351\200\273\350\276\221.png" differ diff --git a/js/bnViewer.js b/js/bnViewer.js index a9d371c..87b49ab 100644 --- a/js/bnViewer.js +++ b/js/bnViewer.js @@ -19,8 +19,8 @@ var createModule=new MutationObserver(function (mutations,createModule) { if(value.addedNodes[0].childNodes[0].childNodes[0]==null){return;} if(value.addedNodes[0].childNodes[0].classList.contains("blocklyTreeRow")){//blocklyTreeRow if(value.addedNodes[0].childNodes[0].childNodes[0].getAttribute("class")=='blocklyTreeIcon blocklyTreeIconNone'){ - value.addedNodes[0].childNodes[0].childNodes[0].style.backgroundImage = 'url("./icons/component.png")'; - value.addedNodes[0].childNodes[0].childNodes[0].style.backgroundSize = "100% 100%"; + value.addedNodes[0].childNodes[0].childNodes[0].style.backgroundImage = 'url("'+getIconURL(value.addedNodes[0].childNodes[0].outerText)+'")'; + value.addedNodes[0].childNodes[0].childNodes[0].style.backgroundSize = "contain"; } } }) @@ -28,6 +28,32 @@ var createModule=new MutationObserver(function (mutations,createModule) { }); createModule.observe(document.querySelectorAll("div[class='blocklyToolboxDiv blocklyNonSelectable']")[0],{ childList: true, subtree: true }); //获取修饰图标 -function getIconText(From){ - return "#" +function getIconURL(From){ + switch (From) { + case "逻辑": + case "循环": + case "数学": + case "字符串": + case "列表": + case "JSON": + case "BN插件": + case "Nukkit": + case "玩家": + case "事件": + case "位置": + case "创世": + case "窗口": + case "方块物品": + case "物品栏": + case "生物": + case "粒子": + case "函数": + case "变量": + case "实用工具": + case "红石音乐": + return "./icons/"+From+".png" + break; + default: + return "./icons/拓展.png"; + } } \ No newline at end of file