add resource download properly

This commit is contained in:
SpikeHD 2022-05-07 17:15:54 -07:00
parent b6adec4079
commit 055abef5ce
7 changed files with 14 additions and 6 deletions

View File

@ -1,5 +1,5 @@
{ {
"applicationId": "js.grassclipper.app", "applicationId": "js.grassclipper.app",
"version": "0.9.4", "version": "0.9.5",
"resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu" "resourcesURL": "https://github.com/Grasscutters/GrassClipper/releases/latest/download/resources.neu"
} }

View File

@ -1,6 +1,6 @@
{ {
"applicationId": "js.grassclipper.app", "applicationId": "js.grassclipper.app",
"version": "0.9.4", "version": "0.9.5",
"defaultMode": "window", "defaultMode": "window",
"port": 0, "port": 0,
"documentRoot": "/resources/", "documentRoot": "/resources/",

View File

@ -1,6 +1,6 @@
{ {
"name": "grassclipper", "name": "grassclipper",
"version": "0.9.4", "version": "0.9.5",
"repository": "https://github.com/Grasscutters/GrassClipper.git", "repository": "https://github.com/Grasscutters/GrassClipper.git",
"author": "SpikeHD <spikegdofficial@gmail.com>", "author": "SpikeHD <spikegdofficial@gmail.com>",
"license": "Apache-2.0", "license": "Apache-2.0",

View File

@ -175,7 +175,7 @@
<div class="downloadRow"> <div class="downloadRow">
<div class="downloadSection"> <div class="downloadSection">
<span class="downloadLabel" id="downloadResources">Download Grasscutter Resources</span> <span class="downloadLabel" id="downloadResources">Download Grasscutter Resources</span>
<button class="smolBtn" onclick="downloadGC('development')" id="resourceInstall">Download</button> <button class="smolBtn" onclick="downloadResources()" id="resourceInstall">Download</button>
</div> </div>
<span class="downloadSubtitle" id="resourceSubtitle"> <span class="downloadSubtitle" id="resourceSubtitle">
Downloads Grasscutter resources into the currently set Grasscutter folder. This should be done unless you plan on getting resources externally. Downloads Grasscutter resources into the currently set Grasscutter folder. This should be done unless you plan on getting resources externally.

View File

@ -103,3 +103,11 @@ async function downloadGC(branch) {
enableServerButton() enableServerButton()
displayServerLaunchSection() 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}"`)
}

View File

@ -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 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
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% echo Opening %GAME_PATH%

View File

@ -4,7 +4,7 @@ set FOLDER_NAME=%1
set FOLDER_NAME=%FOLDER_NAME:"=% set FOLDER_NAME=%FOLDER_NAME:"=%
if not exist ".\temp" mkdir ".\temp" 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... echo Downloading resources, this can take a while...