Skip to content

Commit 1a46983

Browse files
committed
registered new settings keys, small fixes to 'what's new page'
1 parent fbdc4fc commit 1a46983

File tree

5 files changed

+44
-29
lines changed

5 files changed

+44
-29
lines changed

CubeTime.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@
697697
"$(PROJECT_DIR)/CubeTime/3rdparty/j2objc/lib",
698698
);
699699
LLVM_LTO = YES_THIN;
700-
MARKETING_VERSION = 1.0.8;
700+
MARKETING_VERSION = 1.1.0;
701701
OTHER_LDFLAGS = (
702702
"-ltnoodle",
703703
"-ljre_core",
@@ -754,7 +754,7 @@
754754
"$(PROJECT_DIR)/CubeTime/3rdparty/j2objc/lib",
755755
);
756756
LLVM_LTO = YES_THIN;
757-
MARKETING_VERSION = 1.0.8;
757+
MARKETING_VERSION = 1.1.0;
758758
OTHER_LDFLAGS = (
759759
"-ltnoodle",
760760
"-ljre_core",

CubeTime/CubeTimeApp.swift

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,26 @@ struct CubeTime: App {
2727
let userDefaults = UserDefaults.standard
2828
userDefaults.register(
2929
defaults: [
30+
// timer settings
3031
gsKeys.inspection.rawValue: false,
32+
gsKeys.inspectionCountsDown.rawValue: false,
3133
gsKeys.freeze.rawValue: 0.5,
32-
gsKeys.gestureDistance.rawValue: 50,
33-
gsKeys.hapBool.rawValue: true,
34-
gsKeys.hapType.rawValue: UIImpactFeedbackGenerator.FeedbackStyle.rigid.rawValue,
3534
gsKeys.timeDpWhenRunning.rawValue: 3,
36-
gsKeys.displayDP.rawValue: 3,
37-
gsKeys.showStats.rawValue: true,
35+
36+
// timer tools
3837
gsKeys.showScramble.rawValue: true,
38+
gsKeys.showStats.rawValue: true,
39+
40+
// accessibility
41+
gsKeys.hapBool.rawValue: true,
42+
gsKeys.hapType.rawValue: UIImpactFeedbackGenerator.FeedbackStyle.rigid.rawValue,
3943
gsKeys.scrambleSize.rawValue: 18,
44+
gsKeys.gestureDistance.rawValue: 50,
45+
46+
// statistics
47+
gsKeys.displayDP.rawValue: 3,
48+
49+
// colours
4050
asKeys.graphGlow.rawValue: true
4151
]
4252
)

CubeTime/Settings/AppearanceSettings.swift

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,25 @@ enum asKeys: String {
1616
struct AppearanceSettingsView: View {
1717
@Environment(\.colorScheme) var colourScheme
1818

19-
@AppStorage(asKeys.accentColour.rawValue) private var accentColour: Color = .indigo
19+
@State var showThemeOptions: Bool = false
2020

21-
// @State private var accentColour: Color = .indigo
2221
let accentColours: [Color] = [.cyan, .blue, .indigo, .purple, .red]
2322

24-
@State var showThemeOptions: Bool = false
25-
2623
private let columns = [GridItem(spacing: 16), GridItem(spacing: 16)]
2724

25+
// colours
26+
@AppStorage(asKeys.accentColour.rawValue) private var accentColour: Color = .indigo
27+
@AppStorage(asKeys.staticGradient.rawValue) private var staticGradient: Bool = true
28+
@AppStorage(asKeys.gradientSelected.rawValue) private var gradientSelected: Int = 6
29+
@AppStorage(asKeys.graphGlow.rawValue) private var graphGlow: Bool = true
30+
31+
// system settings (appearance)
2832
@AppStorage(asKeys.overrideDM.rawValue) private var overrideSystemAppearance: Bool = false
2933
@AppStorage(asKeys.dmBool.rawValue) private var darkMode: Bool = false
3034

31-
@AppStorage(asKeys.staticGradient.rawValue) private var staticGradient: Bool = true
32-
@AppStorage(asKeys.gradientSelected.rawValue) private var gradientSelected: Int = 6
3335

34-
@AppStorage(asKeys.graphGlow.rawValue) private var graphGlow: Bool = true
36+
37+
3538

3639

3740
var body: some View {

CubeTime/Settings/GeneralSettings.swift

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,28 @@ extension UIImpactFeedbackGenerator.FeedbackStyle: CaseIterable {
1111
}
1212

1313
struct GeneralSettingsView: View {
14-
14+
// timer settings
1515
@AppStorage(gsKeys.inspection.rawValue) private var inspectionTime: Bool = false
16+
@AppStorage(gsKeys.inspectionCountsDown.rawValue) private var insCountDown: Bool = false
1617
@AppStorage(gsKeys.freeze.rawValue) private var holdDownTime: Double = 0.5
1718
@AppStorage(gsKeys.timeDpWhenRunning.rawValue) private var timerDP: Int = 3
18-
@AppStorage(gsKeys.hapBool.rawValue) private var hapticFeedback: Bool = true
19-
@AppStorage(gsKeys.hapType.rawValue) private var feedbackType: UIImpactFeedbackGenerator.FeedbackStyle = .rigid
20-
@AppStorage(gsKeys.gestureDistance.rawValue) private var gestureActivationDistance: Double = 50
21-
@AppStorage(gsKeys.displayDP.rawValue) private var displayDP: Int = 3
2219

20+
// timer tools
2321
@AppStorage(gsKeys.showScramble.rawValue) private var showScramble: Bool = true
2422
@AppStorage(gsKeys.showStats.rawValue) private var showStats: Bool = true
2523

24+
// accessibility
25+
@AppStorage(gsKeys.hapBool.rawValue) private var hapticFeedback: Bool = true
26+
@AppStorage(gsKeys.hapType.rawValue) private var feedbackType: UIImpactFeedbackGenerator.FeedbackStyle = .rigid
2627
@AppStorage(gsKeys.scrambleSize.rawValue) private var scrambleSize: Int = 18
27-
@AppStorage(gsKeys.inspectionCountsDown.rawValue) private var insCountDown: Bool = false
28+
@AppStorage(gsKeys.gestureDistance.rawValue) private var gestureActivationDistance: Double = 50
29+
30+
// statistics
31+
@AppStorage(gsKeys.displayDP.rawValue) private var displayDP: Int = 3
32+
33+
34+
@Environment(\.colorScheme) var colourScheme
35+
@EnvironmentObject var stopWatchManager: StopWatchManager
2836

2937
@AppStorage(asKeys.accentColour.rawValue) private var accentColour: Color = .indigo
3038

@@ -36,15 +44,6 @@ struct GeneralSettingsView: View {
3644
UIImpactFeedbackGenerator.FeedbackStyle.rigid: "Rigid"
3745
]
3846

39-
@Environment(\.colorScheme) var colourScheme
40-
41-
@EnvironmentObject var stopWatchManager: StopWatchManager
42-
43-
44-
// im thinking of using these interval modes: seconds, 0.1s, 0.001, your refresh rate
45-
// and for haptics just .light, .medium, .heavy, .rigid, .soft
46-
// and we need to have a clear to defaults option or something
47-
4847
var body: some View {
4948
VStack(spacing: 16) {
5049
VStack {

CubeTime/Updates.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import SwiftUI
1010
struct Updates: View {
1111
@Environment(\.colorScheme) var colourScheme
1212
@Environment(\.dismiss) var dismiss
13+
14+
@AppStorage(asKeys.accentColour.rawValue) private var accentColour: Color = .indigo
1315
@Binding var showUpdates: Bool
1416

1517
var body: some View {
@@ -91,6 +93,7 @@ struct Updates: View {
9193
.padding([.top, .trailing])
9294
}
9395
}
96+
9497
Spacer()
9598
}
9699
}

0 commit comments

Comments
 (0)