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

[UX/Fix] Respect experimental UMU support disabled #4191

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/backend/game_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ class GameConfigV0 extends GameConfig {
// read game's settings
const settings = JSON.parse(readFileSync(this.path, 'utf-8'))
gameSettings = settings[this.appName] || ({} as GameSettings)
} else {
// only set the `disableUMU` default value when getting settings for a new game
// we want it to be `undefined` for games that were installed already
defaultSettings.disableUMU = false
}

if (!isWindows) {
Expand Down
17 changes: 16 additions & 1 deletion src/backend/utils/compatibility_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,22 @@ export async function isUmuSupported(
): Promise<boolean> {
if (!isLinux) return false
if (gameSettings.wineVersion.type !== 'proton') return false
if (gameSettings.disableUMU) return false
if (gameSettings.disableUMU === true) return false
if (gameSettings.disableUMU === undefined) {
// If the disableUMU setting is undefined it means the game was installed and configured
// before the introduction of this setting, so the usage of UMU was dictated by the
// experimental feature configuration.
//
// We have to check this to not enable UMU incorrectly even if the setting is not editable
// anymore.
// If we don't, we would end up enabling UMU for games that are already functional with proton
// without UMU to not mess their prefix
const experimentalFeatures =
GlobalConfig.get().getSettings().experimentalFeatures

// if UMU was never enabled or was enabled and then disabled
if (!experimentalFeatures?.umuSupport) return false
}
if (!checkUmuInstalled) return true
if (!existsSync(await getUmuPath())) return false

Expand Down
1 change: 1 addition & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export type ExperimentalFeatures = {
enableNewDesign: boolean
enableHelp: boolean
cometSupport: boolean
umuSupport?: boolean
}

export interface AppSettings extends GameSettings {
Expand Down
Loading