added user presets
This commit is contained in:
+9
-3
@@ -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{}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user