Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main'
Browse files Browse the repository at this point in the history
  • Loading branch information
weblate committed Dec 9, 2024
2 parents df0d4b9 + 583f1e3 commit ef0f4f6
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ function SettingsModal({ gameInfo, type }: Props) {
</DialogHeader>
<DialogContent className="settingsDialogContent">
<SettingsContext.Provider value={contextValues}>
{type === 'settings' ? <GamesSettings useDetails /> : <LogSettings />}
{type === 'settings' ? <GamesSettings /> : <LogSettings />}
</SettingsContext.Provider>
</DialogContent>
</Dialog>
Expand Down
2 changes: 1 addition & 1 deletion src/frontend/screens/Settings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function Settings() {
<GeneralSettings />
</Tabs.Panel>
<Tabs.Panel value="gamesSettings">
<GamesSettings useDetails={false} />
<GamesSettings />
</Tabs.Panel>
<Tabs.Panel value="advSettings">
<AdvancedSettings />
Expand Down
20 changes: 2 additions & 18 deletions src/frontend/screens/Settings/sections/GamesSettings/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,6 @@
}
}

// details, should have an hover effect and a pointer cursor and also the summary should be bold and have a background color
details {
cursor: pointer;
width: 100%;

button,
.button {
display: flex;
justify-content: center;
align-content: center;
align-items: center;
}

summary {
font-weight: bold;
padding: var(--space-xs) 0;
font-size: var(--text-xl);
}
.tabsList {
padding: var(--space-md) 0;
}
149 changes: 65 additions & 84 deletions src/frontend/screens/Settings/sections/GamesSettings/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,15 @@ import {
import ContextProvider from 'frontend/state/ContextProvider'
import Tools from '../../components/Tools'
import SettingsContext from '../../SettingsContext'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import useSetting from 'frontend/hooks/useSetting'
import { defaultWineVersion } from '../..'
import Collapsible from 'frontend/components/UI/Collapsible/Collapsible'
import SyncSaves from '../SyncSaves'
import EnableDXVKFpsLimit from '../../components/EnableDXVKFpsLimit'
import { Tabs, getTabsClassNames } from '@hyperplay/ui'
import { faInfoCircle } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'

type Props = {
useDetails?: boolean
}

export default function GamesSettings({ useDetails = true }: Props) {
export default function GamesSettings() {
const { t } = useTranslation()
const { platform } = useContext(ContextProvider)
const { isDefault, gameInfo } = useContext(SettingsContext)
Expand Down Expand Up @@ -87,100 +83,85 @@ export default function GamesSettings({ useDetails = true }: Props) {
)}
</p>
)}

{showCrossPlatformOptions && (
<>
<Collapsible
isOpen
isCollapsible={useDetails}
summary={isLinux ? 'Wine' : 'Wine/Crossover'}
>
<Tabs
defaultValue={showCrossPlatformOptions ? 'wine' : 'other'}
classNames={getTabsClassNames(
{ list: 'settingsTabList' },
{ list: 'outline' }
)}
>
<Tabs.List className="tabsList">
{showCrossPlatformOptions && (
<Tabs.Tab value="wine">
{isLinux ? 'Wine' : 'Wine/Crossover'}
</Tabs.Tab>
)}
<Tabs.Tab value="other">
{showCrossPlatformOptions
? t('settings.navbar.other', 'Other')
: t('settings.navbar.advanced', 'Advanced')}
</Tabs.Tab>
{hasCloudSaves && (
<Tabs.Tab value="sync">
{t('settings.navbar.sync', 'Cloud Saves Sync')}
</Tabs.Tab>
)}
</Tabs.List>
{showCrossPlatformOptions && (
<Tabs.Panel value="wine">
<WineVersionSelector />
<WinePrefix />
<CrossoverBottle />

{!isCrossover && (
<>
<AutoDXVK />
{isLinux && (
<>
<AutoDXVKNVAPI />

<AutoVKD3D />

<EacRuntime />

<BattlEyeRuntime />
</>
)}
<Tools />
</>
)}
</Collapsible>
</>
)}

<Collapsible
isOpen={nativeGame}
isCollapsible={useDetails}
summary={
showCrossPlatformOptions
? t('settings.navbar.other', 'Other')
: t('settings.navbar.advanced', 'Advanced')
}
>
<AlternativeExe />

<ShowFPS />

{showCrossPlatformOptions && <EnableDXVKFpsLimit />}

{showCrossPlatformOptions && (
<>
<EnableEsync />
<EnableMsync />
{isLinux && (
<>
<EnableFsync />

<PreferSystemLibs />

<EnableFSR />

<GameMode />
</>
)}
</>
</Tabs.Panel>
)}

<UseDGPU />

{isLinux && <Mangohud />}

<SteamRuntime />

<IgnoreGameUpdates />

<OfflineMode />

<EnvVariablesTable />

<WrappersTable />

<LauncherArgs />

<PreferedLanguage />
</Collapsible>

{hasCloudSaves && (
<Collapsible
isOpen={false}
isCollapsible={useDetails}
summary={t('settings.navbar.sync', 'Cloud Saves Sync')}
>
<SyncSaves />
</Collapsible>
)}
<Tabs.Panel value="other">
<AlternativeExe />
<ShowFPS />
{showCrossPlatformOptions && <EnableDXVKFpsLimit />}
{showCrossPlatformOptions && (
<>
<EnableEsync />
<EnableMsync />
{isLinux && (
<>
<EnableFsync />
<PreferSystemLibs />
<EnableFSR />
<GameMode />
</>
)}
</>
)}
<UseDGPU />
{isLinux && <Mangohud />}
<SteamRuntime />
<IgnoreGameUpdates />
<OfflineMode />
<EnvVariablesTable />
<WrappersTable />
<LauncherArgs />
<PreferedLanguage />
</Tabs.Panel>
{hasCloudSaves && (
<Tabs.Panel value="sync">
<SyncSaves />
</Tabs.Panel>
)}
</Tabs>
</>
)
}

0 comments on commit ef0f4f6

Please sign in to comment.