Skip to content

Commit ac374ca

Browse files
[UI] Cleanup App and Game Settings (#1055)
* ui: remove set all titles in color setting * ui: disable anticheat and ignore updates for hyperplay games * ui: remove altgogdl and altlegendary settings * ui: disable DisableController setting * ui: use TextInput from HP-UI for TextInputField * fix: EGS sync button * Revert "ui: remove set all titles in color setting" This reverts commit 7e9b60b. * fix: lint * Revert "ui: use TextInput from HP-UI for TextInputField" This reverts commit 3658530. * fix: don't show Epic Overlay settings on macOS * i18n: updated keys --------- Co-authored-by: Flavio F Lima <[email protected]> Co-authored-by: Brett <[email protected]>
1 parent 8af3e95 commit ac374ca

File tree

15 files changed

+147
-335
lines changed

15 files changed

+147
-335
lines changed

public/locales/en/translation.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
},
3636
"choose": "Choose",
3737
"choose-egs-prefix": "Choose Prefix where EGS is installed",
38-
"choose-gogdl-binary": "Select GOGDL Binary (needs restart)",
39-
"choose-legendary-binary": "Select Legendary binary",
4038
"customWine": "Select the Wine or Proton binary",
4139
"default-install-path": "Choose Default Install Path",
4240
"default-steam-path": "Steam path.",
@@ -710,8 +708,6 @@
710708
}
711709
},
712710
"other": {
713-
"gogdl-version": "GOGDL Version: ",
714-
"legendary-version": "Legendary Version: ",
715711
"weblate": "Help Translate HyperPlay."
716712
},
717713
"Other": "Other",
@@ -729,8 +725,6 @@
729725
"WALLET_DISCONNECTED": "You do not have a wallet connected to HyperPlay."
730726
},
731727
"placeholder": {
732-
"alt-gogdl-bin": "Using built-in GOGDL binary...",
733-
"alt-legendary-bin": "Using built-in Legendary binary...",
734728
"custom_themes_path": "Select the path to look for custom CSS files",
735729
"dxvkfpsvalue": "Positive integer value (e.g. 30, 60, ...)",
736730
"egs-prefix": "Prefix where EGS is installed",
@@ -823,8 +817,6 @@
823817
"addgamestoapplications": "Add games to Applications automatically",
824818
"addgamestostartmenu": "Add games to start menu automatically",
825819
"addgamestosteam": "Add games to Steam automatically",
826-
"alt-gogdl-bin": "Choose an Alternative GOGDL Binary to use",
827-
"alt-legendary-bin": "Choose an Alternative Legendary Binary",
828820
"autodxvk": "Auto Install/Update DXVK on Prefix",
829821
"autodxvknvapi": "Auto Install/Update DXVK-NVAPI on Prefix",
830822
"autoLaunchHyperPlay": "Auto Launch HyperPlay",

src/backend/utils.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -419,20 +419,12 @@ function splitPathAndName(fullPath: string): { dir: string; bin: string } {
419419
}
420420

421421
function getLegendaryBin(): { dir: string; bin: string } {
422-
const settings = GlobalConfig.get().getSettings()
423-
if (settings?.altLegendaryBin) {
424-
return splitPathAndName(settings.altLegendaryBin)
425-
}
426422
return splitPathAndName(
427423
fixAsarPath(join(publicDir, 'bin', process.platform, 'legendary'))
428424
)
429425
}
430426

431427
function getGOGdlBin(): { dir: string; bin: string } {
432-
const settings = GlobalConfig.get().getSettings()
433-
if (settings?.altGogdlBin) {
434-
return splitPathAndName(settings.altGogdlBin)
435-
}
436428
return splitPathAndName(
437429
fixAsarPath(join(publicDir, 'bin', process.platform, 'gogdl'))
438430
)

src/common/types.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ export interface AppSettings extends GameSettings {
8282
addDesktopShortcuts: boolean
8383
addStartMenuShortcuts: boolean
8484
addSteamShortcuts: boolean
85-
altGogdlBin: string
86-
altLegendaryBin: string
8785
autoUpdateGames: boolean
8886
checkForUpdatesOnStartup: boolean
8987
autoLaunchHyperPlay: boolean

src/frontend/components/UI/TextInputField/index.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
.textInputFieldWrapper.withRightButton {
2-
grid-template-areas: 'label label' 'input button';
2+
display: grid;
3+
grid-template-areas: 'input after';
34
grid-template-columns: auto min-content;
45
grid-column-gap: var(--space-xs-fixed);
56
}
67

7-
.textInputFieldWrapper.withRightButton .rightButton {
8-
grid-area: button;
8+
.textInputFieldWrapper.withRightButton .afterInput {
9+
grid-area: after;
910
}
1011

1112
.textInputFieldWrapper .smallMessage {

src/frontend/components/UI/TextInputField/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ const TextInputField = ({
6363
label={label}
6464
{...textInputProps}
6565
/>
66-
{value && warning}
67-
{afterInput}
66+
{afterInput && <span className="afterInput">{afterInput}</span>}
67+
{value && <span className="smallMessage">{value && warning}</span>}
6868
</div>
6969
)
7070
}

src/frontend/screens/Settings/components/AltGOGdlBin.tsx

Lines changed: 0 additions & 87 deletions
This file was deleted.

src/frontend/screens/Settings/components/AltLegendaryBin.tsx

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/frontend/screens/Settings/components/BattlEyeRuntime.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
import React, { useState } from 'react'
1+
import React, { useContext, useState } from 'react'
22
import { useTranslation } from 'react-i18next'
33
import { ToggleSwitch } from 'frontend/components/UI'
44
import useSetting from 'frontend/hooks/useSetting'
55
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
66
import { faSyncAlt } from '@fortawesome/free-solid-svg-icons'
7+
import SettingsContext from '../SettingsContext'
78

89
const BattlEyeRuntime = () => {
910
const { t } = useTranslation()
@@ -13,6 +14,12 @@ const BattlEyeRuntime = () => {
1314
false
1415
)
1516

17+
const { gameInfo } = useContext(SettingsContext)
18+
19+
if (gameInfo?.runner === 'hyperplay') {
20+
return null
21+
}
22+
1623
const handleBattlEyeRuntime = async () => {
1724
if (!battlEyeRuntime) {
1825
const isInstalled = await window.api.isRuntimeInstalled(

src/frontend/screens/Settings/components/EacRuntime.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,19 @@ import useSetting from 'frontend/hooks/useSetting'
55
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
66
import { faSyncAlt } from '@fortawesome/free-solid-svg-icons'
77
import ContextProvider from 'frontend/state/ContextProvider'
8+
import SettingsContext from '../SettingsContext'
89

910
const EacRuntime = () => {
1011
const { t } = useTranslation()
1112
const [installing, setInstalling] = useState(false)
1213
const [eacRuntime, setEacRuntime] = useSetting('eacRuntime', false)
1314
const [useGameMode, setUseGameMode] = useSetting('useGameMode', false)
1415
const { showDialogModal } = useContext(ContextProvider)
16+
const { gameInfo } = useContext(SettingsContext)
17+
18+
if (gameInfo?.runner === 'hyperplay') {
19+
return null
20+
}
1521

1622
const handleEacRuntime = async () => {
1723
if (!eacRuntime) {

src/frontend/screens/Settings/components/EgsSettings.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
ToggleSwitch
1313
} from 'frontend/components/UI'
1414
import libraryState from 'frontend/state/libraryState'
15+
import { Button } from '@hyperplay/ui'
1516

1617
const EgsSettings = () => {
1718
const { t } = useTranslation()
@@ -113,17 +114,11 @@ const EgsSettings = () => {
113114
afterInput={
114115
<>
115116
<span className="rightButton">
116-
<button
117+
<Button
117118
data-testid="syncButton"
118119
onClick={async () => handleSync()}
119120
disabled={isSyncing || !egsPath.length}
120-
className={`button is-small ${
121-
isLinked
122-
? 'is-danger'
123-
: isSyncing
124-
? 'is-primary'
125-
: 'settings'
126-
}`}
121+
style={{ display: 'flex', marginTop: '27px' }}
127122
>
128123
{`${
129124
isLinked
@@ -132,17 +127,17 @@ const EgsSettings = () => {
132127
? t('button.syncing')
133128
: t('button.sync')
134129
}`}
135-
</button>
130+
</Button>
136131
</span>
137-
<div>
138-
{!isWindows && (
139-
<InfoBox text="infobox.help">{t('help.general')}</InfoBox>
140-
)}
141-
</div>
142132
</>
143133
}
144134
/>
145135
)}
136+
<div>
137+
{!isWindows && (
138+
<InfoBox text="infobox.help">{t('help.general')}</InfoBox>
139+
)}
140+
</div>
146141
{isWindows && (
147142
<ToggleSwitch
148143
htmlId="syncToggle"

0 commit comments

Comments
 (0)