Skip to content

Commit

Permalink
Todo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vapidinfinity committed Feb 12, 2024
1 parent da35104 commit a8f9f47
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 26 deletions.
12 changes: 10 additions & 2 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@
6A0BB7AE2B52029000C8A693 /* Views */ = {
isa = PBXGroup;
children = (
6ABA8DAF2B791B0600D446CF /* Sheets */,
6A00F20A2AC5F8730054858A /* Auth.swift */,
6AF7214C2B4C53F700AFD8F2 /* SearchBar.swift */,
);
path = Views;
Expand Down Expand Up @@ -416,6 +418,14 @@
path = Views;
sourceTree = "<group>";
};
6ABA8DAF2B791B0600D446CF /* Sheets */ = {
isa = PBXGroup;
children = (
6A371B502AE7A4870054BF7A /* Onboarding */,
);
path = Sheets;
sourceTree = "<group>";
};
6AC3E18A2B374F3C000EB765 /* Deprecated */ = {
isa = PBXGroup;
children = (
Expand Down Expand Up @@ -452,8 +462,6 @@
children = (
6A34B8F82B779EA2005B2854 /* OnboardingEvo */,
6A00F2082AC5F7DE0054858A /* ProgressView */,
6A371B502AE7A4870054BF7A /* Onboarding */,
6A00F20A2AC5F8730054858A /* Auth.swift */,
6A1322372B1C98AE0049BB64 /* InstallStatus.swift */,
6AA7413D2B67FC7400369B35 /* BottleCreation.swift */,
);
Expand Down
22 changes: 12 additions & 10 deletions Mythic/Views/GameList/GameList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ struct GameListView: View {
@State private var failedGame: Game?

@State private var isProgressViewSheetPresented: Bool = true
@State private var currentGame: Game = placeholderGame(.local) // FIXME: bad programming
@State private var currentGame: Game = placeholderGame(.local)

@State private var installableGames: [Game] = .init()
@State private var installedGames: [Game] = .init()
Expand Down Expand Up @@ -118,9 +118,9 @@ struct GameListView: View {
group.enter()
Task(priority: .userInitiated) {
let command = await Legendary.command(
args: ["install", game.appName], // force-unwraps rely on good codebase, don't fumble
args: ["install", game.appName],
useCache: true,
identifier: "parseOptionalPacks" // TODO: replace with metadata["dlcItemList"]
identifier: "parseOptionalPacks"
)

var isParsingOptionalPacks = false
Expand Down Expand Up @@ -254,7 +254,7 @@ struct GameListView: View {
updateCurrentGame(game: game, mode: .normal)

_ = try await Legendary.install(
game: game, // TODO: better update implementation; rushing to launch
game: game,
platform: try Legendary.getGamePlatform(game: game)
)

Expand Down Expand Up @@ -340,9 +340,8 @@ struct GameListView: View {
if game.type == .epic {
isUninstallViewPresented = true
} else {
var library = LocalGames.library // TODO: add support to remove game
library?.removeAll { $0 == game }
LocalGames.library = library // FIXME: possible for split second to add new and overwrite one, extremely unlikely though
var library = LocalGames.library
LocalGames.library = library?.filter { $0 != game }
isRefreshCalled = true
}
} label: {
Expand All @@ -359,8 +358,11 @@ struct GameListView: View {
.padding()
}
} else { // MARK: For games that aren't installed
// MARK: Game Installation View // FIXME: can also happen during updates and that doesnt show
if variables.getVariable("installing") == game { // TODO: Add for verificationStatus // TODO: turn this VStack into a separate view so it's the same in Main and GameList
// MARK: Game Installation View
// FIXME: can also happen during updates and that doesnt show
if variables.getVariable("installing") == game {
// TODO: Add for verificationStatus
// TODO: turn this VStack into a separate view so it's the same in Main and GameList
Button {
isInstallStatusViewPresented = true
} label: {
Expand Down Expand Up @@ -505,7 +507,7 @@ struct GameListView: View {

.alert(isPresented: $isAlertPresented) {
switch activeAlert {
case .installError: // used in other scripts, will unify (TODO: unify)
case .installError:
Alert(
title: Text("Error installing \(failedGame?.title ?? "game")."),
message: Text(installationErrorMessage)
Expand Down
2 changes: 1 addition & 1 deletion Mythic/Views/Navigation/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ struct HomeView: View {
}
.navigationTitle("Home")
.padding()
.alert(isPresented: $isAlertPresented) { // TODO: Note, add progressview for homeview play button
.alert(isPresented: $isAlertPresented) {
switch activeAlert {
case .launchError:
Alert(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ extension LibraryView {
@State private var type: GameType = .epic

// MARK: - Body
var body: some View { // TODO: split up epic and local into different view files
var body: some View {
VStack {
Text("Import a Game")
.font(.title)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ extension LibraryView.GameImportView {
}

HStack {
// TODO: turn this whole HStack into a whole separate view
VStack {
HStack { // FIXME: jank
Text("Where is the game located?")
Expand Down
2 changes: 1 addition & 1 deletion Mythic/Views/Navigation/Main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ struct MainView: View {
title: .init("Are you sure you want to sign out?"),
message: .init("This will sign you out of the account \"\(Legendary.whoAmI())\"."),
primaryButton: .destructive(.init("Sign Out")) {
Task(priority: .high) { // TODO: possible progress view implementation
Task(priority: .high) {
let command = await Legendary.command(args: ["auth", "--delete"], useCache: false, identifier: "userAreaSignOut")
if let commandStderrString = String(data: command.stderr, encoding: .utf8), commandStderrString.contains("User data deleted.") {
updateLegendaryAccountState()
Expand Down
11 changes: 3 additions & 8 deletions Mythic/Views/Navigation/Wine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,16 @@ struct WineView: View {

Form {
BottleSettingsView(selectedBottle: $selectedBottleName, withPicker: false)
// TODO: Add slider for scaling
// TODO: Add slider for winver
}
.formStyle(.grouped)

HStack {
Spacer()

Button("Launch Winetricks") {
let task = Process()
task.executableURL = Libraries.directory.appending(path: "winetricks")
task.environment = ["WINEPREFIX": bottles[selectedBottleName]!.url.path(percentEncoded: false)]
do {
try task.run()
} catch {
// TODO: implement
}
try? Wine.launchWinetricks(prefix: bottles[selectedBottleName]!.url)
}

Button("Launch Configurator") {
Expand Down
5 changes: 3 additions & 2 deletions Mythic/Views/Sheets/OnboardingEvo/OnboardingEvo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import MetalKit
import ColorfulX
import UserNotifications // TODO: TODO

struct OnboardingEvo: View { // TODO: move creation of default bottle here!!
struct OnboardingEvo: View {
init(fromChapter: Chapter = .logo) {
self.currentChapter = fromChapter
}
Expand Down Expand Up @@ -371,7 +371,8 @@ struct OnboardingEvo: View { // TODO: move creation of default bottle here!!
.offset(y: isEngineDisclaimerOffsetAnimated ? 0 : 30)

HStack {
Button(action: { // TODO: implement question mark popover
Button(
action: {
isHelpPopoverPresented.toggle()
}, label: {
Image(systemName: "questionmark.circle")
Expand Down

0 comments on commit a8f9f47

Please sign in to comment.