diff --git a/README.md b/README.md index 161745a..07def0f 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ Grasscutter launcher for easily switching between Official and Private servers 1. Download the zip file 2. Extract the zip file somewhere -3. Run `GrassClipper.exe`, install the proxy server, and set your `Genshin Impact Game` folder! +3. Run `GrassClipper.exe`, install the proxy server, and set your game folder! # Setup (for Development) diff --git a/languages/en.json b/languages/en.json index 4d9a21f..cbf092b 100644 --- a/languages/en.json +++ b/languages/en.json @@ -6,7 +6,7 @@ "playPrivate": "Play on Grasscutter", "launchLocalServer": "Launch Local Server", - "genshinFolderSet": "Set \"Genshin Impact Game\" folder", + "gameFolderSet": "Set game folder", "grasscutterFileSet": "Set \"Grasscutter\" .jar file", "folderNotSet": "Not set", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Install", "proxyInstallDeny": "No thanks", - "genshinFolderDialog": "Select Genshin Impact Game folder", + "gameFolderDialog": "Select game folder", "grasscutterFileDialog": "Select Grasscutter server jar file" } diff --git a/languages/es.json b/languages/es.json index bf0dad4..c3cc788 100644 --- a/languages/es.json +++ b/languages/es.json @@ -6,7 +6,7 @@ "playPrivate": "Jugar en Grasscutter", "launchLocalServer": "Iniciar servidor local", - "genshinFolderSet": "Establece el folder \"Genshin Impact Game\"", + "gameFolderSet": "Establece el folder game", "grasscutterFileSet": "Establece el archivo .jar de \"Grasscutter\"", "folderNotSet": "No establecido", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Instalar", "proxyInstallDeny": "No gracias", - "genshinFolderDialog": "Selecciona la carpeta Genshin Impact game", + "gameFolderDialog": "Selecciona la carpeta game", "grasscutterFileDialog": "Selecciona el archivo .jar de Grasscutter" } diff --git a/languages/fr.json b/languages/fr.json index 1aa6707..3eb9246 100644 --- a/languages/fr.json +++ b/languages/fr.json @@ -6,7 +6,7 @@ "playPrivate": "Jouer sur Grasscutter", "launchLocalServer": "Lancer le serveur en local", - "genshinFolderSet": "Définir le dossier \"Genshin Impact Game\"", + "gameFolderSet": "Définir le dossier game", "grasscutterFileSet": "Définir le fichier .jar \"Grasscutter\"", "folderNotSet": "Pas encore défini", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Installer", "proxyInstallDeny": "Non merci", - "genshinFolderDialog": "Sélectionnez le dossier contenant Genshin Impact", + "gameFolderDialog": "Sélectionnez le dossier contenant le game", "grasscutterFileDialog": "Selectionnez le fichier jar du serveur de Grasscutter" } diff --git a/languages/id.json b/languages/id.json index f1f1a8b..5c200f0 100644 --- a/languages/id.json +++ b/languages/id.json @@ -6,7 +6,7 @@ "playPrivate": "Mainkan Grasscutter", "launchLocalServer": "Luncurkan Local Server", - "genshinFolderSet": "Atur folder \"Genshin Impact Game\"", + "gameFolderSet": "Atur folder game", "grasscutterFileSet": "Atur file \"Grasscutter\" .jar", "folderNotSet": "Belum diatur", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Install", "proxyInstallDeny": "Tidak terima kasih", - "genshinFolderDialog": "Pilih folder Genshin Impact Game", + "gameFolderDialog": "Pilih folder game", "grasscutterFileDialog": "Pilih file jar server Grasscutter" } \ No newline at end of file diff --git a/languages/nl.json b/languages/nl.json index c514295..cdbeed2 100644 --- a/languages/nl.json +++ b/languages/nl.json @@ -6,7 +6,7 @@ "playPrivate": "Op Grasscutter spelen", "launchLocalServer": "Lokale server starten", - "genshinFolderSet": "Selecteer de \"Genshin Impact Game\" folder", + "gameFolderSet": "Selecteer de game folder", "grasscutterFileSet": "Selecteer het \"Grasscutter\" .jar bestand", "folderNotSet": "Niet geselecteerd", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Installeren", "proxyInstallDeny": "Nee dank je", - "genshinFolderDialog": "Selecteer de Genshin Impact Game folder", + "gameFolderDialog": "Selecteer de game folder", "grasscutterFileDialog": "Selecteer het Grasscutter server jar bestand" } diff --git a/languages/pt-br.json b/languages/pt-br.json index 48c3ef5..23c3402 100644 --- a/languages/pt-br.json +++ b/languages/pt-br.json @@ -6,7 +6,7 @@ "playPrivate": "Jogar (Grasscutter)", "launchLocalServer": "Abrir Servidor Local", - "genshinFolderSet": "Definir a pasta: \"Genshin Impact Game\" ", + "gameFolderSet": "Definir a game pasta ", "grasscutterFileSet": "Definir o arquivo .jar de \"Grasscutter\" ", "folderNotSet": "Não Definida", @@ -34,6 +34,6 @@ "proxyInstallBtn": "Instalar", "proxyInstallDeny": "Não obrigado", - "genshinFolderDialog": "Selecione a pasta Genshin Impact Game", + "gameFolderDialog": "Selecione a game pasta", "grasscutterFileDialog": "Selecione o arquivo jar do Grasscutter" } \ No newline at end of file diff --git a/languages/vie.json b/languages/vie.json index 0550a2b..31800c3 100644 --- a/languages/vie.json +++ b/languages/vie.json @@ -6,7 +6,7 @@ "playPrivate": "Grasscutter", "launchLocalServer": "Khởi động Grasscutter", - "genshinFolderSet": "Chỉnh địa điểm thư mục \"Genshin Impact Game\"", + "gameFolderSet": "Chỉnh địa điểm thư mục trò chơi", "grasscutterFileSet": "Chỉnh địa điểm file \"Grasscutter\"", "folderNotSet": "Chưa chỉnh file", @@ -35,6 +35,6 @@ "proxyInstallBtn": "Có", "proxyInstallDeny": "Không", - "genshinFolderDialog": "Chọn thư mục có chứa game", + "gameFolderDialog": "Chọn thư mục có chứa trò chơi", "grasscutterFileDialog": "Chọn file Grasscutter" } \ No newline at end of file diff --git a/languages/zh.json b/languages/zh.json index 59fb4e7..1791328 100644 --- a/languages/zh.json +++ b/languages/zh.json @@ -6,7 +6,7 @@ "playPrivate": "在 Grasscutter 上播放", "launchLocalServer": "启动本地服务器", - "genshinFolderSet": "选择 \"原神\" 文件夹", + "gameFolderSet": "选择 \"原神\" 文件夹", "grasscutterFileSet": "选择 \"Grasscutter\" .jar 文件", "folderNotSet": "没有设置原神文件夹或Grasscutter文件", @@ -34,6 +34,6 @@ "proxyInstallBtn": "安装", "proxyInstallDeny": "不用了,谢谢", - "genshinFolderDialog": "选择原神文件夹", + "gameFolderDialog": "选择原神文件夹", "grasscutterFileDialog": "选择Grasscutter服务器jar文件" } diff --git a/proxy/proxy.py b/proxy/proxy.py index eae593f..581b3cb 100644 --- a/proxy/proxy.py +++ b/proxy/proxy.py @@ -6,7 +6,7 @@ ## # -# Genshin Impact script for mitmproxy +# Anime game script for mitmproxy # # https://github.com/MlgmXyysd/ # @@ -24,7 +24,7 @@ import string from mitmproxy import ctx from mitmproxy import http -class MlgmXyysd_Genshin_Impact_Proxy: +class MlgmXyysd_Anime_Game_Proxy: def load(self, loader): loader.add_option( @@ -77,5 +77,5 @@ class MlgmXyysd_Genshin_Impact_Proxy: flow.request.host = REMOTE_HOST addons = [ - MlgmXyysd_Genshin_Impact_Proxy() + MlgmXyysd_Anime_Game_Proxy() ] \ No newline at end of file diff --git a/resources/bg/private/1.png b/resources/bg/private/1.png index 6140560..295812c 100644 Binary files a/resources/bg/private/1.png and b/resources/bg/private/1.png differ diff --git a/resources/index.html b/resources/index.html index 0542060..57cc2a6 100644 --- a/resources/index.html +++ b/resources/index.html @@ -117,8 +117,8 @@
- - + +
diff --git a/resources/js/helpers.js b/resources/js/helpers.js index bfd99d3..6d83690 100644 --- a/resources/js/helpers.js +++ b/resources/js/helpers.js @@ -5,7 +5,7 @@ */ async function getCfg() { const defaultConf = { - genshinImpactFolder: '', + gamefolder: '', serverFolder: '', lastConnect: '', enableKillswitch: false, @@ -61,15 +61,15 @@ async function proxyIsInstalled() { * * @returns {Promise} */ - async function getGenshinExecName() { - // Scan genshin dir + async function getGameExecName() { + // Scan game dir const config = await getCfg() - const genshinDir = await filesystem.readDirectory(config.genshinImpactFolder) + const gameDir = await filesystem.readDirectory(config.gamefolder) // Find the executable - const genshinExec = genshinDir.find(file => file.entry.endsWith('.exe')) + const gameExec = gameDir.find(file => file.entry.endsWith('.exe')) - return genshinExec.entry + return gameExec.entry } /** diff --git a/resources/js/index.js b/resources/js/index.js index ff967b0..6b68a7e 100644 --- a/resources/js/index.js +++ b/resources/js/index.js @@ -33,9 +33,9 @@ async function enableButtons() { /** * Disable buttons when the game folder is not set */ -async function handleGenshinFolderNotSet() { +async function handleGameNotSet() { // Set buttons to greyed out and disable - document.querySelector('#genshinPath').innerHTML = localeObj.folderNotSet + document.querySelector('#gamePath').innerHTML = localeObj.folderNotSet // Set official server background to default document.querySelector('#firstPanel').style.backgroundImage = `url("../bg/private/default.png")` @@ -68,11 +68,11 @@ async function handleServerNotSet() { /** * Show the game folder under the select button */ -async function displayGenshinFolder() { - const elm = document.querySelector('#genshinPath') +async function displayGameFolder() { + const elm = document.querySelector('#gamePath') const config = await getCfg() - elm.innerHTML = config.genshinImpactFolder + elm.innerHTML = config.gamefolder } /** @@ -126,17 +126,17 @@ async function setBackgroundImage() { await filesystem.createDirectory(NL_CWD + '/resources/bg/official') } - if (config.genshinImpactFolder) { + if (config.gamefolder) { // See if bg folder exists in parent dir - const parentDir = await filesystem.readDirectory(config.genshinImpactFolder + '/..') + const parentDir = await filesystem.readDirectory(config.gamefolder + '/..') if (parentDir.find(dir => dir.entry === 'bg')) { - const officialImages = (await filesystem.readDirectory(config.genshinImpactFolder + '/../bg')).filter(file => file.type === 'FILE') + const officialImages = (await filesystem.readDirectory(config.gamefolder + '/../bg')).filter(file => file.type === 'FILE') if (officialImages.length > 0) { for (const bg of officialImages) { - const path = config.genshinImpactFolder.replace('\\', '/') + '/../bg/' + bg.entry + const path = config.gamefolder.replace('\\', '/') + '/../bg/' + bg.entry // See if the file exists already const currentBgs = (await filesystem.readDirectory(NL_CWD + '/resources/bg/official/')).filter(file => file.type === 'FILE') @@ -259,7 +259,7 @@ async function closeSettings() { settings.style.display = 'none' // In case we installed the proxy server - if (await proxyIsInstalled() && config.genshinImpactFolder) { + if (await proxyIsInstalled() && config.gamefolder) { const playPriv = document.querySelector('#playPrivate') playPriv.classList.remove('disabled') @@ -314,8 +314,8 @@ async function displayServerLaunchSection() { /** * Set the game folder by opening a folder picker */ -async function setGenshinImpactFolder() { - const folder = await Neutralino.os.showFolderDialog(localeObj.genshinFolderDialog) +async function setGameFolder() { + const folder = await Neutralino.os.showFolderDialog(localeObj.gameFolderDialog) // Set the folder in our configuration const config = await getCfg() @@ -325,17 +325,17 @@ async function setGenshinImpactFolder() { const gameFolder = folderList.filter(file => file.entry.includes('Genshin Impact Game')) if (gameFolder.length > 0) { - config.genshinImpactFolder = folder + '\\Genshin Impact Game' + config.gamefolder = folder + '\\Genshin Impact Game' Neutralino.storage.setData('config', JSON.stringify(config)) } else { - config.genshinImpactFolder = folder + config.gamefolder = folder } Neutralino.storage.setData('config', JSON.stringify(config)) // Refresh background and path setBackgroundImage() - displayGenshinFolder() + displayGameFolder() enableButtons() } @@ -362,7 +362,7 @@ async function setGrasscutterFolder() { async function launchOfficial() { const config = await getCfg() - Neutralino.os.execCommand(config.genshinImpactFolder + '/' + await getGenshinExecName()) + Neutralino.os.execCommand(config.gamefolder + '/' + await getGameExecName()) } /** @@ -380,7 +380,7 @@ async function launchPrivate() { Neutralino.storage.setData('config', JSON.stringify(config)) // Pass IP and game folder to the private server launcher - Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} "${config.genshinImpactFolder}/${await getGenshinExecName()}" "${NL_CWD}" ${config.enableKillswitch}`).catch(e => console.log(e)) + Neutralino.os.execCommand(`${NL_CWD}/scripts/private_server_launch.cmd ${ip} "${config.gamefolder}/${await getGameExecName()}" "${NL_CWD}" ${config.enableKillswitch}`).catch(e => console.log(e)) } async function launchLocalServer() { diff --git a/resources/js/onLoad.js b/resources/js/onLoad.js index 3224bb6..48c50b8 100644 --- a/resources/js/onLoad.js +++ b/resources/js/onLoad.js @@ -5,7 +5,7 @@ */ document.addEventListener('DOMContentLoaded', async () => { setBackgroundImage(); - displayGenshinFolder(); + displayGameFolder(); displayServerFolder(); // Set title version @@ -68,8 +68,8 @@ // Ensure we do the translation at the very end, after everything else has loaded await doTranslation() - if (!config.genshinImpactFolder) { - handleGenshinFolderNotSet() + if (!config.gamefolder) { + handleGameNotSet() } if (!config.serverFolder) { diff --git a/resources/js/translation.js b/resources/js/translation.js index 80644f9..712053d 100644 --- a/resources/js/translation.js +++ b/resources/js/translation.js @@ -32,7 +32,7 @@ async function doTranslation() { set('serverLaunch', localeObj.launchLocalServer) // File select buttons - set('genshinFolderSet', localeObj.genshinFolderSet) + set('gameFolderSet', localeObj.gameFolderSet) set('grasscutterFileSet', localeObj.grasscutterFileSet) // Private options diff --git a/resources/style/index.css b/resources/style/index.css index e7d2b6c..8f8c57d 100644 --- a/resources/style/index.css +++ b/resources/style/index.css @@ -304,7 +304,7 @@ body { height: 10%; } -#genshinPath, #serverPath { +#gamePath, #serverPath { color: white; font-size: 14px; }