Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions MeoAsstMac/Model/MAACopilot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ struct MAACopilot: Codable, Equatable {
let groups: [Group]?
let minimum_required: String
let doc: Documentation?
let difficulty: Int?

// MARK: SSS

Expand All @@ -37,6 +38,10 @@ struct MAACopilot: Codable, Equatable {
let details: String?
let details_color: String?
}

var isRaid: Bool {
difficulty == 2
}
}

extension MAACopilot.Operator: CustomStringConvertible {
Expand Down
11 changes: 9 additions & 2 deletions MeoAsstMac/Model/MAAViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ import SwiftUI
}

@Published var copilot: CopilotConfiguration?
@Published var copilotFormation = false
@Published var copilotAddTrust = false
@Published var useCopilotSet = false
@Published var copilotSetEntries = [CopilotSetTaskEntry]()
@Published var downloadCopilot: String?
@Published var downloadCopilotSet: String?
@Published var showImportCopilot = false
@Published var copilotDetailMode: CopilotDetailMode = .log

Expand Down Expand Up @@ -518,15 +523,17 @@ extension MAAViewModel {
defer { handleEarlyReturn(backTo: .idle) }

guard let copilot,
let params = copilot.params
let params = copilot
.applyingCommonOptions(formation: copilotFormation, addTrust: copilotAddTrust)
.params
else {
return
}

try await ensureHandle()

switch copilot {
case .regular:
case .regular, .regularList:
_ = try await handle?.appendTask(type: .Copilot, params: params)
case .sss:
_ = try await handle?.appendTask(type: .SSSCopilot, params: params)
Expand Down
Loading