Skip to content

Commit b961856

Browse files
authored
Release 0.3.0 (#384)
* bump 0.3.0 * update submodules * add license_all * only show search bar on library, fix hp games in dropdown * fix store nav bar for hp redirected epic games * add hp launched event
1 parent 7574df1 commit b961856

File tree

8 files changed

+775
-13
lines changed

8 files changed

+775
-13
lines changed

LICENSE_ALL

+725
Large diffs are not rendered by default.

package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hyperplay",
3-
"version": "0.2.3",
3+
"version": "0.3.0",
44
"private": true,
55
"main": "build/electron/main.js",
66
"homepage": "./",
@@ -24,6 +24,9 @@
2424
"!build/bin/*",
2525
"build/bin/legendary.LICENSE"
2626
],
27+
"extraResources": [
28+
"LICENSE_ALL"
29+
],
2730
"asarUnpack": [
2831
"build/app_icon.png",
2932
"build/app_icon.icns",

src/backend/main.ts

+4
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,10 @@ if (!gotTheLock) {
321321
handleProtocol(argv)
322322
})
323323
app.whenReady().then(async () => {
324+
trackEvent({
325+
event: 'HyperPlay Launched'
326+
})
327+
324328
initStoreManagers()
325329

326330
const ses = session.fromPartition(

src/backend/metrics/types.ts

+7
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ export interface GameClosed {
204204
sensitiveProperties?: never
205205
}
206206

207+
export interface HyperPlayLaunched {
208+
event: 'HyperPlay Launched'
209+
properties?: never
210+
sensitiveProperties?: never
211+
}
212+
207213
export type PossibleMetricPayloads =
208214
| MetricsOptIn
209215
| MetricsOptOut
@@ -226,5 +232,6 @@ export type PossibleMetricPayloads =
226232
| DownloadToastInteraction
227233
| GameLaunch
228234
| GameClosed
235+
| HyperPlayLaunched
229236

230237
export type PossibleMetricEventNames = PossibleMetricPayloads['event']

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

+14-3
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,27 @@ function fixFilter(text: string) {
2121
}
2222

2323
export default React.memo(function SearchBar() {
24-
const { handleSearch, filterText, epic, gog, sideloadedLibrary } =
25-
useContext(ContextProvider)
24+
const {
25+
handleSearch,
26+
filterText,
27+
epic,
28+
gog,
29+
sideloadedLibrary,
30+
hyperPlayLibrary
31+
} = useContext(ContextProvider)
2632
const { t } = useTranslation()
2733
const navigate = useNavigate()
2834

2935
const input = useRef<HTMLInputElement>(null)
3036

3137
const list = useMemo(() => {
3238
const library = new Set(
33-
[...epic.library, ...gog.library, ...sideloadedLibrary]
39+
[
40+
...epic.library,
41+
...gog.library,
42+
...sideloadedLibrary,
43+
...hyperPlayLibrary
44+
]
3445
.filter(Boolean)
3546
.map((g) => g.title)
3647
.sort()

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

+19-7
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,21 @@ const TopNavBar = observer(() => {
1616

1717
const { showMetaMaskBrowserSidebarLinks } = useContext(ContextProvider)
1818
const [badgeText, setBadgeText] = useState('0')
19-
const { pathname } = useLocation()
19+
const { pathname, search } = useLocation()
2020
const pagesToShowStoreNavOptions = [
2121
'/hyperplaystore',
2222
'/gogstore',
23-
'/epicstore'
23+
'/epicstore',
24+
'/store-page/'
2425
]
26+
const searchParams = new URLSearchParams(search)
27+
const queryParam = searchParams.get('store-url')
28+
let isEpicStore = false
29+
if (queryParam !== null) {
30+
const storeUrl = new URL(queryParam)
31+
isEpicStore = storeUrl.host === 'store.epicgames.com'
32+
}
33+
2534
const showStoreNavOptions = pagesToShowStoreNavOptions.includes(pathname)
2635

2736
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
@@ -36,10 +45,13 @@ const TopNavBar = observer(() => {
3645
removeHandleSetBadgeText()
3746
}
3847
}, [])
39-
function getStoreTextStyle(storePath: string) {
40-
return {
41-
color: pathname === storePath ? '' : 'var(--color-neutral-400)'
48+
function getStoreTextStyle(storePath: string, isActive?: boolean) {
49+
const inactiveStyle = { color: 'var(--color-neutral-400)' }
50+
const activeStyle = { color: '' }
51+
if (isActive !== undefined && isActive) {
52+
return activeStyle
4253
}
54+
return pathname === storePath ? activeStyle : inactiveStyle
4355
}
4456
return (
4557
<div className={styles.navBar}>
@@ -70,7 +82,7 @@ const TopNavBar = observer(() => {
7082
<Button
7183
type="link"
7284
size="small"
73-
style={getStoreTextStyle('/epicstore')}
85+
style={getStoreTextStyle('/epicstore', isEpicStore)}
7486
>
7587
{t('Epic Games', 'Epic Games')}
7688
</Button>
@@ -88,7 +100,7 @@ const TopNavBar = observer(() => {
88100
)}
89101
</div>
90102
<div>
91-
<SearchBar />
103+
{pathname === '/library' ? <SearchBar /> : null}
92104
{showMetaMaskBrowserSidebarLinks && (
93105
<button
94106
className={styles.iconButton}

0 commit comments

Comments
 (0)