Skip to content

Commit

Permalink
Fix circular reference preventing settings and updater settings from …
Browse files Browse the repository at this point in the history
…working +...

Wording improvements with RPC
Added functionality for severing RPC connection in settings
  • Loading branch information
vapidinfinity committed Mar 2, 2024
1 parent 958c2be commit eccd934
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 12 deletions.
12 changes: 6 additions & 6 deletions Mythic.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
6A0BB7AB2B501A2200C8A693 /* LocalImport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A0BB7AA2B501A2200C8A693 /* LocalImport.swift */; };
6A0BB7AD2B501A3400C8A693 /* EpicImport.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A0BB7AC2B501A3400C8A693 /* EpicImport.swift */; };
6A0C66852ABC4092004B0755 /* CachedAsyncImage in Frameworks */ = {isa = PBXBuildFile; productRef = 6A0C66842ABC4092004B0755 /* CachedAsyncImage */; };
6A11CF902B8F821400124E0D /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 6A11CF8F2B8F821400124E0D /* Localizable.xcstrings */; };
6A12FF8E2B73AC4E00AA948C /* Glur in Frameworks */ = {isa = PBXBuildFile; productRef = 6A12FF8D2B73AC4E00AA948C /* Glur */; };
6A12FF902B73AFCE00AA948C /* BottleSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A12FF8F2B73AFCE00AA948C /* BottleSettings.swift */; };
6A1322382B1C98AE0049BB64 /* InstallStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6A1322372B1C98AE0049BB64 /* InstallStatus.swift */; };
Expand Down Expand Up @@ -62,6 +61,7 @@
6AC3E1892B374D2E000EB765 /* VariableManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC3E1882B374D2E000EB765 /* VariableManager.swift */; };
6AC4745D2AC07F0D00188D38 /* ProgressView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AC4745C2AC07F0D00188D38 /* ProgressView.swift */; };
6AC742DD2B9314AB000EA1B2 /* SwordRPC in Frameworks */ = {isa = PBXBuildFile; productRef = 6AC742DC2B9314AB000EA1B2 /* SwordRPC */; };
6AC742E12B933487000EA1B2 /* Localizable.xcstrings in Resources */ = {isa = PBXBuildFile; fileRef = 6AC742E02B933487000EA1B2 /* Localizable.xcstrings */; };
6AD506562AAFF671008A28C1 /* Home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD506552AAFF671008A28C1 /* Home.swift */; };
6AD506582AAFF6CB008A28C1 /* Library.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD506572AAFF6CB008A28C1 /* Library.swift */; };
6AD5065A2AAFF6E2008A28C1 /* Wine.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6AD506592AAFF6E2008A28C1 /* Wine.swift */; };
Expand Down Expand Up @@ -89,7 +89,6 @@
6A0585472ADEC17300165C3C /* WhiskyInterface.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WhiskyInterface.swift; sourceTree = "<group>"; };
6A0BB7AA2B501A2200C8A693 /* LocalImport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocalImport.swift; sourceTree = "<group>"; };
6A0BB7AC2B501A3400C8A693 /* EpicImport.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EpicImport.swift; sourceTree = "<group>"; };
6A11CF8F2B8F821400124E0D /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
6A12FF8F2B73AFCE00AA948C /* BottleSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottleSettings.swift; sourceTree = "<group>"; };
6A1322372B1C98AE0049BB64 /* InstallStatus.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InstallStatus.swift; sourceTree = "<group>"; };
6A1417B72AF7CCD80022DE24 /* FileLocations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FileLocations.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -130,6 +129,7 @@
6AC25CBE2AAEFF5100D395CF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
6AC3E1882B374D2E000EB765 /* VariableManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VariableManager.swift; sourceTree = "<group>"; };
6AC4745C2AC07F0D00188D38 /* ProgressView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProgressView.swift; sourceTree = "<group>"; };
6AC742E02B933487000EA1B2 /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
6AD506552AAFF671008A28C1 /* Home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Home.swift; sourceTree = "<group>"; };
6AD506572AAFF6CB008A28C1 /* Library.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Library.swift; sourceTree = "<group>"; };
6AD506592AAFF6E2008A28C1 /* Wine.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Wine.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -402,7 +402,7 @@
6AC3E18A2B374F3C000EB765 /* Deprecated */,
6AAF14DE2B271DF4000B1BA2 /* legendary */,
6AB4749C2AACBBEA00AB9C63 /* Assets.xcassets */,
6A11CF8F2B8F821400124E0D /* Localizable.xcstrings */,
6AC742E02B933487000EA1B2 /* Localizable.xcstrings */,
6AB474A12AACBBEA00AB9C63 /* Mythic.entitlements */,
6A721B2A2B8A4BD600A4EA3C /* Credits.rtf */,
6AB4749E2AACBBEA00AB9C63 /* Preview Content */,
Expand Down Expand Up @@ -579,7 +579,7 @@
buildActionMask = 2147483647;
files = (
6A721B2B2B8A4BD600A4EA3C /* Credits.rtf in Resources */,
6A11CF902B8F821400124E0D /* Localizable.xcstrings in Resources */,
6AC742E12B933487000EA1B2 /* Localizable.xcstrings in Resources */,
6AB474A02AACBBEA00AB9C63 /* Preview Assets.xcassets in Resources */,
6AB4749D2AACBBEA00AB9C63 /* Assets.xcassets in Resources */,
6AAF14DF2B271DF4000B1BA2 /* legendary in Resources */,
Expand Down Expand Up @@ -809,7 +809,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2438;
CURRENT_PROJECT_VERSION = 2442;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
DEVELOPMENT_TEAM = 67ZBY275P8;
Expand Down Expand Up @@ -848,7 +848,7 @@
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 2438;
CURRENT_PROJECT_VERSION = 2442;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"Mythic/Preview Content\"";
DEVELOPMENT_TEAM = 67ZBY275P8;
Expand Down
2 changes: 0 additions & 2 deletions Mythic/Utilities/UpdaterSettings [TEMP].swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,5 @@ struct UpdaterSettingsView: View {
.disabled(!automaticallyChecksForUpdates)
}
.padding()

SettingsView()
}
}
2 changes: 1 addition & 1 deletion Mythic/Views/Navigation/Home.swift
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ struct HomeView: View {
.task(priority: .background) {
discordRPC.setPresence({
var presence: RichPresence = .init()
presence.details = "Looking at the Home View"
presence.details = "Viewing home"
presence.state = "Idle"
presence.timestamps.start = .now
presence.assets.largeImage = "macos_512x512_2x"
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Navigation/Library/Library.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ struct LibraryView: View {
.task(priority: .background) {
discordRPC.setPresence({
var presence: RichPresence = .init()
presence.state = "Looking through their game library"
presence.details = "Looking through their game library"
presence.state = "Viewing Library"
presence.timestamps.start = .now
presence.assets.largeImage = "macos_512x512_2x"

Expand Down
9 changes: 8 additions & 1 deletion Mythic/Views/Navigation/Settings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ struct SettingsView: View {
Form {
Section("Mythic", isExpanded: $isMythicSectionExpanded) {
Toggle("Display Mythic activity status on Discord", isOn: $rpc)
.onChange(of: rpc) { _, newValue in
if newValue {
_ = discordRPC.connect()
} else {
discordRPC.disconnect()
}
}

Toggle("Minimise to menu bar on game launch", isOn: $minimize)

Expand Down Expand Up @@ -115,7 +122,6 @@ struct SettingsView: View {
.disabled(true)
.help("Not implemented yet")

UpdaterSettingsView(updater: MythicApp().updaterController.updater)
}

Section("Wine/Mythic Engine", isExpanded: $isWineSectionExpanded) {
Expand Down Expand Up @@ -193,6 +199,7 @@ struct SettingsView: View {
.task(priority: .background) {
discordRPC.setPresence({
var presence: RichPresence = .init()
presence.details = "Tweaking some settings"
presence.state = "Configuring Mythic"
presence.timestamps.start = .now
presence.assets.largeImage = "macos_512x512_2x"
Expand Down
3 changes: 2 additions & 1 deletion Mythic/Views/Navigation/Support.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ struct SupportView: View {
.task(priority: .background) {
discordRPC.setPresence({
var presence: RichPresence = .init()
presence.state = "Looking for help"
presence.details = "Looking for help"
presence.state = "Viewing Support"
presence.timestamps.start = .now
presence.assets.largeImage = "macos_512x512_2x"

Expand Down
1 change: 1 addition & 0 deletions Mythic/Views/Navigation/Wine.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ struct WineView: View {
.task(priority: .background) {
discordRPC.setPresence({
var presence: RichPresence = .init()
presence.details = "Managing their Windows® Instances"
presence.state = "Managing bottles"
presence.timestamps.start = .now
presence.assets.largeImage = "macos_512x512_2x"
Expand Down

0 comments on commit eccd934

Please sign in to comment.