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] Ignore Proton - Experimental by default, but allow enabling it for advanced usage #4254

Open
wants to merge 1 commit 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
8 changes: 8 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,14 @@
},
"label": "Allow installation of games with broken or denied anticheat"
},
"allow_proton_experimental": {
"confirmation": {
"message": "'Proton - Experimental' is, by nature, meant for experimentation and not for stable use. Using it as a default for all games can unexpectedly break games previously working during an upgrade. Use it only if you know what you are doing.",
"title": "Are you sure?",
"understand": "Don't allow it"
},
"label": "Allow using \"Proton - Experimental\" to run games"
},
"alt-gogdl-bin": "Choose an Alternative GOGDL Binary to use",
"alt-legendary-bin": "Choose an Alternative Legendary Binary",
"alt-nile-bin": "Choose an Alternative Nile Binary",
Expand Down
9 changes: 9 additions & 0 deletions src/backend/utils/compatibility_layers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,15 @@ export async function getLinuxWineSet(
protonPaths.forEach((path) => {
if (existsSync(path)) {
readdirSync(path).forEach((version) => {
if (version.includes('Experimental')) {
if (!GlobalConfig.get().getSettings().allowProtonExperimental) {
logInfo(
'Ignoring "Proton - Experimental". You can change this in Settings > Advanced'
)
return
}
}

// Only relevant to Lutris
if (version.startsWith('UMU-Latest')) {
return
Expand Down
1 change: 1 addition & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface AppSettings extends GameSettings {
startInTray: boolean
allowInstallationBrokenAnticheat: boolean
disableUMU: boolean
allowProtonExperimental: boolean
}

export type LibraryTopSectionOptions =
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import React, { useContext } from 'react'
import { useTranslation } from 'react-i18next'
import useSetting from 'frontend/hooks/useSetting'
import { ToggleSwitch } from 'frontend/components/UI'
import ContextProvider from 'frontend/state/ContextProvider'

const AllowProtonExperimental = () => {
const { t } = useTranslation()
const { showDialogModal } = useContext(ContextProvider)
const [allowProtonExperimental, setAllowProtonExperimental] = useSetting(
'allowProtonExperimental',
false
)

const toggleConfig = () => {
if (allowProtonExperimental) {
setAllowProtonExperimental(false)
} else {
showDialogModal({
title: t(
'setting.allow_proton_experimental.confirmation.title',
'Are you sure?'
),
message: t(
'setting.allow_proton_experimental.confirmation.message',
"'Proton - Experimental' is, by nature, meant for experimentation and not for stable use. Using it as a default for all games can unexpectedly break games previously working during an upgrade. Use it only if you know what you are doing."
),
buttons: [
{
text: t(
'setting.allow_proton_experimental.confirmation.understand',
'I understand, allow it'
),
onClick: () => setAllowProtonExperimental(true)
},
{
text: t(
'setting.allow_proton_experimental.confirmation.understand',
"Don't allow it"
)
}
],
type: 'MESSAGE'
})
}
}

return (
<div className="toggleRow">
<ToggleSwitch
htmlId="allowProtonExperimental"
value={allowProtonExperimental}
handleChange={() => toggleConfig()}
title={t(
'setting.allow_proton_experimental.label',
'Allow using "Proton - Experimental" to run games'
)}
/>
</div>
)
}

export default AllowProtonExperimental
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
ExperimentalFeatures,
ResetHeroic
} from '../../components'
import AllowProtonExperimental from '../../components/AllowProtonExperimental'

export default function AdvancedSetting() {
const { config } = useContext(SettingsContext)
Expand Down Expand Up @@ -178,6 +179,8 @@ export default function AdvancedSetting() {

<AllowInstallationBrokenAnticheat />

<AllowProtonExperimental />

<hr />

<div className="advancedSetting">
Expand Down
Loading