Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: alternate window fix mode for certain apps #842

Merged
merged 2 commits into from Mar 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions PlayCover/Model/AppSettings.swift
Expand Up @@ -26,6 +26,7 @@ struct AppSettingsData: Codable {
var playChainDebugging = false
var inverseScreenValues = false
var metalHUD = false
var windowFixMethod = 0

init() {}

Expand All @@ -50,6 +51,7 @@ struct AppSettingsData: Codable {
playChainDebugging = try container.decodeIfPresent(Bool.self, forKey: .playChainDebugging) ?? false
inverseScreenValues = try container.decodeIfPresent(Bool.self, forKey: .inverseScreenValues) ?? false
metalHUD = try container.decodeIfPresent(Bool.self, forKey: .metalHUD) ?? false
windowFixMethod = try container.decodeIfPresent(Int.self, forKey: .windowFixMethod) ?? 0
}
}

Expand Down
21 changes: 18 additions & 3 deletions PlayCover/Views/AppSettingsView.swift
Expand Up @@ -285,10 +285,25 @@ struct GraphicsView: View {
Spacer()
}
}
HStack {
VStack(alignment: .leading) {
if #available(macOS 13.2, *) {
Toggle("settings.toggle.windowExperimentalFix", isOn: $settings.settings.inverseScreenValues)
.help("settings.toggle.windowExperimentalFix.help")
HStack {
Toggle("settings.picker.windowFix", isOn: $settings.settings.inverseScreenValues)
.help("settings.picker.windowFix.help")
.onChange(of: settings.settings.inverseScreenValues) { _ in
settings.settings.windowFixMethod = 0
}
Spacer()
// Dropdown to choose fix method
Picker("", selection: $settings.settings.windowFixMethod) {
Text("settings.picker.windowFixMethod.0").tag(0)
Text("settings.picker.windowFixMethod.1").tag(1)
}
.frame(alignment: .leading)
.help("settings.picker.windowFixMethod.help")
.disabled(!settings.settings.inverseScreenValues)
.disabled(settings.settings.resolution != 0)
JoseMoreville marked this conversation as resolved.
Show resolved Hide resolved
}
Spacer()
}
Toggle("settings.toggle.disableDisplaySleep", isOn: $settings.settings.disableTimeout)
Expand Down
6 changes: 4 additions & 2 deletions PlayCover/en.lproj/Localizable.strings
Expand Up @@ -169,8 +169,10 @@
"settings.text.customWidth" = "Width";
"settings.text.detectedResolution" = "Detected Resolution:";
"settings.picker.aspectRatio" = "Aspect ratio:";
"settings.toggle.windowExperimentalFix.help" = "Attempts to fix your app scene if you have problems with it";
"settings.toggle.windowExperimentalFix" = "Fix window issues";
"settings.picker.windowFix" = "Fix window display issues";
"settings.picker.windowFix.help" = "Apply window fixes that may helps your apps display normally";
"settings.picker.windowFixMethod.0" = "Normal";
"settings.picker.windowFixMethod.1" = "Alternate";
"settings.toggle.disableDisplaySleep" = "Disable display sleep";
"settings.toggle.disableDisplaySleep.help" = "Prevent display from turning off while this app is running";
"settings.noPlayTools" = "PlayTools is not installed in this app";
Expand Down