added autodelete WDB option

This commit is contained in:
aomizu
2025-06-21 09:40:34 +09:00
parent 2abe296278
commit b2f92a8774
5 changed files with 32 additions and 1 deletions

View File

@@ -19,6 +19,7 @@ import (
var EnableMetalHud = true // Default to enabled
var CustomEnvVars = "" // Custom environment variables
var EnableVanillaTweaks = false // Default to disabled
var AutoDeleteWdb = false // Default to disabled
// Terminal state management
var (
@@ -177,6 +178,22 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
return
}
// Auto-delete WDB directory if enabled
if AutoDeleteWdb {
wdbPath := filepath.Join(paths.TurtlewowPath, "WDB")
if utils.DirExists(wdbPath) {
debug.Printf("Auto-deleting WDB directory: %s", wdbPath)
if err := os.RemoveAll(wdbPath); err != nil {
debug.Printf("Warning: failed to auto-delete WDB directory: %v", err)
// Don't block the launch, just log the error
} else {
debug.Printf("Successfully auto-deleted WDB directory")
}
} else {
debug.Printf("WDB directory not found, nothing to delete")
}
}
// Since RosettaX87 service is already running, we can directly launch WoW
debug.Println("RosettaX87 service is running. Proceeding to launch WoW.")