added autodelete WDB option
This commit is contained in:
@@ -49,6 +49,17 @@ func createOptionsComponents() {
|
||||
vanillaTweaksCheckbox.SetChecked(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
|
||||
applyRecommendedSettingsButton = widget.NewButton("Apply recommended settings", func() {
|
||||
err := launcher.ApplyRecommendedSettings()
|
||||
|
@@ -35,6 +35,7 @@ func showOptionsPopup() {
|
||||
metalHudCheckbox,
|
||||
showTerminalCheckbox,
|
||||
vanillaTweaksCheckbox,
|
||||
autoDeleteWdbCheckbox,
|
||||
widget.NewSeparator(),
|
||||
container.NewBorder(nil, nil, recommendedSettingsLabel, container.NewHBox(applyRecommendedSettingsButton, recommendedSettingsHelpButton), nil),
|
||||
widget.NewSeparator(),
|
||||
@@ -74,7 +75,7 @@ func showOptionsPopup() {
|
||||
// Get the window size and calculate 2/3 size
|
||||
windowSize := currentWindow.Content().Size()
|
||||
popupWidth := windowSize.Width * 5 / 6
|
||||
popupHeight := windowSize.Height * 5 / 6
|
||||
popupHeight := windowSize.Height * 9 / 10
|
||||
|
||||
// Create a modal popup
|
||||
popup := widget.NewModalPopUp(popupContent, currentWindow.Canvas())
|
||||
|
@@ -31,6 +31,7 @@ var (
|
||||
metalHudCheckbox *widget.Check
|
||||
showTerminalCheckbox *widget.Check
|
||||
vanillaTweaksCheckbox *widget.Check
|
||||
autoDeleteWdbCheckbox *widget.Check
|
||||
|
||||
// Recommended settings button
|
||||
applyRecommendedSettingsButton *widget.Button
|
||||
|
Reference in New Issue
Block a user