diff --git a/README.md b/README.md index 577a732..3b5d1a8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ Grasscutter launcher for easily switching between Official and Private servers [Download Here!](https://github.com/Grasscutters/GrassClipper/releases/) +*\*Note: some translations are outdated, so if random English text appears or an option seems misleading, this is why. If you notice an issue like this, feel free to make a pull request!* + # Table of Contents * [Setup (for users)](#setup-for-users) diff --git a/languages/zh-tw.json b/languages/zh-tw.json index ca1984a..266dbeb 100644 --- a/languages/zh-tw.json +++ b/languages/zh-tw.json @@ -6,8 +6,8 @@ "playPrivate": "啟動私人伺服器", "launchLocalServer": "啟動本地伺服器", - "gameExeSet": "設定 \"Genshin Impact game\" 資料夾", - "grasscutterFileSet": "設定 \"Grasscutter\" .jar 檔案", + "gameExeSet": "設定\"GenshinImpact\".exe執行檔", + "grasscutterFileSet": "設定 \"Grasscutter\".jar 檔案", "folderNotSet": "尚未設定Genshin Impact game資料夾", "ipPlaceholder": "IP地址", diff --git a/manifest.json b/manifest.json index f5e043b..0337bc3 100644 --- a/manifest.json +++ b/manifest.json @@ -1,5 +1,5 @@ { "applicationId": "js.grassclipper.app", - "version": "0.7.3", + "version": "0.7.4", "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 4336cac..8de601a 100644 --- a/neutralino.config.json +++ b/neutralino.config.json @@ -1,6 +1,6 @@ { "applicationId": "js.grassclipper.app", - "version": "0.7.3", + "version": "0.7.4", "defaultMode": "window", "port": 0, "documentRoot": "/resources/", diff --git a/package.json b/package.json index 30681fd..aca7e4b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "grassclipper", - "version": "0.7.3", + "version": "0.7.4", "repository": "https://github.com/Grasscutters/GrassClipper.git", "author": "SpikeHD ", "license": "Apache-2.0", diff --git a/resources/icons/folder.svg b/resources/icons/folder.svg new file mode 100644 index 0000000..077b707 --- /dev/null +++ b/resources/icons/folder.svg @@ -0,0 +1,10 @@ + +Created with Fabric.js 1.7.22 + + + + + + + + \ No newline at end of file diff --git a/resources/index.html b/resources/index.html index 3b97fb9..ff2622c 100644 --- a/resources/index.html +++ b/resources/index.html @@ -128,11 +128,17 @@
- +
+ + +
- +
+ + +
diff --git a/resources/js/helpers.js b/resources/js/helpers.js index d4fe160..1beba4a 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -57,6 +57,20 @@ async function proxyIsInstalled() { return false } +async function openGameFolder() { + const config = await getCfg() + const folder = config.gameexe.match(/.*\\/g, '')[0] + + openInExplorer(folder) +} + +async function openGrasscutterFolder() { + const config = await getCfg() + const folder = config.serverFolder.match(/.*\\/g, '')[0] + + openInExplorer(folder) +} + /** * Minimize the window */ diff --git a/resources/js/index.js b/resources/js/index.js index 8135997..8aaf05d 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -3,7 +3,11 @@ Neutralino.init(); let localeObj; const filesystem = Neutralino.filesystem const createCmdWindow = async (command) => { - Neutralino.os.execCommand(`cmd.exe /c start ${command}`, { background: true }) + Neutralino.os.execCommand(`cmd.exe /c start "" ${command}`, { background: true }) +} + +const openInExplorer = async (path) => { + createCmdWindow(`explorer.exe "${path}"`) } /** @@ -286,7 +290,7 @@ async function closeFirstTimePopup() { } async function runInstallScript() { - createCmdWindow(`${NL_CWD}/scripts/install.cmd "${NL_CWD}" true`) + createCmdWindow(`.\\scripts\\install.cmd "${NL_CWD}" true`) // Create an interval that will check for the proxy server installation finish const interval = setInterval(async () => { @@ -366,7 +370,7 @@ async function setGrasscutterFolder() { // Set the folder in our configuration const config = await getCfg() - config.serverFolder = folder + config.serverFolder = folder[0] Neutralino.storage.setData('config', JSON.stringify(config)) displayServerFolder() @@ -398,11 +402,11 @@ async function launchPrivate() { Neutralino.storage.setData('config', JSON.stringify(config)) // Pass IP and game folder to the private server launcher - createCmdWindow(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gameexe}" "${NL_CWD}" ${config.enableKillswitch} true`).catch(e => console.log(e)) + createCmdWindow(`.\\scripts\\private_server_launch.cmd ${ip} ${port} ${config.useHttps} "${config.gameexe}" "${NL_CWD}" ${config.enableKillswitch} true`).catch(e => console.log(e)) } async function launchLocalServer() { const config = await getCfg() - createCmdWindow(`${NL_CWD}/scripts/local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e)) + createCmdWindow(`.\\scripts\\local_server_launch.cmd "${config.serverFolder}"`).catch(e => console.log(e)) } diff --git a/resources/style/index.css b/resources/style/index.css index e559189..e78ac6f 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -277,6 +277,18 @@ body { background: linear-gradient(#ffc61e, #ffd326); } +.openFolderIcon { + display: inline; + height: 20px; + filter: invert(97%) sepia(85%) saturate(12%) hue-rotate(184deg) brightness(103%) contrast(103%); + padding: 10px; +} + +.openFolderIcon:hover { + cursor: pointer; + filter: invert(99%) sepia(0%) saturate(1092%) hue-rotate(172deg) brightness(80%) contrast(103%); +} + #bottomBar { display: flex; justify-content: center; @@ -305,6 +317,12 @@ body { height: 10%; } +.bottomSection div div { + display: flex; + flex-direction: row; + height: 100%; +} + #gamePath, #serverPath { color: white; font-size: 14px; diff --git a/scripts/install.cmd b/scripts/install.cmd index 178f1a7..f023540 100644 --- a/scripts/install.cmd +++ b/scripts/install.cmd @@ -9,22 +9,22 @@ echo Downloading proxy server... cd "%ORIGIN%" if not exist "%ORIGIN%/ext" mkdir "%ORIGIN%/ext" -if not exist "%ORIGIN%/temp" mkdir "%ORIGIN%/temp" +if not exist "%ORIGIN%/temp" mkdir "%ORIGIN%/temp :: Begin by retrieving mitmproxy 7.0.4 -powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-windows.zip -OutFile "%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip" +powershell Invoke-WebRequest -Uri https://snapshots.mitmproxy.org/7.0.4/mitmproxy-7.0.4-windows.zip -OutFile "'%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip'" echo Extracting... :: Extract from temp/ to ext/ with powershell -powershell Expand-Archive -Path "%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip" -DestinationPath "%ORIGIN%/ext/" -Force +powershell Expand-Archive -Path "'%ORIGIN%/temp/mitmproxy-7.0.4-windows.zip'" -DestinationPath "'%ORIGIN%/ext/'" -Force del /s /q "%ORIGIN%/temp" echo Running proxy server in order to generate certificates... :: Start proxy server -start "Proxy Server" %ORIGIN%/ext/mitmdump.exe --ssl-insecure --set ip=%ip% +start "Proxy Server" "%ORIGIN%/ext/mitmdump.exe" --ssl-insecure --set ip=%ip% :: Allow the proxy server to create the certificates ping 127.0.0.1 -n 6 > nul diff --git a/scripts/private_server_launch.cmd b/scripts/private_server_launch.cmd index 787e5a0..ae0b3e6 100644 --- a/scripts/private_server_launch.cmd +++ b/scripts/private_server_launch.cmd @@ -38,7 +38,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" --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" --ssl-insecure --set ip=%IP% --set port=%PORT% --set use_https=%USE_HTTPS% echo Opening %GAME_PATH%