Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 3 additions & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@
},
"general": "Sync with EGL if you have a working installation of the Epic Games Launcher elsewhere and want to import your games to avoid downloading them again.",
"mangohud": "MangoHUD is an overlay that displays and monitors FPS, temperatures, CPU/GPU load and other system resources.",
"max_workers": {
"info": "Limits download speed. This sets the maximum number of parallel download chunks. High numbers can lead to high CPU usage."
},
"msync": "Msync aims to reduce wineserver overhead in CPU-intensive games. Enabling may improve performance on supported Linux kernels.",
"other": {
"part4": "Use the ",
Expand Down
51 changes: 37 additions & 14 deletions src/frontend/screens/Settings/components/MaxWorkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { useTranslation } from 'react-i18next'
import { SelectField } from 'frontend/components/UI'
import useSetting from 'frontend/hooks/useSetting'
import { MenuItem } from '@mui/material'
import { hasHelp } from 'frontend/hooks/hasHelp'
import InfoIcon from 'frontend/components/UI/InfoIcon'

const MaxWorkers = () => {
const { t } = useTranslation()
Expand All @@ -17,23 +19,44 @@ const MaxWorkers = () => {
getMoreInfo()
}, [maxWorkers])

const helpContent = t(
'help.max_workers.info',
'Limits download speed. This sets the maximum number of parallel download chunks. High numbers can lead to high CPU usage.'
Comment thread
Ishidawg marked this conversation as resolved.
Outdated
)

hasHelp(
'maxWorkers',
t('setting.maxworkers', 'Maximum Number of Workers when downloading'),
<p>{helpContent}</p>
)

return (
<SelectField
htmlId="max_workers"
label={t('setting.maxworkers')}
onChange={(event) => setMaxWorkers(Number(event.target.value))}
value={maxWorkers.toString()}
extraClass="smaller"
<div
style={{
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'flex-end'
}}
>
{Array.from(Array(maxCpus).keys()).map((n) => (
<MenuItem key={n + 1} value={n + 1}>
{n + 1}
<SelectField
htmlId="max_workers"
label={t('setting.maxworkers')}
onChange={(event) => setMaxWorkers(Number(event.target.value))}
value={maxWorkers.toString()}
extraClass="smaller"
>
{Array.from(Array(maxCpus).keys()).map((n) => (
<MenuItem key={n + 1} value={n + 1}>
{n + 1}
</MenuItem>
))}
<MenuItem key={0} value={0}>
Max
</MenuItem>
))}
<MenuItem key={0} value={0}>
Max
</MenuItem>
</SelectField>
</SelectField>
<InfoIcon text={helpContent} />
</div>
)
}

Expand Down
Loading