From 055abef5cec5bf421d43bf5428c0ce22d8d61a2c Mon Sep 17 00:00:00 2001 From: SpikeHD Date: Sat, 7 May 2022 17:15:54 -0700 Subject: [PATCH] add resource download properly --- manifest.json | 2 +- neutralino.config.json | 2 +- package.json | 2 +- resources/index.html | 2 +- resources/js/gcdownloader.js | 8 ++++++++ scripts/private_server_launch.cmd | 2 +- scripts/resources_download.cmd | 2 +- 7 files changed, 14 insertions(+), 6 deletions(-) diff --git a/manifest.json b/manifest.json index 830026a..29293a9 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { "applicationId": "js.grassclipper.app", - "version": "0.9.4", + "version": "0.9.5", "resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu" } \ No newline at end of file diff --git a/neutralino.config.json b/neutralino.config.json index 015fc6b..d5886df 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -1,6 +1,6 @@ { "applicationId": "js.grassclipper.app", - "version": "0.9.4", + "version": "0.9.5", "defaultMode": "window", "port": 0, "documentRoot": "/resources/", diff --git a/package.json b/package.json index 0d92cb6..f783fd2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grassclipper", - "version": "0.9.4", + "version": "0.9.5", "repository": "https://github.com/Grasscutters/GrassClipper.git", "author": "SpikeHD ", "license": "Apache-2.0", diff --git a/resources/index.html b/resources/index.html index 913ec51..a982044 100644 --- a/resources/index.html +++ b/resources/index.html @@ -175,7 +175,7 @@
Download Grasscutter Resources - +
Downloads Grasscutter resources into the currently set Grasscutter folder. This should be done unless you plan on getting resources externally. diff --git a/resources/js/gcdownloader.js b/resources/js/gcdownloader.js index 8244c71..d28b732 100644 --- a/resources/js/gcdownloader.js +++ b/resources/js/gcdownloader.js @@ -102,4 +102,12 @@ async function downloadGC(branch) { displayServerFolder() enableServerButton() displayServerLaunchSection() +} + +async function downloadResources() { + const config = await getCfg() + const serverFolderFixed = config.serverFolder.match(/.*\\|.*\//g, '')[0].replace(/\//g, '\\') + + // Dont bother with data or keys, just want straight resources + createCmdWindow(`.\\scripts\\resources_download.cmd "${serverFolderFixed}"`) } \ No newline at end of file diff --git a/scripts/private_server_launch.cmd b/scripts/private_server_launch.cmd index 5f78002..dc77127 100644 --- a/scripts/private_server_launch.cmd +++ b/scripts/private_server_launch.cmd @@ -44,7 +44,7 @@ reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v Pr reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyServer /d "127.0.0.1:8080" /f >nul 2>nul :: Start proxy server -start "Proxy Server" "%ORIGIN%\ext\mitmdump.exe" -s "%ORIGIN%/proxy/proxy.py" -k --allow-hosts ".*\.yuanshen\.com|.*\.mihoyo\.com|.*\.hoyoverse\.com" --ssl-insecure --set ip=%IP% --set port=%PORT% --set use_https=%USE_HTTPS% +start "Proxy Server" "%ORIGIN%\ext\mitmdump.exe" -s "%ORIGIN%\proxy\proxy.py" -k --allow-hosts ".*\.yuanshen\.com|.*\.mihoyo\.com|.*\.hoyoverse\.com" --ssl-insecure --set ip=%IP% --set port=%PORT% --set use_https=%USE_HTTPS% echo Opening %GAME_PATH% diff --git a/scripts/resources_download.cmd b/scripts/resources_download.cmd index d5e14e6..b7cc882 100644 --- a/scripts/resources_download.cmd +++ b/scripts/resources_download.cmd @@ -4,7 +4,7 @@ set FOLDER_NAME=%1 set FOLDER_NAME=%FOLDER_NAME:"=% if not exist ".\temp" mkdir ".\temp" -if not exist ".\resources" mkdir ".\resources" +if not exist "%FOLDER_NAME%\resources" mkdir "%FOLDER_NAME%\resources" echo Downloading resources, this can take a while...