fixed metal hud preference resetting to default
Some checks failed
Build Go/Fyne App for macOS ARM64 / build (push) Has been cancelled

This commit is contained in:
aomizu
2025-07-13 09:08:30 +09:00
parent 58ad8b7cd3
commit 488d10cb8b
4 changed files with 9 additions and 3 deletions

View File

@@ -3,4 +3,4 @@
Name = "TurtleSilicon" Name = "TurtleSilicon"
ID = "com.tairasu.turtlesilicon" ID = "com.tairasu.turtlesilicon"
Version = "1.2.4" Version = "1.2.4"
Build = 77 Build = 78

View File

@@ -16,7 +16,7 @@ import (
"fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/dialog"
) )
var EnableMetalHud = true // Default to enabled var EnableMetalHud = false // Default to disabled
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 var AutoDeleteWdb = false // Default to disabled

View File

@@ -25,9 +25,14 @@ func createOptionsComponents() {
metalHudCheckbox = widget.NewCheck("Enable Metal Hud (show FPS)", func(checked bool) { metalHudCheckbox = widget.NewCheck("Enable Metal Hud (show FPS)", func(checked bool) {
launcher.EnableMetalHud = checked launcher.EnableMetalHud = checked
// Save to preferences
prefs, _ := utils.LoadPrefs()
prefs.EnableMetalHud = checked
utils.SavePrefs(prefs)
debug.Printf("Metal HUD enabled: %v", launcher.EnableMetalHud) 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) { showTerminalCheckbox = widget.NewCheck("Show Terminal", func(checked bool) {
// Save to preferences // Save to preferences

View File

@@ -16,6 +16,7 @@ type UserPrefs struct {
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"` AutoDeleteWdb bool `json:"auto_delete_wdb"`
EnableMetalHud bool `json:"enable_metal_hud"`
// Graphics settings // Graphics settings
ReduceTerrainDistance bool `json:"reduce_terrain_distance"` ReduceTerrainDistance bool `json:"reduce_terrain_distance"`