added autodelete WDB option
This commit is contained in:
@@ -19,6 +19,7 @@ import (
|
|||||||
var EnableMetalHud = true // Default to enabled
|
var EnableMetalHud = true // Default to enabled
|
||||||
var CustomEnvVars = "" // Custom environment variables
|
var CustomEnvVars = "" // Custom environment variables
|
||||||
var EnableVanillaTweaks = false // Default to disabled
|
var EnableVanillaTweaks = false // Default to disabled
|
||||||
|
var AutoDeleteWdb = false // Default to disabled
|
||||||
|
|
||||||
// Terminal state management
|
// Terminal state management
|
||||||
var (
|
var (
|
||||||
@@ -177,6 +178,22 @@ func continueLaunch(myWindow fyne.Window, wowExePath string) {
|
|||||||
return
|
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
|
// Since RosettaX87 service is already running, we can directly launch WoW
|
||||||
debug.Println("RosettaX87 service is running. Proceeding to launch WoW.")
|
debug.Println("RosettaX87 service is running. Proceeding to launch WoW.")
|
||||||
|
|
||||||
|
@@ -49,6 +49,17 @@ func createOptionsComponents() {
|
|||||||
vanillaTweaksCheckbox.SetChecked(prefs.EnableVanillaTweaks)
|
vanillaTweaksCheckbox.SetChecked(prefs.EnableVanillaTweaks)
|
||||||
launcher.EnableVanillaTweaks = prefs.EnableVanillaTweaks
|
launcher.EnableVanillaTweaks = prefs.EnableVanillaTweaks
|
||||||
|
|
||||||
|
autoDeleteWdbCheckbox = widget.NewCheck("Auto-delete WDB directory on launch", func(checked bool) {
|
||||||
|
launcher.AutoDeleteWdb = checked
|
||||||
|
// Save to preferences
|
||||||
|
prefs, _ := utils.LoadPrefs()
|
||||||
|
prefs.AutoDeleteWdb = checked
|
||||||
|
utils.SavePrefs(prefs)
|
||||||
|
debug.Printf("Auto-delete WDB enabled: %v", launcher.AutoDeleteWdb)
|
||||||
|
})
|
||||||
|
autoDeleteWdbCheckbox.SetChecked(prefs.AutoDeleteWdb)
|
||||||
|
launcher.AutoDeleteWdb = prefs.AutoDeleteWdb
|
||||||
|
|
||||||
// Create recommended settings button with help icon
|
// Create recommended settings button with help icon
|
||||||
applyRecommendedSettingsButton = widget.NewButton("Apply recommended settings", func() {
|
applyRecommendedSettingsButton = widget.NewButton("Apply recommended settings", func() {
|
||||||
err := launcher.ApplyRecommendedSettings()
|
err := launcher.ApplyRecommendedSettings()
|
||||||
|
@@ -35,6 +35,7 @@ func showOptionsPopup() {
|
|||||||
metalHudCheckbox,
|
metalHudCheckbox,
|
||||||
showTerminalCheckbox,
|
showTerminalCheckbox,
|
||||||
vanillaTweaksCheckbox,
|
vanillaTweaksCheckbox,
|
||||||
|
autoDeleteWdbCheckbox,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
container.NewBorder(nil, nil, recommendedSettingsLabel, container.NewHBox(applyRecommendedSettingsButton, recommendedSettingsHelpButton), nil),
|
container.NewBorder(nil, nil, recommendedSettingsLabel, container.NewHBox(applyRecommendedSettingsButton, recommendedSettingsHelpButton), nil),
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
@@ -74,7 +75,7 @@ func showOptionsPopup() {
|
|||||||
// Get the window size and calculate 2/3 size
|
// Get the window size and calculate 2/3 size
|
||||||
windowSize := currentWindow.Content().Size()
|
windowSize := currentWindow.Content().Size()
|
||||||
popupWidth := windowSize.Width * 5 / 6
|
popupWidth := windowSize.Width * 5 / 6
|
||||||
popupHeight := windowSize.Height * 5 / 6
|
popupHeight := windowSize.Height * 9 / 10
|
||||||
|
|
||||||
// Create a modal popup
|
// Create a modal popup
|
||||||
popup := widget.NewModalPopUp(popupContent, currentWindow.Canvas())
|
popup := widget.NewModalPopUp(popupContent, currentWindow.Canvas())
|
||||||
|
@@ -31,6 +31,7 @@ var (
|
|||||||
metalHudCheckbox *widget.Check
|
metalHudCheckbox *widget.Check
|
||||||
showTerminalCheckbox *widget.Check
|
showTerminalCheckbox *widget.Check
|
||||||
vanillaTweaksCheckbox *widget.Check
|
vanillaTweaksCheckbox *widget.Check
|
||||||
|
autoDeleteWdbCheckbox *widget.Check
|
||||||
|
|
||||||
// Recommended settings button
|
// Recommended settings button
|
||||||
applyRecommendedSettingsButton *widget.Button
|
applyRecommendedSettingsButton *widget.Button
|
||||||
|
@@ -15,6 +15,7 @@ type UserPrefs struct {
|
|||||||
ShowTerminalNormally bool `json:"show_terminal_normally"`
|
ShowTerminalNormally bool `json:"show_terminal_normally"`
|
||||||
EnableVanillaTweaks bool `json:"enable_vanilla_tweaks"`
|
EnableVanillaTweaks bool `json:"enable_vanilla_tweaks"`
|
||||||
RemapOptionAsAlt bool `json:"remap_option_as_alt"`
|
RemapOptionAsAlt bool `json:"remap_option_as_alt"`
|
||||||
|
AutoDeleteWdb bool `json:"auto_delete_wdb"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func getPrefsPath() (string, error) {
|
func getPrefsPath() (string, error) {
|
||||||
|
Reference in New Issue
Block a user