mirror of
https://github.com/Grasscutters/GrassClipper.git
synced 2024-11-16 04:45:34 +00:00
open game and grasscutter folders from launcher
This commit is contained in:
parent
1ecb69af38
commit
2ab0fb75f9
@ -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>
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user