Skip to content

Commit

Permalink
feat: prototype of new "hub" style launcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaBrest committed Nov 15, 2024
1 parent c53f541 commit e8f32ec
Show file tree
Hide file tree
Showing 19 changed files with 664 additions and 53 deletions.
88 changes: 63 additions & 25 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@
6A1EF00C2CE3A62B00C1F652 /* _sha2.cpython-313-darwin.so in Resources */ = {isa = PBXBuildFile; fileRef = 6A1EEFBC2CE3A62B00C1F652 /* _sha2.cpython-313-darwin.so */; };
6A1EF00D2CE3A62B00C1F652 /* mmap.cpython-313-darwin.so in Resources */ = {isa = PBXBuildFile; fileRef = 6A1EEFC82CE3A62B00C1F652 /* mmap.cpython-313-darwin.so */; };
6A1EF00E2CE3A62B00C1F652 /* _heapq.cpython-313-darwin.so in Resources */ = {isa = PBXBuildFile; fileRef = 6A1EEFAE2CE3A62B00C1F652 /* _heapq.cpython-313-darwin.so */; };
6A1EF00F2CE3A62B00C1F652 /* Python.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1EEFD42CE3A62B00C1F652 /* Python.framework */; };
6A1EF0102CE3A62B00C1F652 /* libcrypto.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1EEFD12CE3A62B00C1F652 /* libcrypto.3.dylib */; };
6A1EF0112CE3A62B00C1F652 /* Python in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1EEFD32CE3A62B00C1F652 /* Python */; };
6A1EF0122CE3A62B00C1F652 /* libssl.3.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 6A1EEFD22CE3A62B00C1F652 /* libssl.3.dylib */; };
6A2935322BFCFAFD0035CE4B /* Preview Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6A2934AE2BFCFAFD0035CE4B /* Preview Assets.xcassets */; };
6A2935332BFCFAFD0035CE4B /* Engine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A2934B02BFCFAFD0035CE4B /* Engine.swift */; };
6A2935342BFCFAFD0035CE4B /* EngineExt.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A2934B12BFCFAFD0035CE4B /* EngineExt.swift */; };
Expand Down Expand Up @@ -185,21 +181,15 @@
EBB8DBC92CE543840005D181 /* SparkleUpdaterFinishView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBC82CE543840005D181 /* SparkleUpdaterFinishView.swift */; };
EBB8DBCB2CE5448C0005D181 /* SparkleUpdaterSheetViewModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBCA2CE5448C0005D181 /* SparkleUpdaterSheetViewModifier.swift */; };
EBB8DBD02CE573B70005D181 /* RichAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBCF2CE573B70005D181 /* RichAlertView.swift */; };
EBB8DBD22CE669210005D181 /* BackgroundEventServiceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBD12CE669210005D181 /* BackgroundEventServiceModel.swift */; };
EBB8DBD72CE6C1520005D181 /* HubView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBD62CE6C1520005D181 /* HubView.swift */; };
EBB8DBDB2CE6C37F0005D181 /* HubLibraryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBDA2CE6C37F0005D181 /* HubLibraryView.swift */; };
EBB8DBDE2CE6C6440005D181 /* HubStoreEpicGamesView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBDD2CE6C6440005D181 /* HubStoreEpicGamesView.swift */; };
EBB8DBE02CE6C67A0005D181 /* GenericWebView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBB8DBDF2CE6C67A0005D181 /* GenericWebView.swift */; };
EBC3A5482CE7E8CB00492C89 /* HubStoreView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC3A5472CE7E8CB00492C89 /* HubStoreView.swift */; };
EBC3A54C2CE8014400492C89 /* HubSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = EBC3A54B2CE8014400492C89 /* HubSettingsView.swift */; };
/* End PBXBuildFile section */

/* Begin PBXCopyFilesBuildPhase section */
6A71D3D32BFD00B600A2C74D /* Embed Libraries */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = "";
dstSubfolderSpec = 10;
files = (
);
name = "Embed Libraries";
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXCopyFilesBuildPhase section */

/* Begin PBXFileReference section */
5A62AE972C27DB1200BA31D2 /* GameListEvoVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameListEvoVM.swift; sourceTree = "<group>"; };
5A9573A92C29BBEC009C8F85 /* SparkleController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleController.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -367,6 +357,13 @@
EBB8DBC82CE543840005D181 /* SparkleUpdaterFinishView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleUpdaterFinishView.swift; sourceTree = "<group>"; };
EBB8DBCA2CE5448C0005D181 /* SparkleUpdaterSheetViewModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SparkleUpdaterSheetViewModifier.swift; sourceTree = "<group>"; };
EBB8DBCF2CE573B70005D181 /* RichAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RichAlertView.swift; sourceTree = "<group>"; };
EBB8DBD12CE669210005D181 /* BackgroundEventServiceModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BackgroundEventServiceModel.swift; sourceTree = "<group>"; };
EBB8DBD62CE6C1520005D181 /* HubView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HubView.swift; sourceTree = "<group>"; };
EBB8DBDA2CE6C37F0005D181 /* HubLibraryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HubLibraryView.swift; sourceTree = "<group>"; };
EBB8DBDD2CE6C6440005D181 /* HubStoreEpicGamesView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HubStoreEpicGamesView.swift; sourceTree = "<group>"; };
EBB8DBDF2CE6C67A0005D181 /* GenericWebView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GenericWebView.swift; sourceTree = "<group>"; };
EBC3A5472CE7E8CB00492C89 /* HubStoreView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HubStoreView.swift; sourceTree = "<group>"; };
EBC3A54B2CE8014400492C89 /* HubSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HubSettingsView.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand All @@ -385,10 +382,6 @@
6A12FF8E2B73AC4E00AA948C /* Glur in Frameworks */,
6A34366E2B8D7F1200D35BCA /* Shimmer in Frameworks */,
6AAD31152B08693D0035FA69 /* SemanticVersion in Frameworks */,
6A1EF00F2CE3A62B00C1F652 /* Python.framework in Frameworks */,
6A1EF0102CE3A62B00C1F652 /* libcrypto.3.dylib in Frameworks */,
6A1EF0112CE3A62B00C1F652 /* Python in Frameworks */,
6A1EF0122CE3A62B00C1F652 /* libssl.3.dylib in Frameworks */,
6A2961072CE1DD6200917E90 /* FirebaseCrashlytics in Frameworks */,
6A2961032CE1DD6200917E90 /* FirebaseAnalytics in Frameworks */,
6A371B592AE7DFBF0054BF7A /* ZIPFoundation in Frameworks */,
Expand Down Expand Up @@ -596,7 +589,6 @@
6A2934DD2BFCFAFD0035CE4B /* GameInstallProgressView.swift */,
6A2934DE2BFCFAFD0035CE4B /* SubscriptedTextView.swift */,
6A2934EB2BFCFAFD0035CE4B /* WebView.swift */,
6AEEFA462CA9173C0025C840 /* WindowBlurView.swift */,
);
path = Modules;
sourceTree = "<group>";
Expand Down Expand Up @@ -636,6 +628,7 @@
EB7D07962CC981970072D64E /* Components */,
EBB8DBB32CE3ED260005D181 /* SparkleUpdater */,
EB90A3602CD940CA001F0871 /* Onboarding */,
EBB8DBD52CE6C11E0005D181 /* Hub */,
6A2934DA2BFCFAFD0035CE4B /* Navigation */,
6A2934EC2BFCFAFD0035CE4B /* Unified */,
);
Expand Down Expand Up @@ -733,8 +726,10 @@
isa = PBXGroup;
children = (
EB7D07972CC981C10072D64E /* ColorfulBackgroundView.swift */,
6AEEFA462CA9173C0025C840 /* WindowBlurView.swift */,
EBB8DBB02CE3C0470005D181 /* BundleIconView.swift */,
EBB8DBCF2CE573B70005D181 /* RichAlertView.swift */,
EBB8DBDF2CE6C67A0005D181 /* GenericWebView.swift */,
);
path = Components;
sourceTree = "<group>";
Expand Down Expand Up @@ -784,6 +779,7 @@
EB7D07C82CCC52A80072D64E /* AppLoggerModel.swift */,
EB7D07C22CCAB5EF0072D64E /* EngineInstallerModel.swift */,
EBB8DBAC2CE3405F0005D181 /* SparkleUpdateControlerModel.swift */,
EBB8DBD12CE669210005D181 /* BackgroundEventServiceModel.swift */,
);
path = Models;
sourceTree = "<group>";
Expand Down Expand Up @@ -834,6 +830,42 @@
name = Frameworks;
sourceTree = "<group>";
};
EBB8DBD52CE6C11E0005D181 /* Hub */ = {
isa = PBXGroup;
children = (
EBC3A54A2CE8013600492C89 /* Settings */,
EBC3A5492CE8011600492C89 /* Library */,
EBB8DBDC2CE6C6300005D181 /* Store */,
EBB8DBD62CE6C1520005D181 /* HubView.swift */,
);
path = Hub;
sourceTree = "<group>";
};
EBB8DBDC2CE6C6300005D181 /* Store */ = {
isa = PBXGroup;
children = (
EBB8DBDD2CE6C6440005D181 /* HubStoreEpicGamesView.swift */,
EBC3A5472CE7E8CB00492C89 /* HubStoreView.swift */,
);
path = Store;
sourceTree = "<group>";
};
EBC3A5492CE8011600492C89 /* Library */ = {
isa = PBXGroup;
children = (
EBB8DBDA2CE6C37F0005D181 /* HubLibraryView.swift */,
);
path = Library;
sourceTree = "<group>";
};
EBC3A54A2CE8013600492C89 /* Settings */ = {
isa = PBXGroup;
children = (
EBC3A54B2CE8014400492C89 /* HubSettingsView.swift */,
);
path = Settings;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand All @@ -845,7 +877,6 @@
6AB474922AACBBE900AB9C63 /* Frameworks */,
6AB474932AACBBE900AB9C63 /* Resources */,
6E47429A2B0A85C4004FA8A8 /* SwiftLint */,
6A71D3D32BFD00B600A2C74D /* Embed Libraries */,
6ACCEC192CD088A400611BEF /* Crashlytics */,
);
buildRules = (
Expand Down Expand Up @@ -1047,7 +1078,9 @@
buildActionMask = 2147483647;
files = (
EBB8DBB62CE3F15F0005D181 /* SparkleUpdaterPreviewView.swift in Sources */,
EBB8DBD72CE6C1520005D181 /* HubView.swift in Sources */,
EB7D07A72CC9C6980072D64E /* AppDelegate.swift in Sources */,
EBB8DBDE2CE6C6440005D181 /* HubStoreEpicGamesView.swift in Sources */,
6A29353A2BFCFAFD0035CE4B /* Task.swift in Sources */,
EB7D07B82CC9E25F0072D64E /* main.swift in Sources */,
6A2935592BFCFAFD0035CE4B /* ContainerCreationView.swift in Sources */,
Expand All @@ -1065,6 +1098,7 @@
6A496A732C1AF75B00FD637B /* Game.swift in Sources */,
EB7D07C72CCC4DA00072D64E /* AppSettingsPersistentStateModel.swift in Sources */,
6A2935602BFCFAFD0035CE4B /* ContainerListView.swift in Sources */,
EBB8DBE02CE6C67A0005D181 /* GenericWebView.swift in Sources */,
6A29355E2BFCFAFD0035CE4B /* StopDownloadAlert.swift in Sources */,
EBB8DBC32CE525770005D181 /* SparkleUpdaterDownloadingView.swift in Sources */,
6A2935662BFCFAFD0035CE4B /* AppDelegate1.swift in Sources */,
Expand All @@ -1073,10 +1107,12 @@
EB7D07AC2CC9C7030072D64E /* HubWindowController.swift in Sources */,
5A62AE982C27DB1200BA31D2 /* GameListEvoVM.swift in Sources */,
6A29354C2BFCFAFD0035CE4B /* LibraryView.swift in Sources */,
EBB8DBDB2CE6C37F0005D181 /* HubLibraryView.swift in Sources */,
EB90A36E2CD982BB001F0871 /* OnboardingEpicGamesWelcomeStepView.swift in Sources */,
6A2935472BFCFAFD0035CE4B /* VariableManager.swift in Sources */,
EB90A3682CD9422B001F0871 /* OnboardingIntroStepView.swift in Sources */,
6A2935332BFCFAFD0035CE4B /* Engine.swift in Sources */,
EBC3A54C2CE8014400492C89 /* HubSettingsView.swift in Sources */,
6A0688442C2BCE8B004DF10F /* DownloadCard.swift in Sources */,
6A2935462BFCFAFD0035CE4B /* Rosetta.swift in Sources */,
6A2935532BFCFAFD0035CE4B /* StoreView.swift in Sources */,
Expand All @@ -1085,6 +1121,7 @@
6A29355F2BFCFAFD0035CE4B /* UninstallGameView.swift in Sources */,
EBB8DBD02CE573B70005D181 /* RichAlertView.swift in Sources */,
EB90A3662CD941EF001F0871 /* OnboardingEpicGamesLoginStepView.swift in Sources */,
EBC3A5482CE7E8CB00492C89 /* HubStoreView.swift in Sources */,
6A29355A2BFCFAFD0035CE4B /* ContainerSettingsView.swift in Sources */,
6A448E0E2CC4A53A001E9F47 /* GameListCard.swift in Sources */,
6A31421C2CE39911006838CC /* SemanticVersion.swift in Sources */,
Expand All @@ -1110,6 +1147,7 @@
EB90A3732CD9AE5D001F0871 /* StorablePersistentStateModel.swift in Sources */,
6A2935582BFCFAFD0035CE4B /* SubscriptedTextView.swift in Sources */,
6A2935542BFCFAFD0035CE4B /* SupportView.swift in Sources */,
EBB8DBD22CE669210005D181 /* BackgroundEventServiceModel.swift in Sources */,
6A29354E2BFCFAFD0035CE4B /* ContainersView.swift in Sources */,
6A2935412BFCFAFD0035CE4B /* WineInterface.swift in Sources */,
EBB8DBC52CE541D90005D181 /* SparkleUpdaterInstallingView.swift in Sources */,
Expand Down Expand Up @@ -1283,7 +1321,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3262;
CURRENT_PROJECT_VERSION = 3338;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\"";
DEVELOPMENT_TEAM = "";
Expand Down Expand Up @@ -1334,7 +1372,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 3262;
CURRENT_PROJECT_VERSION = 3338;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\"";
DEVELOPMENT_TEAM = "";
Expand Down
10 changes: 8 additions & 2 deletions Sources/App/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ public class AppDelegate: NSObject, NSApplicationDelegate {

/// Listen for events
@MainActor private func listenEvents() {
// Flush old cancellables
cancellables.forEach({ $0.cancel() })
cancellables.removeAll()

// Listen for onboarding state changes
Expand All @@ -51,6 +49,14 @@ public class AppDelegate: NSObject, NSApplicationDelegate {
appMenuController.setRestartOnboardingVisibility(true)
}
}).store(in: &cancellables)

SparkleUpdateControlerModel.shared.$state.sink(receiveValue: { [self] value in
switch value {
case .updateAvailable, .checkingForUpdates, .readyToRelaunch, .noUpdateAvailable:
restoreActiveRootWindow()
default: ()
}
}).store(in: &cancellables)
}

/// Get the setup window or switch to it.
Expand Down
30 changes: 30 additions & 0 deletions Sources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -11631,6 +11631,9 @@
}
}
}
},
"common.back" : {

},
"common.cancel" : {
"localizations" : {
Expand Down Expand Up @@ -11663,6 +11666,12 @@
}
}
}
},
"common.forward" : {

},
"common.homepage" : {

},
"common.next" : {
"localizations" : {
Expand Down Expand Up @@ -11706,6 +11715,9 @@
}
}
}
},
"common.refresh" : {

},
"common.skip" : {
"localizations" : {
Expand Down Expand Up @@ -22802,6 +22814,12 @@
}
}
}
},
"genericWebView.error" : {

},
"genericWebView.retry" : {

},
"Get support/Support Mythic" : {
"localizations" : {
Expand Down Expand Up @@ -24138,6 +24156,15 @@
}
}
}
},
"hubLibraryView.title" : {

},
"hubStoreEpicGamesView.title" : {

},
"hubStoreView.title" : {

},
"I have read and agreed to the terms of the software license agreement." : {
"extractionState" : "stale",
Expand Down Expand Up @@ -29665,6 +29692,9 @@
}
}
}
},
"Library View!" : {

},
"List" : {
"localizations" : {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Models/BackgroundEventServiceModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ public struct BackgroundEventServiceModel {

/// The dispatch queue for the events
public let queue: DispatchQueue = DispatchQueue(label: "app.getmythic.MythicMacOS.BackgroundEventService",
qos: .background)
qos: .background)
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ public struct AppSettingsPersistentStateModel: StorablePersistentStateModel.Stat
.init()
}

/// Library Display Mode.
public enum LibraryDisplayMode: String, Codable, Hashable {
case list
case grid
}

/// Auto update settings.
public enum AutoUpdateAction: String, Codable, Hashable {
case off
Expand All @@ -47,9 +41,6 @@ public struct AppSettingsPersistentStateModel: StorablePersistentStateModel.Stat
/// Engine update action.
public var engineUpdateAction: AutoUpdateAction = .check

/// Library display mode.
public var libraryDisplayMode: LibraryDisplayMode = .grid

/// Hide the main window on game launch.
public var hideOnGameLaunch: Bool = false
/// Close opened games on quit.
Expand Down
Loading

0 comments on commit e8f32ec

Please sign in to comment.