diff --git a/MacTorn/MacTorn/Views/Components/ProgressBarView.swift b/MacTorn/MacTorn/Views/Components/ProgressBarView.swift index 6b0d4c6..06d432a 100644 --- a/MacTorn/MacTorn/Views/Components/ProgressBarView.swift +++ b/MacTorn/MacTorn/Views/Components/ProgressBarView.swift @@ -71,7 +71,7 @@ struct ProgressBarView: View { ProgressBarView(label: "Energy", current: 75, maximum: 100, color: .green, icon: "bolt.fill") ProgressBarView(label: "Nerve", current: 50, maximum: 50, color: .red, icon: "flame.fill") ProgressBarView(label: "Happy", current: 500, maximum: 1000, color: .yellow, icon: "face.smiling.fill") - ProgressBarView(label: "Life", current: 0, maximum: 100, color: .pink, icon: "heart.fill") + ProgressBarView(label: "Life", current: 0, maximum: 100, color: .blue, icon: "heart.fill") } .padding() .frame(width: 280) diff --git a/MacTorn/MacTorn/Views/SettingsView.swift b/MacTorn/MacTorn/Views/SettingsView.swift index d6e75c1..935c34e 100644 --- a/MacTorn/MacTorn/Views/SettingsView.swift +++ b/MacTorn/MacTorn/Views/SettingsView.swift @@ -27,20 +27,23 @@ struct SettingsView: View { VStack(spacing: 8) { SecureField("Torn API Key", text: $inputKey) .textFieldStyle(.roundedBorder) - + Button("Save & Connect") { appState.apiKey = inputKey.trimmingCharacters(in: .whitespacesAndNewlines) appState.refreshNow() } .buttonStyle(.borderedProminent) .disabled(inputKey.isEmpty) - + Link("Get API Key from Torn", destination: URL(string: "https://www.torn.com/preferences.php#tab=api")!) .font(.caption) } .padding(.horizontal) - + + // API ToS Compliance + apiUsageDisclosure + Divider() // Settings @@ -164,6 +167,53 @@ struct SettingsView: View { } } + // MARK: - API Usage Disclosure + private var apiUsageDisclosure: some View { + DisclosureGroup { + VStack(alignment: .leading, spacing: 8) { + ForEach(apiSelections, id: \.selection) { item in + HStack(alignment: .top) { + Text(item.selection) + .font(.caption.monospaced()) + .frame(width: 60, alignment: .leading) + .foregroundColor(.accentColor) + Text(item.purpose) + .font(.caption) + .foregroundColor(.secondary) + } + } + + Divider() + + Link("View Torn API Terms of Service", + destination: URL(string: "https://www.torn.com/api.html")!) + .font(.caption) + } + .padding(.top, 4) + } label: { + HStack(spacing: 4) { + Image(systemName: "doc.text") + .foregroundColor(.secondary) + Text("API Data Usage") + .font(.caption.bold()) + } + } + .padding(.horizontal) + } + + private var apiSelections: [(selection: String, purpose: String)] { + [ + ("basic", "Player name, ID, basic info"), + ("bars", "Energy, Nerve, Happy, Life bars"), + ("cooldowns", "Drug, Medical, Booster cooldowns"), + ("travel", "Travel status and destination"), + ("profile", "Battle stats, faction info"), + ("events", "Recent events feed"), + ("messages", "Unread message count"), + ("market", "Item watchlist prices") + ] + } + private func openTornProfile() { let url = "https://www.torn.com/profiles.php?XID=\(developerID)" if let url = URL(string: url) { diff --git a/MacTorn/MacTorn/Views/StatusView.swift b/MacTorn/MacTorn/Views/StatusView.swift index 96084b7..d43c5e9 100644 --- a/MacTorn/MacTorn/Views/StatusView.swift +++ b/MacTorn/MacTorn/Views/StatusView.swift @@ -185,7 +185,7 @@ struct StatusView: View { label: "Life", current: bars.life.current, maximum: bars.life.maximum, - color: .pink, + color: .blue, icon: "heart.fill" ) }