diff --git a/Mythic.xcodeproj/project.pbxproj b/Mythic.xcodeproj/project.pbxproj index a187e19..920eb85 100644 --- a/Mythic.xcodeproj/project.pbxproj +++ b/Mythic.xcodeproj/project.pbxproj @@ -71,6 +71,7 @@ 6A2961032CE1DD6200917E90 /* FirebaseAnalytics in Frameworks */ = {isa = PBXBuildFile; productRef = 6A2961022CE1DD6200917E90 /* FirebaseAnalytics */; }; 6A2961052CE1DD6200917E90 /* FirebaseCore in Frameworks */ = {isa = PBXBuildFile; productRef = 6A2961042CE1DD6200917E90 /* FirebaseCore */; }; 6A2961072CE1DD6200917E90 /* FirebaseCrashlytics in Frameworks */ = {isa = PBXBuildFile; productRef = 6A2961062CE1DD6200917E90 /* FirebaseCrashlytics */; }; + 6A31421C2CE39911006838CC /* SemanticVersion.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A31421B2CE3990B006838CC /* SemanticVersion.swift */; }; 6A34366E2B8D7F1200D35BCA /* Shimmer in Frameworks */ = {isa = PBXBuildFile; productRef = 6A34366D2B8D7F1200D35BCA /* Shimmer */; }; 6A371B592AE7DFBF0054BF7A /* ZIPFoundation in Frameworks */ = {isa = PBXBuildFile; productRef = 6A371B582AE7DFBF0054BF7A /* ZIPFoundation */; }; 6A448E0E2CC4A53A001E9F47 /* GameListCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A448E0D2CC4A531001E9F47 /* GameListCard.swift */; }; @@ -192,6 +193,7 @@ 6A2960FB2CE0ED0700917E90 /* EpicWebAuthView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpicWebAuthView.swift; sourceTree = ""; }; 6A2960FD2CE1017700917E90 /* NSApplication.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSApplication.swift; sourceTree = ""; }; 6A2960FF2CE1033000917E90 /* NSWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSWindow.swift; sourceTree = ""; }; + 6A31421B2CE3990B006838CC /* SemanticVersion.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SemanticVersion.swift; sourceTree = ""; }; 6A448E0D2CC4A531001E9F47 /* GameListCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameListCard.swift; sourceTree = ""; }; 6A448E0F2CC4BC50001E9F47 /* GameCardVM.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GameCardVM.swift; sourceTree = ""; }; 6A496A722C1AF75600FD637B /* Game.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Game.swift; sourceTree = ""; }; @@ -468,6 +470,7 @@ 6AD44DE52C0A29BF00824C06 /* Built-in */ = { isa = PBXGroup; children = ( + 6A31421B2CE3990B006838CC /* SemanticVersion.swift */, 6A2960FF2CE1033000917E90 /* NSWindow.swift */, 6A2960FD2CE1017700917E90 /* NSApplication.swift */, 6A2934B32BFCFAFD0035CE4B /* Bundle.swift */, @@ -755,6 +758,7 @@ EB90A3662CD941EF001F0871 /* OnboardingEpicGamesLoginStepView.swift in Sources */, 6A29355A2BFCFAFD0035CE4B /* ContainerSettingsView.swift in Sources */, 6A448E0E2CC4A53A001E9F47 /* GameListCard.swift in Sources */, + 6A31421C2CE39911006838CC /* SemanticVersion.swift in Sources */, 6A2935572BFCFAFD0035CE4B /* GameInstallProgressView.swift in Sources */, 6A29353B2BFCFAFD0035CE4B /* URL.swift in Sources */, 6A2935382BFCFAFD0035CE4B /* Logger.swift in Sources */, @@ -945,7 +949,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3259; + CURRENT_PROJECT_VERSION = 3262; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\""; DEVELOPMENT_TEAM = ""; @@ -992,7 +996,7 @@ "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 3259; + CURRENT_PROJECT_VERSION = 3262; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_ASSET_PATHS = "\"Sources/Preview Content\""; DEVELOPMENT_TEAM = ""; diff --git a/Sources/Localizable.xcstrings b/Sources/Localizable.xcstrings index e0cc1e5..ed70023 100644 --- a/Sources/Localizable.xcstrings +++ b/Sources/Localizable.xcstrings @@ -3079,6 +3079,7 @@ } }, "%@ %@ (%@)" : { + "extractionState" : "stale", "localizations" : { "af" : { "stringUnit" : { @@ -31732,19 +31733,15 @@ } } } + }, + "Mythic %@" : { + }, "Mythic Engine" : { }, - "Mythic Engine %lld.%lld.%lld (%@)" : { - "localizations" : { - "en" : { - "stringUnit" : { - "state" : "new", - "value" : "Mythic Engine %1$lld.%2$lld.%3$lld (%4$@)" - } - } - } + "Mythic Engine %@" : { + }, "Mythic Engine is Mythic's implementation of Apple's game porting toolkit (GPTK),\nwhich combines wine and D3DMetal, to create a windows gaming experience on macOS.\nSimilar to Proton, Mythic Engine attempts to be an emulator-like experience that\nenables native Windows games to be playable on macOS, while coming closer to native\nperformance than ever before. (performance will vary between games)" : { "extractionState" : "stale", diff --git a/Sources/Utilities/Extensions/Built-in/SemanticVersion.swift b/Sources/Utilities/Extensions/Built-in/SemanticVersion.swift new file mode 100644 index 0000000..73dddca --- /dev/null +++ b/Sources/Utilities/Extensions/Built-in/SemanticVersion.swift @@ -0,0 +1,24 @@ +// +// SemanticVersion.swift +// Mythic +// +// Created by Esiayo Alegbe on 11/12/24. +// + +import SemanticVersion + +extension SemanticVersion { + var prettyString: String { + var versionString = "\(major).\(minor).\(patch)" + + if !preRelease.isEmpty { + versionString += "-\(preRelease)" + } + + if !build.isEmpty { + versionString += " (\(build))" + } + + return versionString + } +} diff --git a/Sources/Views/Navigation/MainView.swift b/Sources/Views/Navigation/MainView.swift index 308cc2b..23bd250 100644 --- a/Sources/Views/Navigation/MainView.swift +++ b/Sources/Views/Navigation/MainView.swift @@ -8,6 +8,7 @@ import Foundation import OSLog import Combine import WhatsNewKit +import SemanticVersion struct MainView: View { @EnvironmentObject var networkMonitor: NetworkMonitor @@ -81,14 +82,14 @@ struct MainView: View { #if DEBUG VStack { - if let displayName = Bundle.main.object(forInfoDictionaryKey: "CFBundleDisplayName") as? String, - let shortVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String, - let bundleVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String { - Text("\(displayName) \(shortVersion) (\(bundleVersion))") + if let shortVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String, + let bundleVersion = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion") as? String, + let mythicVersion: SemanticVersion = .init("\(shortVersion)+\(bundleVersion)") { + Text("Mythic \(mythicVersion.prettyString)") } if let engineVersion = Engine.version { - Text("Mythic Engine \(engineVersion.major).\(engineVersion.minor).\(engineVersion.patch) (\(engineVersion.build))") + Text("Mythic Engine \(engineVersion.prettyString)") } } .font(.footnote)