Skip to content

Commit

Permalink
Add verify button to game settings (resolves #56)
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidinfinity committed May 29, 2024
1 parent 4404314 commit e180a05
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions Mythic/Views/Unified/Sheets/GameSettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct GameSettingsView: View {
@Binding var game: Game
@Binding var isPresented: Bool

@State private var operation: GameOperation = .shared
@State private var selectedBottle: String

init(game: Binding<Game>, isPresented: Binding<Bool>) {
Expand Down Expand Up @@ -170,6 +171,42 @@ struct GameSettingsView: View {
typingArgument = .init()
}
}

HStack {
VStack {
HStack {
Text("Verify File Integrity")
Spacer()
}

if operation.current?.game == game {
HStack {
if operation.status.progress != nil {
ProgressView(value: operation.status.progress?.percentage)
.controlSize(.small)
.progressViewStyle(.linear)
} else {
ProgressView()
.controlSize(.small)
.progressViewStyle(.linear)
}
Spacer()
}
}
}

Spacer()

Button("Verify") {
operation.queue.append(
GameOperation.InstallArguments(
game: game, platform: game.platform!, type: .repair
)
)
}
.disabled(operation.queue.contains(where: { $0.game == game }))
.disabled(operation.current?.game == game)
}
}

Section("File", isExpanded: $isFileSectionExpanded) {
Expand Down

0 comments on commit e180a05

Please sign in to comment.