From 62d6a7084141c930fca5adeceab32a93339712e5 Mon Sep 17 00:00:00 2001 From: damp11113 Date: Mon, 15 Jul 2024 22:56:19 +0700 Subject: [PATCH] update 1.1 add new package manager --- .gitignore | 1 + assets/adv_computer.png | Bin 0 -> 2653 bytes assets/adv_pocket_computer.png | Bin 0 -> 910 bytes assets/adv_turtle.png | Bin 0 -> 2830 bytes assets/basic_computer.png | Bin 0 -> 2230 bytes assets/command_computer.png | Bin 0 -> 2760 bytes assets/library.png | Bin 0 -> 2700 bytes assets/network-require.png | Bin 0 -> 2763 bytes assets/organization-logo.png | Bin 2442 -> 0 bytes assets/peripheral.png | Bin 0 -> 3827 bytes assets/pocket_computer.png | Bin 0 -> 951 bytes assets/turtle.png | Bin 0 -> 2727 bytes blocks/IDE/index.json | 15 +++- blocks/Template/index.json | 13 +++- package.json | 4 +- src/blocksmanager.js | 129 +++++++++++++++++++++++++++++++-- src/index.html | 47 ++++++++---- src/styles.css | 50 +++++++++++-- src/virtualcode.js | 72 +++++++++++++++--- turtle example 1.ccp | 1 + 20 files changed, 290 insertions(+), 42 deletions(-) create mode 100644 assets/adv_computer.png create mode 100644 assets/adv_pocket_computer.png create mode 100644 assets/adv_turtle.png create mode 100644 assets/basic_computer.png create mode 100644 assets/command_computer.png create mode 100644 assets/library.png create mode 100644 assets/network-require.png delete mode 100644 assets/organization-logo.png create mode 100644 assets/peripheral.png create mode 100644 assets/pocket_computer.png create mode 100644 assets/turtle.png create mode 100644 turtle example 1.ccp diff --git a/.gitignore b/.gitignore index 4172c07..28d9e23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ node_modules/ .mcattributes package-lock.json +dist/ \ No newline at end of file diff --git a/assets/adv_computer.png b/assets/adv_computer.png new file mode 100644 index 0000000000000000000000000000000000000000..19ae72047a081e718c3e135634f97af6fe75ec7b GIT binary patch literal 2653 zcmbVOe@qi+7(NiEf{Z21=o}lDny8DkcWsZBo|LNPR}+d1$;3GaNAD}W+4f5BfPz}o zL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ubyGPr)3cpZ73Hw+F5*SQAREJkgiZ W+Lt*+;BDUrpeijpwP{n~{{I2hMzAyh literal 0 HcmV?d00001 diff --git a/assets/adv_pocket_computer.png b/assets/adv_pocket_computer.png new file mode 100644 index 0000000000000000000000000000000000000000..743f5c0a9dba34c12f3e882da298f6d4c00c10ad GIT binary patch literal 910 zcmeAS@N?(olHy`uVBq!ia0y~yU<5K5893O0R7}x|GzJFdP)`@fkcv5P?`{k{>>%Rc zcyI@kkdRYpBePaRLyO!U2~NfkhlH$xM{x@{&KB&d+|B#KZ`!>-F3(wkMj(S5b7x=V zj=KJ}ynZ|DzvEx4WPkD9`!#o=H-mx?ap;Y~?`!+*`m7^ZL(i{&zOp=zslkAeShV5g zdFC6hKE5n|$GhR=`S0Gp*k%!DE0K;H;mSa9^ZuQD*#@q((E2(b1_3pqk=fr$hUi$m z)&0l)X{071iNF6p85omd h7jh;5vELlsq*K4OOQi7gj9f*KfTydU%Q~loCIFn=%Vq!o literal 0 HcmV?d00001 diff --git a/assets/adv_turtle.png b/assets/adv_turtle.png new file mode 100644 index 0000000000000000000000000000000000000000..e488e0f7dec2aec1a9ea18e5da29f10e498fab61 GIT binary patch literal 2830 zcmbVOeNYo;8eha}TaKeszwUH8?1j#>BAfllCLt>kFi@ZxWH3~&>fy54kUf%Y++9sT zG_<{uwicOwIJFeDLoN1dwY{^wdgTvFy+ZAc)j|~*Vny&oVI$a#;|D1BE|5&@V5RQN zllR$ufA910d!F~1yporj75nJIMVOP>cLn5k0`i_K z1Ap_)awdR?DJeg9H8l31&z|EA^MI8{+}VE?At+{!B2iFn-5((6A(^ujN`>Z?6vI2! zw3RPr)n2C?pdlzF)$692QdWYC*%HoWR1GyYsbJ1(RISmPF|*sm+PUmhJ0EE&Z$2(F_@j3Nkl@=*bAg4IUlXFN0M3%nUsc1dzmDC+Te z)E`VMv)|i>6T!63d1I#X5Px# z%BF&9af;C11qEGWr6u~lU@Jq}c)>}7oH-|5!lG_hi3$!gNtt*DF963%bd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-`VSRFx z`WY4)Od)Rg-*))fxZUi74`9uWT4@Jj=^w(p9F<~;9Gzq1w+U5|IWam zS*xA`MqkhugD{rSaaPGW!bjs&ej8a=2EjxT~E_}UCmx8EI1bN>TjpcU7eJ(Ec$3f zY*B1M(Y+H5azBGaG&i<) zx^{LLR9#7NB{MyZs=oWart`fTTYu^6&*%7b5VCz`{;q3Htrs?>N8OEeUGFm1w6#MHoX&xkk! z<=YRi^`s!}Es=EFTJGraYdGZch zf4a^q)%66uyZwQ_Yt6{{;=cl2d0(_oJ+q*46kXL_-MLG-DKORL>%AVm(_5{GTdP`= z5~zCfio@NoxxK7$jm!;(cy}jHLo}}lxu%f)ZZ8#QkKZ(9Dgi6+q4RG?>Oi!*tXO0 osJpJo-#vN$!Vyf@!1#4C=;ueFhO1{!@ZXwgDe1{|%h!JTFJvYFX8-^I literal 0 HcmV?d00001 diff --git a/assets/library.png b/assets/library.png new file mode 100644 index 0000000000000000000000000000000000000000..1d70e277d20db03bb7b7c3e4a0c165fcda035ec0 GIT binary patch literal 2700 zcmeH}drVVz6vxl+_S)X^u$Ptb7-;Y2gl#BvFPsSU@)8-!fU$uYN~Z*;ag;ciIH0{q zluVXkwhV|1(77N48-_zh!;oGj4ig{17!{Dw!V(=cNO_b;v2^93e=iw-E&TpDzu!0K zd{1(6^2zVZ*qBI1yBF*Lz%go1csu~IT@esmTSz`pleYBwEIu+6>h5`t0NCx03J*!h zJ~-AJlJ2>a4DXt``|x4#1umHyHdE(}hko2T`0X8Y>TdaTaj6I+lB4zQjVX`YoM`=4 z2*hw-FA98Hb1T1Qz{n-lWelk2Ci4O?jP;=PhcHY(e0z3;AV3EBMSOxO^3zpsp`Zo* z%fcr<$fz@z%=??~`L{Lwe$pDCoh|jFcDCl7iW;lDZ^yjNEs4C}u6CfL$`=6k^#at8+Oo$bt=uthO*{4}5WO2m;uchFl0 z0&UTO`d+$X#jabe&uR^pVS3X!#qFHVjl`YjYG$M+W3i7A8f1w>JR%{d{tGp{W6V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O8orE@JPbp1lO-|t(7136gPe59~ytM=3DG{;34Z)&q^p)@9O%yr>94Wc`83` zLO7J4|3UxNluzmLyiDAP`Vyy1d-D*%Li~T9*nuIMcH U{ifMuQ~pY3q-L7y_7t4>57lq0zW@LL literal 0 HcmV?d00001 diff --git a/blocks/IDE/index.json b/blocks/IDE/index.json index 744bbbe..6e73aec 100644 --- a/blocks/IDE/index.json +++ b/blocks/IDE/index.json @@ -7,9 +7,16 @@ "keyword": "test", "license": "GPL-3.0-or-later", "peripherals": false, - "library": false, - "turtle": false, - "pocket": false, + "library": true, "require_network": false, - "dependencies": {} + "dependencies": {}, + "design_for_computer": { + "basic": true, + "adv": true, + "command": true, + "pocket": true, + "advpocket": true, + "turtle": true, + "advturtle": true + } } \ No newline at end of file diff --git a/blocks/Template/index.json b/blocks/Template/index.json index c23bd58..e0e7681 100644 --- a/blocks/Template/index.json +++ b/blocks/Template/index.json @@ -8,8 +8,15 @@ "license": "GPL-3.0-or-later", "peripherals": false, "library": false, - "turtle": false, - "pocket": false, "require_network": false, - "dependencies": {} + "dependencies": {}, + "design_for_computer": { + "basic": false, + "adv": false, + "command": false, + "pocket": false, + "advpocket": false, + "turtle": false, + "advturtle": false + } } diff --git a/package.json b/package.json index 689272b..5873519 100644 --- a/package.json +++ b/package.json @@ -1,11 +1,11 @@ { "name": "ccide", - "version": "1.0.2", + "version": "1.1", "description": "ComputerCraft mod virtual lua IDE", "main": "index.js", "scripts": { "dev": "electron .", - "nodedev": "node ." + "build": "electron-packager . ccIDE --platform=win32 --arch=x64 --icon=assets/ccIDEIcon.ico --out=dist --overwrite" }, "author": "DPSoftware Foundation", "license": "GPL-3.0-or-later", diff --git a/src/blocksmanager.js b/src/blocksmanager.js index 62af5ea..99d403b 100644 --- a/src/blocksmanager.js +++ b/src/blocksmanager.js @@ -4,8 +4,25 @@ const { DOMParser, XMLSerializer } = require('xmldom'); const peripheralsfolder = path.join(__dirname, "../blocks"); +const fallbackImagePath = path.join(__dirname, '..', 'assets', 'noimagefallback.png'); // Path to fallback image + let registedblock = {} +const defineicon = { + computer: { + basic: path.join(__dirname, '..', 'assets', 'basic_computer.png'), + adv: path.join(__dirname, '..', 'assets', 'adv_computer.png'), + command: path.join(__dirname, '..', 'assets', 'command_computer.png'), + pocket: path.join(__dirname, '..', 'assets', 'pocket_computer.png'), + advpocket: path.join(__dirname, '..', 'assets', 'adv_pocket_computer.png'), + turtle: path.join(__dirname, '..', 'assets', 'turtle.png'), + advturtle: path.join(__dirname, '..', 'assets', 'adv_turtle.png') + }, + peripheral: path.join(__dirname, '..', 'assets', 'peripheral.png'), + library: path.join(__dirname, '..', 'assets', 'library.png'), + networkreq: path.join(__dirname, '..', 'assets', 'network-require.png') +} + function mergeXml(xml1, xml2) { const parser = new DOMParser(); const serializer = new XMLSerializer(); @@ -82,7 +99,31 @@ function extractFolderName(path) { return folderName; } +function fileExists(filePath) { + try { + return fs.existsSync(filePath); + } catch (err) { + return false; + } +} + +function addimageiconinfo(div, src, tiptool) { + const img = document.createElement('img'); + img.src = src + img.classList.add("libimageicon"); + img.setAttribute('data-bs-toggle', "tooltip"); + img.setAttribute('data-bs-placement', "bottom"); + img.setAttribute('data-bs-title', tiptool); + div.appendChild(img); + console.log(`added image ${img}`); +} + function scanindex() { + let foundedpackages = 0; + document.getElementById('statusMessage').textContent = "Scanning Packages..."; + // clear all item in libcontainer + document.getElementById('libcontainer').innerHTML = ""; + const files = fs.readdirSync(peripheralsfolder); // Iterate through files and directories @@ -101,18 +142,96 @@ function scanindex() { const jsonData = JSON.parse(content); blockfoldername = extractFolderName(filePath); - registedblock[blockfoldername] = { - infomation: jsonData, - image: null - }; - console.log(`registered ${blockfoldername} blocks`) + registedblock[blockfoldername] = jsonData; + foundedpackages++; + + // create item in list + const imagePath = path.join(filePath, "icon.png"); + + const libraryItem = document.createElement('div'); + libraryItem.classList.add('library-item', 'overflow-auto', 'library-container'); + libraryItem.setAttribute('data-libraryfolder', blockfoldername); + + // add image + const img = document.createElement('img'); + img.classList.add('libimage'); + if (fileExists(imagePath)) { + img.src = imagePath; + } else { + img.src = fallbackImagePath; + } + libraryItem.appendChild(img); + + // Create the library details container + const libraryDetails = document.createElement('div'); + libraryDetails.classList.add('library-details'); + + // Create the title element + const title = document.createElement('h3'); + title.textContent = jsonData.name + ` [v${jsonData.version} by ${jsonData.author}]`; + libraryDetails.appendChild(title); + + // Create the description element + const description = document.createElement('p'); + description.innerHTML = jsonData.description; + libraryDetails.appendChild(description); + + console.log(jsonData) + if (jsonData.design_for_computer.basic) { + addimageiconinfo(libraryDetails, defineicon.computer.basic, "Basic Computer Supported"); + } + if (jsonData.design_for_computer.adv) { + addimageiconinfo(libraryDetails, defineicon.computer.adv, "Advanced Computer Supported"); + } + if (jsonData.design_for_computer.command) { + addimageiconinfo(libraryDetails, defineicon.computer.command, "Command Computer Supported"); + } + if (jsonData.design_for_computer.pocket) { + addimageiconinfo(libraryDetails, defineicon.computer.pocket, "Pocket Computer Supported"); + } + if (jsonData.design_for_computer.advpocket) { + addimageiconinfo(libraryDetails, defineicon.computer.advpocket, "Advanced Pocket Computer Supported"); + } + if (jsonData.design_for_computer.turtle) { + addimageiconinfo(libraryDetails, defineicon.computer.turtle, "Turtle Supported"); + } + if (jsonData.design_for_computer.advturtle) { + addimageiconinfo(libraryDetails, defineicon.computer.advturtle, "Advanced Turtle Supported"); + } + + // check computer type support + if (jsonData.peripherals) { + addimageiconinfo(libraryDetails, defineicon.peripheral, "Peripheral"); + } + if (jsonData.library) { + addimageiconinfo(libraryDetails, defineicon.library, "Library"); + } + if (jsonData.require_network) { + addimageiconinfo(libraryDetails, defineicon.networkreq, "Require Network"); + } + + libraryItem.appendChild(libraryDetails); + document.getElementById('libcontainer').appendChild(libraryItem); + console.log(`registered ${blockfoldername} blocks and added to packages managers`) } }) } }); + + document.querySelectorAll('.library-item').forEach(item => { + item.addEventListener('click', () => { + item.classList.toggle('selected'); + }); + }); + + document.getElementById('statusMessage').textContent = `Founded ${foundedpackages} Packages`; + setTimeout(() => { + document.getElementById('statusMessage').textContent = `Ready`; + }, 1000); } + module.exports = { loadperipheral, scanindex diff --git a/src/index.html b/src/index.html index c9c53a1..1ad9467 100644 --- a/src/index.html +++ b/src/index.html @@ -7,6 +7,7 @@ @@ -17,12 +18,9 @@ - - @@ -99,21 +97,44 @@

ccIDE

-