Change references to anime game to generic references

This commit is contained in:
SpikeHD 2022-04-23 21:05:07 -07:00
parent 19a35fce2d
commit f9eb06c3e7
17 changed files with 50 additions and 50 deletions

View File

@ -19,7 +19,7 @@ Grasscutter launcher for easily switching between Official and Private servers
1. Download the zip file 1. Download the zip file
2. Extract the zip file somewhere 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) # Setup (for Development)

View File

@ -6,7 +6,7 @@
"playPrivate": "Play on Grasscutter", "playPrivate": "Play on Grasscutter",
"launchLocalServer": "Launch Local Server", "launchLocalServer": "Launch Local Server",
"genshinFolderSet": "Set \"Genshin Impact Game\" folder", "gameFolderSet": "Set game folder",
"grasscutterFileSet": "Set \"Grasscutter\" .jar file", "grasscutterFileSet": "Set \"Grasscutter\" .jar file",
"folderNotSet": "Not set", "folderNotSet": "Not set",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Install", "proxyInstallBtn": "Install",
"proxyInstallDeny": "No thanks", "proxyInstallDeny": "No thanks",
"genshinFolderDialog": "Select Genshin Impact Game folder", "gameFolderDialog": "Select game folder",
"grasscutterFileDialog": "Select Grasscutter server jar file" "grasscutterFileDialog": "Select Grasscutter server jar file"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Jugar en Grasscutter", "playPrivate": "Jugar en Grasscutter",
"launchLocalServer": "Iniciar servidor local", "launchLocalServer": "Iniciar servidor local",
"genshinFolderSet": "Establece el folder \"Genshin Impact Game\"", "gameFolderSet": "Establece el folder game",
"grasscutterFileSet": "Establece el archivo .jar de \"Grasscutter\"", "grasscutterFileSet": "Establece el archivo .jar de \"Grasscutter\"",
"folderNotSet": "No establecido", "folderNotSet": "No establecido",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Instalar", "proxyInstallBtn": "Instalar",
"proxyInstallDeny": "No gracias", "proxyInstallDeny": "No gracias",
"genshinFolderDialog": "Selecciona la carpeta Genshin Impact game", "gameFolderDialog": "Selecciona la carpeta game",
"grasscutterFileDialog": "Selecciona el archivo .jar de Grasscutter" "grasscutterFileDialog": "Selecciona el archivo .jar de Grasscutter"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Jouer sur Grasscutter", "playPrivate": "Jouer sur Grasscutter",
"launchLocalServer": "Lancer le serveur en local", "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\"", "grasscutterFileSet": "Définir le fichier .jar \"Grasscutter\"",
"folderNotSet": "Pas encore défini", "folderNotSet": "Pas encore défini",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Installer", "proxyInstallBtn": "Installer",
"proxyInstallDeny": "Non merci", "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" "grasscutterFileDialog": "Selectionnez le fichier jar du serveur de Grasscutter"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Mainkan Grasscutter", "playPrivate": "Mainkan Grasscutter",
"launchLocalServer": "Luncurkan Local Server", "launchLocalServer": "Luncurkan Local Server",
"genshinFolderSet": "Atur folder \"Genshin Impact Game\"", "gameFolderSet": "Atur folder game",
"grasscutterFileSet": "Atur file \"Grasscutter\" .jar", "grasscutterFileSet": "Atur file \"Grasscutter\" .jar",
"folderNotSet": "Belum diatur", "folderNotSet": "Belum diatur",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Install", "proxyInstallBtn": "Install",
"proxyInstallDeny": "Tidak terima kasih", "proxyInstallDeny": "Tidak terima kasih",
"genshinFolderDialog": "Pilih folder Genshin Impact Game", "gameFolderDialog": "Pilih folder game",
"grasscutterFileDialog": "Pilih file jar server Grasscutter" "grasscutterFileDialog": "Pilih file jar server Grasscutter"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Op Grasscutter spelen", "playPrivate": "Op Grasscutter spelen",
"launchLocalServer": "Lokale server starten", "launchLocalServer": "Lokale server starten",
"genshinFolderSet": "Selecteer de \"Genshin Impact Game\" folder", "gameFolderSet": "Selecteer de game folder",
"grasscutterFileSet": "Selecteer het \"Grasscutter\" .jar bestand", "grasscutterFileSet": "Selecteer het \"Grasscutter\" .jar bestand",
"folderNotSet": "Niet geselecteerd", "folderNotSet": "Niet geselecteerd",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Installeren", "proxyInstallBtn": "Installeren",
"proxyInstallDeny": "Nee dank je", "proxyInstallDeny": "Nee dank je",
"genshinFolderDialog": "Selecteer de Genshin Impact Game folder", "gameFolderDialog": "Selecteer de game folder",
"grasscutterFileDialog": "Selecteer het Grasscutter server jar bestand" "grasscutterFileDialog": "Selecteer het Grasscutter server jar bestand"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Jogar (Grasscutter)", "playPrivate": "Jogar (Grasscutter)",
"launchLocalServer": "Abrir Servidor Local", "launchLocalServer": "Abrir Servidor Local",
"genshinFolderSet": "Definir a pasta: \"Genshin Impact Game\" ", "gameFolderSet": "Definir a game pasta ",
"grasscutterFileSet": "Definir o arquivo .jar de \"Grasscutter\" ", "grasscutterFileSet": "Definir o arquivo .jar de \"Grasscutter\" ",
"folderNotSet": "Não Definida", "folderNotSet": "Não Definida",
@ -34,6 +34,6 @@
"proxyInstallBtn": "Instalar", "proxyInstallBtn": "Instalar",
"proxyInstallDeny": "Não obrigado", "proxyInstallDeny": "Não obrigado",
"genshinFolderDialog": "Selecione a pasta Genshin Impact Game", "gameFolderDialog": "Selecione a game pasta",
"grasscutterFileDialog": "Selecione o arquivo jar do Grasscutter" "grasscutterFileDialog": "Selecione o arquivo jar do Grasscutter"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "Grasscutter", "playPrivate": "Grasscutter",
"launchLocalServer": "Khởi động 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\"", "grasscutterFileSet": "Chỉnh địa điểm file \"Grasscutter\"",
"folderNotSet": "Chưa chỉnh file", "folderNotSet": "Chưa chỉnh file",
@ -35,6 +35,6 @@
"proxyInstallBtn": "Có", "proxyInstallBtn": "Có",
"proxyInstallDeny": "Không", "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" "grasscutterFileDialog": "Chọn file Grasscutter"
} }

View File

@ -6,7 +6,7 @@
"playPrivate": "在 Grasscutter 上播放", "playPrivate": "在 Grasscutter 上播放",
"launchLocalServer": "启动本地服务器", "launchLocalServer": "启动本地服务器",
"genshinFolderSet": "选择 \"原神\" 文件夹", "gameFolderSet": "选择 \"原神\" 文件夹",
"grasscutterFileSet": "选择 \"Grasscutter\" .jar 文件", "grasscutterFileSet": "选择 \"Grasscutter\" .jar 文件",
"folderNotSet": "没有设置原神文件夹或Grasscutter文件", "folderNotSet": "没有设置原神文件夹或Grasscutter文件",
@ -34,6 +34,6 @@
"proxyInstallBtn": "安装", "proxyInstallBtn": "安装",
"proxyInstallDeny": "不用了,谢谢", "proxyInstallDeny": "不用了,谢谢",
"genshinFolderDialog": "选择原神文件夹", "gameFolderDialog": "选择原神文件夹",
"grasscutterFileDialog": "选择Grasscutter服务器jar文件" "grasscutterFileDialog": "选择Grasscutter服务器jar文件"
} }

View File

@ -6,7 +6,7 @@
## ##
# #
# Genshin Impact script for mitmproxy # Anime game script for mitmproxy
# #
# https://github.com/MlgmXyysd/ # https://github.com/MlgmXyysd/
# #
@ -24,7 +24,7 @@ import string
from mitmproxy import ctx from mitmproxy import ctx
from mitmproxy import http from mitmproxy import http
class MlgmXyysd_Genshin_Impact_Proxy: class MlgmXyysd_Anime_Game_Proxy:
def load(self, loader): def load(self, loader):
loader.add_option( loader.add_option(
@ -77,5 +77,5 @@ class MlgmXyysd_Genshin_Impact_Proxy:
flow.request.host = REMOTE_HOST flow.request.host = REMOTE_HOST
addons = [ addons = [
MlgmXyysd_Genshin_Impact_Proxy() MlgmXyysd_Anime_Game_Proxy()
] ]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -117,8 +117,8 @@
<div id="bottomBar"> <div id="bottomBar">
<div class="bottomSection"> <div class="bottomSection">
<div> <div>
<button class="smolBtn" onclick="setGenshinImpactFolder()" id="genshinFolderSet">Set "Genshin Impact Game" folder</button> <button class="smolBtn" onclick="setGameFolder()" id="gameFolderSet">Set game folder</button>
<span id="genshinPath" style="margin-top: 4px;"></span> <span id="gamePath" style="margin-top: 4px;"></span>
</div> </div>
<div style="display: none;"> <div style="display: none;">
<button class="smolBtn" onclick="setGrasscutterFolder()" id="grasscutterFileSet">Set "Grasscutter" .jar file</button> <button class="smolBtn" onclick="setGrasscutterFolder()" id="grasscutterFileSet">Set "Grasscutter" .jar file</button>

View File

@ -5,7 +5,7 @@
*/ */
async function getCfg() { async function getCfg() {
const defaultConf = { const defaultConf = {
genshinImpactFolder: '', gamefolder: '',
serverFolder: '', serverFolder: '',
lastConnect: '', lastConnect: '',
enableKillswitch: false, enableKillswitch: false,
@ -61,15 +61,15 @@ async function proxyIsInstalled() {
* *
* @returns {Promise<String>} * @returns {Promise<String>}
*/ */
async function getGenshinExecName() { async function getGameExecName() {
// Scan genshin dir // Scan game dir
const config = await getCfg() const config = await getCfg()
const genshinDir = await filesystem.readDirectory(config.genshinImpactFolder) const gameDir = await filesystem.readDirectory(config.gamefolder)
// Find the executable // 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
} }
/** /**

View File

@ -33,9 +33,9 @@ async function enableButtons() {
/** /**
* Disable buttons when the game folder is not set * Disable buttons when the game folder is not set
*/ */
async function handleGenshinFolderNotSet() { async function handleGameNotSet() {
// Set buttons to greyed out and disable // 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 // Set official server background to default
document.querySelector('#firstPanel').style.backgroundImage = `url("../bg/private/default.png")` 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 * Show the game folder under the select button
*/ */
async function displayGenshinFolder() { async function displayGameFolder() {
const elm = document.querySelector('#genshinPath') const elm = document.querySelector('#gamePath')
const config = await getCfg() 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') await filesystem.createDirectory(NL_CWD + '/resources/bg/official')
} }
if (config.genshinImpactFolder) { if (config.gamefolder) {
// See if bg folder exists in parent dir // 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')) { 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) { if (officialImages.length > 0) {
for (const bg of officialImages) { 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 // See if the file exists already
const currentBgs = (await filesystem.readDirectory(NL_CWD + '/resources/bg/official/')).filter(file => file.type === 'FILE') 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' settings.style.display = 'none'
// In case we installed the proxy server // In case we installed the proxy server
if (await proxyIsInstalled() && config.genshinImpactFolder) { if (await proxyIsInstalled() && config.gamefolder) {
const playPriv = document.querySelector('#playPrivate') const playPriv = document.querySelector('#playPrivate')
playPriv.classList.remove('disabled') playPriv.classList.remove('disabled')
@ -314,8 +314,8 @@ async function displayServerLaunchSection() {
/** /**
* Set the game folder by opening a folder picker * Set the game folder by opening a folder picker
*/ */
async function setGenshinImpactFolder() { async function setGameFolder() {
const folder = await Neutralino.os.showFolderDialog(localeObj.genshinFolderDialog) const folder = await Neutralino.os.showFolderDialog(localeObj.gameFolderDialog)
// Set the folder in our configuration // Set the folder in our configuration
const config = await getCfg() const config = await getCfg()
@ -325,17 +325,17 @@ async function setGenshinImpactFolder() {
const gameFolder = folderList.filter(file => file.entry.includes('Genshin Impact Game')) const gameFolder = folderList.filter(file => file.entry.includes('Genshin Impact Game'))
if (gameFolder.length > 0) { if (gameFolder.length > 0) {
config.genshinImpactFolder = folder + '\\Genshin Impact Game' config.gamefolder = folder + '\\Genshin Impact Game'
Neutralino.storage.setData('config', JSON.stringify(config)) Neutralino.storage.setData('config', JSON.stringify(config))
} else { } else {
config.genshinImpactFolder = folder config.gamefolder = folder
} }
Neutralino.storage.setData('config', JSON.stringify(config)) Neutralino.storage.setData('config', JSON.stringify(config))
// Refresh background and path // Refresh background and path
setBackgroundImage() setBackgroundImage()
displayGenshinFolder() displayGameFolder()
enableButtons() enableButtons()
} }
@ -362,7 +362,7 @@ async function setGrasscutterFolder() {
async function launchOfficial() { async function launchOfficial() {
const config = await getCfg() 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)) Neutralino.storage.setData('config', JSON.stringify(config))
// Pass IP and game folder to the private server launcher // 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() { async function launchLocalServer() {

View File

@ -5,7 +5,7 @@
*/ */
document.addEventListener('DOMContentLoaded', async () => { document.addEventListener('DOMContentLoaded', async () => {
setBackgroundImage(); setBackgroundImage();
displayGenshinFolder(); displayGameFolder();
displayServerFolder(); displayServerFolder();
// Set title version // Set title version
@ -68,8 +68,8 @@
// Ensure we do the translation at the very end, after everything else has loaded // Ensure we do the translation at the very end, after everything else has loaded
await doTranslation() await doTranslation()
if (!config.genshinImpactFolder) { if (!config.gamefolder) {
handleGenshinFolderNotSet() handleGameNotSet()
} }
if (!config.serverFolder) { if (!config.serverFolder) {

View File

@ -32,7 +32,7 @@ async function doTranslation() {
set('serverLaunch', localeObj.launchLocalServer) set('serverLaunch', localeObj.launchLocalServer)
// File select buttons // File select buttons
set('genshinFolderSet', localeObj.genshinFolderSet) set('gameFolderSet', localeObj.gameFolderSet)
set('grasscutterFileSet', localeObj.grasscutterFileSet) set('grasscutterFileSet', localeObj.grasscutterFileSet)
// Private options // Private options

View File

@ -304,7 +304,7 @@ body {
height: 10%; height: 10%;
} }
#genshinPath, #serverPath { #gamePath, #serverPath {
color: white; color: white;
font-size: 14px; font-size: 14px;
} }