open game and grasscutter folders from launcher

This commit is contained in:
SpikeHD 2022-04-26 02:12:58 -07:00
parent 1ecb69af38
commit 2ab0fb75f9
3 changed files with 17 additions and 3 deletions

View File

@ -130,14 +130,14 @@
<div>
<div>
<button class="smolBtn" onclick="setGameExe()" id="gameExeSet">Set game folder</button>
<img src="icons/folder.svg" class="openFolderIcon" id="openGameFolder()"/>
<img src="icons/folder.svg" class="openFolderIcon" onclick="openGameFolder()"/>
</div>
<span id="gamePath" style="margin-top: 4px;"></span>
</div>
<div style="display: none;">
<div>
<button class="smolBtn" onclick="setGrasscutterFolder()" id="grasscutterFileSet">Set "Grasscutter" .jar file</button>
<img src="icons/folder.svg" class="openFolderIcon" id="openGrasscutterFolder()"/>
<img src="icons/folder.svg" class="openFolderIcon" onclick="openGrasscutterFolder()"/>
</div>
<span id="serverPath" style="margin-top: 4px;"></span>
</div>

View File

@ -57,6 +57,20 @@ async function proxyIsInstalled() {
return false
}
async function openGameFolder() {
const config = await getCfg()
const folder = config.gameexe.match(/.*\\/g, '')[0]
createCmdWindow(`explorer.exe "${folder}"`)
}
async function openGrasscutterFolder() {
const config = await getCfg()
const folder = config.serverFolder.match(/.*\\/g, '')[0]
createCmdWindow(`explorer.exe "${folder}"`)
}
/**
* Minimize the window
*/

View File

@ -366,7 +366,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()