mgrPrefs // +useScoreBalancing.

This commit is contained in:
ShikiSuen 2022-05-22 09:41:11 +08:00
parent 0bcaa61656
commit 2b786b2356
1 changed files with 6 additions and 0 deletions

View File

@ -28,6 +28,7 @@ import Cocoa
struct UserDef { struct UserDef {
static let kIsDebugModeEnabled = "_DebugMode" static let kIsDebugModeEnabled = "_DebugMode"
static let kUseScoreBalancing = "UseScoreBalancing"
static let kMostRecentInputMode = "MostRecentInputMode" static let kMostRecentInputMode = "MostRecentInputMode"
static let kUserDataFolderSpecified = "UserDataFolderSpecified" static let kUserDataFolderSpecified = "UserDataFolderSpecified"
static let kCheckUpdateAutomatically = "CheckUpdateAutomatically" static let kCheckUpdateAutomatically = "CheckUpdateAutomatically"
@ -219,6 +220,7 @@ public enum mgrPrefs {
static var allKeys: [String] { static var allKeys: [String] {
[ [
UserDef.kIsDebugModeEnabled, UserDef.kIsDebugModeEnabled,
UserDef.kUseScoreBalancing,
UserDef.kMostRecentInputMode, UserDef.kMostRecentInputMode,
UserDef.kUserDataFolderSpecified, UserDef.kUserDataFolderSpecified,
UserDef.kMandarinParser, UserDef.kMandarinParser,
@ -257,6 +259,7 @@ public enum mgrPrefs {
public static func setMissingDefaults() { public static func setMissingDefaults() {
UserDefaults.standard.setDefault(mgrPrefs.isDebugModeEnabled, forKey: UserDef.kIsDebugModeEnabled) UserDefaults.standard.setDefault(mgrPrefs.isDebugModeEnabled, forKey: UserDef.kIsDebugModeEnabled)
UserDefaults.standard.setDefault(mgrPrefs.useScoreBalancing, forKey: UserDef.kUseScoreBalancing)
UserDefaults.standard.setDefault(mgrPrefs.mostRecentInputMode, forKey: UserDef.kMostRecentInputMode) UserDefaults.standard.setDefault(mgrPrefs.mostRecentInputMode, forKey: UserDef.kMostRecentInputMode)
UserDefaults.standard.setDefault(mgrPrefs.checkUpdateAutomatically, forKey: UserDef.kCheckUpdateAutomatically) UserDefaults.standard.setDefault(mgrPrefs.checkUpdateAutomatically, forKey: UserDef.kCheckUpdateAutomatically)
UserDefaults.standard.setDefault( UserDefaults.standard.setDefault(
@ -305,6 +308,9 @@ public enum mgrPrefs {
@UserDefault(key: UserDef.kIsDebugModeEnabled, defaultValue: false) @UserDefault(key: UserDef.kIsDebugModeEnabled, defaultValue: false)
static var isDebugModeEnabled: Bool static var isDebugModeEnabled: Bool
@UserDefault(key: UserDef.kUseScoreBalancing, defaultValue: false)
static var useScoreBalancing: Bool
@UserDefault(key: UserDef.kMostRecentInputMode, defaultValue: "") @UserDefault(key: UserDef.kMostRecentInputMode, defaultValue: "")
static var mostRecentInputMode: String static var mostRecentInputMode: String