automatically find game folder when launcher folder is selected

This commit is contained in:
SpikeHD 2022-04-21 19:58:51 -07:00
parent 8e6d29df62
commit 2ff8c4ec38

View File

@ -366,7 +366,17 @@ async function setGenshinImpactFolder() {
// Set the folder in our configuration // Set the folder in our configuration
const config = await getCfg() const config = await getCfg()
// See if the actual game folder is inside this one
const folderList = await Neutralino.filesystem.readDirectory(folder)
const gameFolder = folderList.filter(file => file.entry.includes('Genshin Impact Game'))
if (gameFolder.length > 0) {
config.genshinImpactFolder = folder + '\\Genshin Impact Game'
Neutralino.storage.setData('config', JSON.stringify(config))
} else {
config.genshinImpactFolder = folder config.genshinImpactFolder = folder
}
Neutralino.storage.setData('config', JSON.stringify(config)) Neutralino.storage.setData('config', JSON.stringify(config))
// Refresh background and path // Refresh background and path