mirror of
https://github.com/Gabi-Zar/Silk-Fly-Launcher.git
synced 2026-04-17 05:26:04 +02:00
Add the possibility to launch to game with or without bepinex and the ability to backup bepinex and restore this backup
This commit is contained in:
@@ -77,8 +77,10 @@ async function navigate(page) {
|
||||
}
|
||||
}
|
||||
|
||||
function launch(mode) {
|
||||
async function launch(mode) {
|
||||
alert(`Launching the game in ${mode} mode.`);
|
||||
await electronAPI.launchGame(mode);
|
||||
setBepinexVersion()
|
||||
}
|
||||
|
||||
async function autoDetectGamePath() {
|
||||
@@ -128,11 +130,31 @@ async function uninstallBepinex() {
|
||||
setBepinexVersion()
|
||||
}
|
||||
|
||||
async function backupBepinex() {
|
||||
await bepinex.backup()
|
||||
setBepinexVersion()
|
||||
}
|
||||
|
||||
async function deleteBepinexBackup() {
|
||||
await bepinex.deleteBackup()
|
||||
setBepinexVersion()
|
||||
}
|
||||
|
||||
async function setBepinexVersion() {
|
||||
const bepinexVersion = await files.loadBepinexVersion()
|
||||
const bepinexVersionText = document.getElementById("bepinex-version-text")
|
||||
if (bepinexVersionText == undefined) {
|
||||
return
|
||||
}
|
||||
|
||||
const bepinexVersion = await files.loadBepinexVersion()
|
||||
const bepinexBackupVersion = await files.loadBepinexBackupVersion()
|
||||
if(bepinexVersion == undefined) {
|
||||
if(bepinexBackupVersion == undefined) {
|
||||
bepinexVersionText.innerText = "BepInEx is not installed"
|
||||
}
|
||||
else {
|
||||
bepinexVersionText.innerText = `BepInEx ${bepinexBackupVersion} is backuped`
|
||||
}
|
||||
}
|
||||
else {
|
||||
bepinexVersionText.innerText = `BepInEx ${bepinexVersion} is installed`
|
||||
|
||||
Reference in New Issue
Block a user