From 488d10cb8b8b3fcc7e32c913057c2ee2020c9100 Mon Sep 17 00:00:00 2001 From: aomizu Date: Sun, 13 Jul 2025 09:08:30 +0900 Subject: [PATCH] fixed metal hud preference resetting to default --- FyneApp.toml | 2 +- pkg/launcher/launcher.go | 2 +- pkg/ui/components.go | 7 ++++++- pkg/utils/prefs.go | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/FyneApp.toml b/FyneApp.toml index 43dfda0..d902d0e 100644 --- a/FyneApp.toml +++ b/FyneApp.toml @@ -3,4 +3,4 @@ Name = "TurtleSilicon" ID = "com.tairasu.turtlesilicon" Version = "1.2.4" - Build = 77 + Build = 78 diff --git a/pkg/launcher/launcher.go b/pkg/launcher/launcher.go index 49de93b..ccf0a5c 100644 --- a/pkg/launcher/launcher.go +++ b/pkg/launcher/launcher.go @@ -16,7 +16,7 @@ import ( "fyne.io/fyne/v2/dialog" ) -var EnableMetalHud = true // Default to enabled +var EnableMetalHud = false // Default to disabled var CustomEnvVars = "" // Custom environment variables var EnableVanillaTweaks = false // Default to disabled var AutoDeleteWdb = false // Default to disabled diff --git a/pkg/ui/components.go b/pkg/ui/components.go index 293ce22..2bc6be3 100644 --- a/pkg/ui/components.go +++ b/pkg/ui/components.go @@ -25,9 +25,14 @@ func createOptionsComponents() { metalHudCheckbox = widget.NewCheck("Enable Metal Hud (show FPS)", func(checked bool) { launcher.EnableMetalHud = checked + // Save to preferences + prefs, _ := utils.LoadPrefs() + prefs.EnableMetalHud = checked + utils.SavePrefs(prefs) debug.Printf("Metal HUD enabled: %v", launcher.EnableMetalHud) }) - metalHudCheckbox.SetChecked(launcher.EnableMetalHud) + metalHudCheckbox.SetChecked(prefs.EnableMetalHud) + launcher.EnableMetalHud = prefs.EnableMetalHud showTerminalCheckbox = widget.NewCheck("Show Terminal", func(checked bool) { // Save to preferences diff --git a/pkg/utils/prefs.go b/pkg/utils/prefs.go index 3dde2cb..69b2bc1 100644 --- a/pkg/utils/prefs.go +++ b/pkg/utils/prefs.go @@ -16,6 +16,7 @@ type UserPrefs struct { EnableVanillaTweaks bool `json:"enable_vanilla_tweaks"` RemapOptionAsAlt bool `json:"remap_option_as_alt"` AutoDeleteWdb bool `json:"auto_delete_wdb"` + EnableMetalHud bool `json:"enable_metal_hud"` // Graphics settings ReduceTerrainDistance bool `json:"reduce_terrain_distance"`