Skip to content

Commit 3e730bf

Browse files
committed
2 parents 98ff39b + a679ce9 commit 3e730bf

File tree

14 files changed

+400
-335
lines changed

14 files changed

+400
-335
lines changed

electron/launcher.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { execAsync, isEpicServiceOffline, isOnline } from './utils'
1919
import { logError, logInfo, LogPrefix, logWarning } from './logger/logger'
2020
import { GlobalConfig } from './config'
2121
import { GameConfig } from './game_config'
22-
import { DXVK } from './dxvk'
22+
import { DXVK } from './tools'
2323
import { Runner } from './types'
2424
import { GOGLibrary } from './gog/library'
2525
import { LegendaryLibrary } from './legendary/library'

electron/main.ts

+6-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import Backend from 'i18next-fs-backend'
3131
import i18next from 'i18next'
3232
import { join } from 'path'
3333

34-
import { DXVK } from './dxvk'
34+
import { DXVK, Winetricks } from './tools'
3535
import { Game } from './games'
3636
import { GameConfig } from './game_config'
3737
import { GlobalConfig } from './config'
@@ -76,7 +76,8 @@ import {
7676
wikiLink,
7777
legendaryPath,
7878
gogdlPath,
79-
legendary
79+
legendary,
80+
heroicToolsPath
8081
} from './constants'
8182
import { handleProtocol } from './protocol'
8283
import { logError, logInfo, LogPrefix, logWarning } from './logger/logger'
@@ -138,6 +139,7 @@ async function createWindow(): Promise<BrowserWindow> {
138139
setTimeout(() => {
139140
if (process.platform === 'linux') {
140141
DXVK.getLatest()
142+
Winetricks.download()
141143
}
142144
}, 2500)
143145

@@ -487,6 +489,7 @@ ipcMain.handle(
487489
const newProtonWinePath = wine.replace("proton'", "files/bin/wine64'")
488490
const oldProtonWinePath = wine.replace("proton'", "dist/bin/wine64'")
489491
const isProton = wine.includes('proton')
492+
const winetricks = `${heroicToolsPath}/winetricks`
490493

491494
// existsSync is weird because it returns false always if the path has single-quotes in it
492495
const protonWinePath = existsSync(newProtonWinePath.replaceAll("'", ''))
@@ -514,7 +517,7 @@ ipcMain.handle(
514517
}
515518

516519
let command = `WINE=${wineBin} WINEPREFIX='${winePrefix}' ${
517-
tool === 'winecfg' ? `${wineBin} ${tool}` : tool
520+
tool === 'winecfg' ? `${wineBin} ${tool}` : winetricks
518521
}`
519522

520523
if (tool === 'runExe') {

electron/dxvk.ts renamed to electron/tools.ts

+22
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,25 @@ export const DXVK = {
179179
})
180180
}
181181
}
182+
183+
export const Winetricks = {
184+
download: () => {
185+
const url =
186+
'https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks'
187+
const path = `${heroicToolsPath}/winetricks`
188+
const downloadCommand = `curl -L ${url} -o ${path} --create-dirs`
189+
190+
if (existsSync(path)) {
191+
return
192+
}
193+
194+
return execAsync(downloadCommand)
195+
.then(() => {
196+
exec(`chmod +x ${path}`)
197+
logInfo('Downloaded Winetricks', LogPrefix.Backend)
198+
})
199+
.catch(() => {
200+
logError('Error Downloading Winetricks', LogPrefix.Backend)
201+
})
202+
}
203+
}

flatpak/local.heroic.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ modules:
103103
- name: heroic
104104
buildsystem: simple
105105
build-commands:
106-
- unappimage Heroic-2.2.5.AppImage
107-
- rm Heroic-2.2.5.AppImage
106+
- unappimage Heroic-2.2.6.AppImage
107+
- rm Heroic-2.2.6.AppImage
108108
- mv squashfs-root /app/bin/heroic
109109
- install -D heroic-run -t /app/bin
110110
sources:
@@ -114,9 +114,9 @@ modules:
114114
- zypak-wrapper /app/bin/heroic/heroic "$@"
115115

116116
- type: file
117-
filename: Heroic-2.2.5.AppImage
117+
filename: Heroic-2.2.6.AppImage
118118
# put right path here
119-
path: ../dist/Heroic-2.2.5.AppImage
119+
path: ../dist/Heroic-2.2.6.AppImage
120120

121121
- name: platform-bootstrap
122122
buildsystem: simple

public/locales/en/translation.json

+8
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,9 @@
108108
"globalSettings": "Global Settings",
109109
"GOG": "GOG",
110110
"gog-store": "GOG Store",
111+
"header": {
112+
"platform": "Platform"
113+
},
111114
"help": {
112115
"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.",
113116
"other": {
@@ -197,6 +200,11 @@
197200
"alt-legendary-bin": "Using built-in Legendary binary...",
198201
"egs-prefix": "Prefix where EGS is installed"
199202
},
203+
"platforms": {
204+
"linux": "Linux",
205+
"mac": "Mac",
206+
"win": "Windows"
207+
},
200208
"Plugins": "Plugins",
201209
"Projects": "Projects",
202210
"Ready": "Ready",

src/App.tsx

+1-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,7 @@ function App() {
4343
<Route exact path="/">
4444
{user && (
4545
<>
46-
<Header
47-
goTo={''}
48-
renderBackButton={false}
49-
numberOfGames={numberOfGames}
50-
/>
46+
<Header numberOfGames={numberOfGames} />
5147
<div className="listing">
5248
<span id="top" />
5349
{showRecentGames && (
+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
.FormControl {
2+
position: relative;
3+
display: inline-flex;
4+
}
5+
6+
.FormControl__button,
7+
.FormControl__select,
8+
.FormControl__input {
9+
width: 100%;
10+
appearance: none;
11+
height: 40px;
12+
background: var(--input-background);
13+
border-radius: 10px;
14+
font: var(--font-secondary-bold);
15+
color: var(--text-secondary);
16+
padding: 0 22px;
17+
border: none;
18+
outline: none;
19+
box-shadow: 0 4px 4px rgb(0 0 0 / 25%);
20+
transition: color 250ms;
21+
}
22+
23+
.FormControl__button:focus-visible,
24+
.FormControl__select:focus-visible,
25+
.FormControl__input:focus-visible {
26+
outline: none;
27+
box-shadow: var(--accent) 0 0 0 2px inset;
28+
}
29+
30+
.FormControl__select,
31+
.FormControl__input {
32+
font-size: 16px;
33+
line-height: 19px;
34+
}
35+
36+
.FormControl__input::placeholder {
37+
color: var(--text-secondary);
38+
opacity: 0.7;
39+
}
40+
41+
.FormControl__button:disabled,
42+
.FormControl__select:disabled,
43+
.FormControl__input:disabled {
44+
cursor: default;
45+
color: var(--text-secondary);
46+
opacity: 0.5;
47+
}
48+
49+
.FormControl--clearable > input {
50+
padding-right: 40px;
51+
}
52+
53+
.FormControl--select > select {
54+
cursor: pointer;
55+
padding-right: 40px;
56+
}
57+
58+
.FormControl--segmented > button {
59+
box-sizing: border-box;
60+
height: 100%;
61+
padding: 0 10px;
62+
cursor: pointer;
63+
font-size: 14px;
64+
text-transform: uppercase;
65+
font-weight: 600;
66+
color: var(--text-default);
67+
}
68+
69+
.FormControl--segmented > button:not(:disabled):hover {
70+
color: var(--text-hover);
71+
}
72+
73+
.FormControl--segmented > button:not(.non-important):active,
74+
.FormControl--segmented > button:not(.non-important).active {
75+
color: var(--accent);
76+
}
77+
78+
.FormControl--segmented > button:not(:first-child) {
79+
border-top-left-radius: 0;
80+
border-bottom-left-radius: 0;
81+
margin-left: 1px;
82+
}
83+
84+
.FormControl--segmented > button:not(:last-child) {
85+
border-top-right-radius: 0;
86+
border-bottom-right-radius: 0;
87+
}
88+
89+
.FormControl__segmentedFaIcon {
90+
font-size: 20px;
91+
outline: none;
92+
}
93+
94+
.FormControl__caret,
95+
.FormControl__clear {
96+
position: absolute;
97+
right: 16px;
98+
top: 50%;
99+
transform: translate(0, -50%);
100+
transition: color 250ms;
101+
}
102+
103+
.FormControl__caret {
104+
pointer-events: none;
105+
}
106+
107+
.FormControl__clear {
108+
cursor: pointer;
109+
}
110+
111+
.FormControl__clear:hover {
112+
color: var(--text-hover);
113+
}
114+
115+
.FormControl__clear:active {
116+
color: var(--accent);
117+
}
118+
119+
.FormControl__input:disabled ~ .FormControl__clear,
120+
.FormControl__input:placeholder-shown ~ .FormControl__clear {
121+
display: none;
122+
}
123+
124+
.FormControl__select:hover + .FormControl__caret {
125+
color: var(--text-hover);
126+
}
127+
128+
.FormControl__select:disabled + .FormControl__caret {
129+
color: var(--text-secondary);
130+
opacity: 0.5;
131+
}
132+
133+
.FormControl option {
134+
background: var(--background-color);
135+
}
136+
137+
.FormControl option:checked {
138+
color: var(--accent);
139+
}
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { faCaretDown, faXmark } from '@fortawesome/free-solid-svg-icons'
2+
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
3+
import cx from 'classnames'
4+
import React from 'react'
5+
import './index.css'
6+
7+
export interface FormControlProps {
8+
className?: string
9+
select?: boolean
10+
segmented?: boolean
11+
onClear?: () => void
12+
}
13+
14+
const FormControl: React.FC<FormControlProps> = ({
15+
children,
16+
className = undefined,
17+
select = false,
18+
segmented = false,
19+
onClear = undefined
20+
}) => {
21+
return (
22+
<div
23+
className={cx('FormControl', className, {
24+
'FormControl--select': select,
25+
'FormControl--segmented': segmented,
26+
'FormControl--clearable': !!onClear
27+
})}
28+
>
29+
{children}
30+
{select && (
31+
<span className="FormControl__caret">
32+
<FontAwesomeIcon icon={faCaretDown} />
33+
</span>
34+
)}
35+
{onClear && (
36+
<span className="FormControl__clear" onClick={onClear} tabIndex={-1}>
37+
<FontAwesomeIcon icon={faXmark} />
38+
</span>
39+
)}
40+
</div>
41+
)
42+
}
43+
44+
export default FormControl

0 commit comments

Comments
 (0)