aboutsummaryrefslogtreecommitdiff
path: root/Map/Data/UserPreferences.swift
diff options
context:
space:
mode:
authorRuben Beltran del Rio <git@r.bdr.sh>2025-07-11 09:27:49 +0200
committerRuben Beltran del Rio <git@r.bdr.sh>2025-07-11 09:27:49 +0200
commit8564439356f4bcc3e21b19738eb87b4c0722c623 (patch)
tree1465f4e48be83d255e5c68de804ba940db238bea /Map/Data/UserPreferences.swift
parentff3619fdf3fce82d95124654a18b66ca3ed380cd (diff)
Add missing vertex detection
Diffstat (limited to 'Map/Data/UserPreferences.swift')
-rw-r--r--Map/Data/UserPreferences.swift14
1 files changed, 13 insertions, 1 deletions
diff --git a/Map/Data/UserPreferences.swift b/Map/Data/UserPreferences.swift
index 12f83c5..56582e3 100644
--- a/Map/Data/UserPreferences.swift
+++ b/Map/Data/UserPreferences.swift
@@ -30,6 +30,7 @@ struct UserPreferencesJSON: Codable {
var customEditorFontName: String?
var editorFontSize: Double?
var softWrapLines: Bool?
+ var highlightMissingComponents: Bool?
// MARK: - Templates (as actual objects)
var mapTemplates: [Template]?
@@ -57,6 +58,7 @@ struct UserPreferences: Codable {
var customEditorFontName: String
var editorFontSize: Double
var softWrapLines: Bool
+ var highlightMissingComponents: Bool
// MARK: - Templates
var mapTemplates: Data
@@ -76,11 +78,12 @@ struct UserPreferences: Codable {
static let defaultExportFormat = "png"
static let useSmartLabelPositioning = true
- static let useSmartEditor = false
+ static let useSmartEditor = true
static let useCustomEditorFont = false
static let customEditorFontName = "Menlo"
static let editorFontSize = 14.0
static let softWrapLines = false
+ static let highlightMissingComponents = true
static let viewStyle = "horizontal"
static let zoom = 1.0
@@ -123,6 +126,7 @@ struct UserPreferences: Codable {
self.customEditorFontName = Defaults.customEditorFontName
self.editorFontSize = Defaults.editorFontSize
self.softWrapLines = Defaults.softWrapLines
+ self.highlightMissingComponents = Defaults.highlightMissingComponents
self.mapTemplates = Defaults.mapTemplates
self.customStages = Defaults.customStages
@@ -149,6 +153,7 @@ struct UserPreferences: Codable {
customEditorFontName: customEditorFontName,
editorFontSize: editorFontSize,
softWrapLines: softWrapLines,
+ highlightMissingComponents: highlightMissingComponents,
mapTemplates: templatesFromData(mapTemplates),
customStages: stagesFromData(customStages),
viewStyle: viewStyle,
@@ -200,6 +205,9 @@ struct UserPreferences: Codable {
if let value = jsonPrefs.softWrapLines {
self.softWrapLines = value
}
+ if let value = jsonPrefs.highlightMissingComponents {
+ self.highlightMissingComponents = value
+ }
if let value = jsonPrefs.mapTemplates {
self.mapTemplates = dataFromTemplates(value)
}
@@ -273,6 +281,7 @@ struct UserPreferences: Codable {
defaults.set(customEditorFontName, forKey: "customEditorFontName")
defaults.set(editorFontSize, forKey: "editorFontSize")
defaults.set(softWrapLines, forKey: "softWrapLines")
+ defaults.set(highlightMissingComponents, forKey: "highlightMissingComponents")
// Templates
defaults.set(mapTemplates, forKey: "mapTemplates")
@@ -315,6 +324,9 @@ struct UserPreferences: Codable {
defaults.object(forKey: "editorFontSize") as? Double ?? Defaults.editorFontSize
preferences.softWrapLines =
defaults.object(forKey: "softWrapLines") as? Bool ?? Defaults.softWrapLines
+ preferences.highlightMissingComponents =
+ defaults.object(forKey: "highlightMissingComponents") as? Bool
+ ?? Defaults.highlightMissingComponents
// Templates
preferences.mapTemplates =