added user presets

This commit is contained in:
grimsace
2026-03-11 14:24:18 -05:00
parent b65bf2539f
commit 6858634807
2 changed files with 256 additions and 17 deletions
+9 -3
View File
@@ -72,9 +72,10 @@ type Settings struct {
BuildingComplexityRatio float64 `json:"building_complexity_ratio"`
// General settings
Seed int64 `json:"seed"`
LastExportPath string `json:"last_export_path"`
ImageViewState int `json:"image_view_state"`
Seed int64 `json:"seed"`
LastExportPath string `json:"last_export_path"`
ImageViewState int `json:"image_view_state"`
HiddenPresets []string `json:"hidden_presets"`
}
// Save saves the current settings to a JSON file in the user's config directory.
@@ -176,6 +177,7 @@ func LoadSettings() (*Settings, error) {
BuildingComplexityRatio: 50,
LastExportPath: homeDir,
ImageViewState: 0,
HiddenPresets: []string{},
}, nil
}
return nil, err
@@ -332,4 +334,8 @@ func normalizeSettings(settings *Settings, rawKeys map[string]json.RawMessage) {
}
settings.LastExportPath = homeDir
}
if settings.HiddenPresets == nil {
settings.HiddenPresets = []string{}
}
}