Skip to content

Commit 4932e44

Browse files
committed
Merge branch 'main' of https://github.com/HyperPlay-Gaming/hyperplay-desktop-client into feat/retry_auto_update
2 parents 2f0bcef + fbd24d3 commit 4932e44

File tree

12 files changed

+118
-75
lines changed

12 files changed

+118
-75
lines changed

package.json

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
"version": "0.23.2",
44
"private": true,
55
"main": "build/main/main.js",
6+
"productName": "HyperPlay",
67
"homepage": "./",
78
"license": "GPL-3.0-only",
8-
"description": "An Open Source Launcher for Web3, GOG and Epic Games",
9+
"description": "HyperPlay",
910
"repository": {
1011
"type": "Github",
1112
"url": "https://github.com/HyperPlay-Gaming/hyperplay-desktop-client"
@@ -71,8 +72,8 @@
7172
"@fortawesome/react-fontawesome": "^0.2.2",
7273
"@hyperplay/chains": "^0.5.0",
7374
"@hyperplay/check-disk-space": "^3.5.2",
74-
"@hyperplay/quests-ui": "^0.1.13",
75-
"@hyperplay/ui": "^1.8.18",
75+
"@hyperplay/quests-ui": "^0.1.23",
76+
"@hyperplay/ui": "^1.9.8",
7677
"@hyperplay/utils": "^0.3.7",
7778
"@mantine/carousel": "^7.12.0",
7879
"@mantine/core": "^7.12.0",

pnpm-lock.yaml

+30-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/app_icon.icns

1.44 MB
Binary file not shown.

src/backend/ipcHandlers/quests.ts

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ async function fetchQuests({
1919
}): Promise<Quest[]> {
2020
const url = new URL(`${DEV_PORTAL_URL}api/v1/quests`)
2121
url.searchParams.append('questStatus', status)
22+
url.searchParams.append('sortBy', 'start_date')
23+
url.searchParams.append('order', 'desc')
2224
if (projectId) {
2325
url.searchParams.append('projectId', projectId)
2426
}

src/backend/utils/compatibility_layers.ts

+31-19
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,11 @@ export async function initializeCompatibilityLayer() {
597597
initializationTasks.push(downloadDefaultWine())
598598
}
599599

600-
if (isMac) {
601-
initializationTasks.push(checkRosettaInstall())
602-
initializationTasks.push(setGPTKDefaultOnMacOS())
600+
if (isMac || isLinux) {
601+
if (isMac) {
602+
initializationTasks.push(checkRosettaInstall())
603+
}
604+
initializationTasks.push(setDefaultCompatibilityLayer())
603605
}
604606

605607
try {
@@ -616,21 +618,17 @@ export async function downloadDefaultWine() {
616618
if (isWindows) return null
617619

618620
try {
619-
// Refresh wine list
620621
await updateWineVersionInfos(true)
621622

622623
// Get list of available wine versions
623624
const availableWine = wineDownloaderInfoStore.get('wine-releases', [])
624625

625-
// use Wine-GE type if on Linux and GPTK or Wine-Crossover if on Mac
626+
// use Proton-GE type if on Linux and GPTK or Wine-Crossover if on Mac
626627
const isGPTKCompatible = isMac ? await isMacSonomaOrHigher() : false
627628
const results = await Promise.all(
628629
availableWine.map(async (version) => {
629630
if (isLinux) {
630-
return (
631-
version.type === 'Wine-GE' &&
632-
version.version.includes('Wine-GE-Proton')
633-
)
631+
return version.type === 'Proton-GE'
634632
}
635633

636634
if (isMac) {
@@ -705,32 +703,46 @@ export async function downloadDefaultWine() {
705703
}
706704
}
707705

708-
export async function setGPTKDefaultOnMacOS() {
709-
const isGPTKCompatible = await isMacSonomaOrHigher()
710-
if (!isGPTKCompatible) {
706+
export async function setDefaultCompatibilityLayer() {
707+
if (!isMac && !isLinux) {
711708
return
712709
}
713710

711+
// For MacOS, check GPTK compatibility
712+
if (isMac) {
713+
const isGPTKCompatible = await isMacSonomaOrHigher()
714+
if (!isGPTKCompatible) {
715+
return
716+
}
717+
}
718+
714719
const { wineVersion: defaultWine } = GlobalConfig.get().getSettings()
715720

716-
const ignoreList = ['crossover', 'toolkit']
721+
// Get target wine type and prefix name based on platform
722+
const targetType = isMac ? 'toolkit' : 'proton'
723+
const prefixName = isMac ? 'GPTK' : 'Proton'
717724

725+
// Early return if already using target type
726+
const ignoreList = ['crossover', 'toolkit', 'proton']
718727
if (
719728
ignoreList.includes(defaultWine.type.toLowerCase()) ||
720729
defaultWine.name.includes('Toolkit')
721730
) {
722731
return
723732
}
724733

734+
// Find target wine version
725735
const wineList = await GlobalConfig.get().getAlternativeWine()
726-
const gptk = wineList.find((wine) => wine.type === 'toolkit')
736+
const targetWine = wineList.find((wine) => wine.type === targetType)
737+
738+
// Set as default if found and valid
739+
if (targetWine && existsSync(targetWine.bin)) {
740+
logInfo(`Changing wine version to ${targetWine.name}`)
741+
GlobalConfig.get().setSetting('wineVersion', targetWine)
727742

728-
if (gptk && existsSync(gptk.bin)) {
729-
logInfo(`Changing wine version to ${gptk.name}`)
730-
GlobalConfig.get().setSetting('wineVersion', gptk)
731-
// update prefix to use the new one as well
743+
// Update prefix path
732744
const installPath = GlobalConfig.get().getSettings().defaultInstallPath
733-
const newPrefix = join(installPath, 'Prefixes', 'GPTK')
745+
const newPrefix = join(installPath, 'Prefixes', prefixName)
734746
GlobalConfig.get().setSetting('winePrefix', newPrefix)
735747
}
736748
return

src/backend/wine/manager/utils.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const wineDownloaderInfoStore = new TypeCheckedStoreBackend(
2828

2929
async function updateWineVersionInfos(
3030
fetch = false,
31-
count = 50
31+
count = 15
3232
): Promise<WineVersionInfo[]> {
3333
if (isWindows) {
3434
return []

src/frontend/ExtensionManager/index.tsx

+9-1
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,16 @@ const ExtensionManager = function () {
4242
rootRef.current?.close()
4343
}
4444

45+
/**
46+
* @dev We remove the popup/notification windows from the overlay when it is hidden because
47+
* there were performance issues with them running in the background while playing some games like Kokodi.
48+
*/
4549
if (isOverlay) {
46-
return <ExtensionContents />
50+
if (OverlayState.showOverlay) {
51+
return <ExtensionContents />
52+
} else {
53+
return null
54+
}
4755
}
4856

4957
/* eslint-disable react/no-unknown-property */

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

+13-2
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ export default function QuestDetails({
6464
questId,
6565
className,
6666
isQuestsPage,
67-
onPlayClick = () => {}
67+
onPlayClick = () => {},
68+
streakIsProgressing
6869
}: {
6970
questId: number | null
7071
className?: string
7172
isQuestsPage?: boolean
7273
onPlayClick?: (quest: Quest) => void
74+
streakIsProgressing?: boolean
7375
}) {
7476
const { address } = useAccount()
7577
const { isSignedIn, data } = useAuthSession()
@@ -122,7 +124,8 @@ export default function QuestDetails({
122124
POINTS: flags.pointsRewardsClaim,
123125
'EXTERNAL-TASKS': flags.externalTasksRewardsClaim
124126
},
125-
questsOverlayClaimCtaEnabled: flags.questsOverlayClaimCtaEnabled
127+
questsOverlayClaimCtaEnabled: flags.questsOverlayClaimCtaEnabled,
128+
gameplayWalletSectionVisible: false
126129
}}
127130
trackEvent={async (eventPayload) =>
128131
window.api.trackEvent(eventPayload as PossibleMetricPayloads)
@@ -151,6 +154,14 @@ export default function QuestDetails({
151154
isSignedIn={isSignedIn}
152155
isQuestsPage={isQuestsPage}
153156
key={'questDetailsLoading'}
157+
streakIsProgressing={streakIsProgressing}
158+
getActiveWallet={async () => 'getActiveWallet'}
159+
setActiveWallet={async () => ({ success: true, status: 100 })}
160+
getGameplayWallets={async () => []}
161+
updateActiveWallet={async () => {
162+
console.log('updateActiveWallet')
163+
}}
164+
getActiveWalletSignature={async () => ({ message: '', signature: '' })}
154165
/>
155166
)
156167
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ export function QuestsViewer({ projectId: appName }: QuestsViewerProps) {
4949
<QuestDetails
5050
questId={visibleQuestId}
5151
className={styles.detailsWrapper}
52+
streakIsProgressing={true}
5253
/>
5354
</div>
5455
</div>

src/frontend/screens/Library/components/GameCard/index.tsx

+7
Original file line numberDiff line numberDiff line change
@@ -383,6 +383,13 @@ const GameCard = ({
383383
actionDisabled={isLaunching}
384384
alwaysShowInColor={allTilesInColor}
385385
store={runner}
386+
i18n={{
387+
logoTextTooltip: {
388+
hyperplay: { installed: 'HyperPlay', notInstalled: 'HyperPlay' },
389+
epic: { installed: 'Epic', notInstalled: 'Epic' },
390+
gog: { installed: 'GOG', notInstalled: 'GOG' }
391+
}
392+
}}
386393
/>
387394
</Link>
388395
</>

src/frontend/screens/Quests/index.tsx

+11-22
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { useMutation } from '@tanstack/react-query'
1010
import { Runner } from 'common/types'
1111
import { Quest } from '@hyperplay/utils'
1212
import { QuestRewardClaimedToast } from 'frontend/components/UI/QuestRewardClaimedToast'
13-
import { itemType } from '@hyperplay/ui/dist/components/Dropdowns/Dropdown'
1413
import useGetHyperPlayListings from 'frontend/hooks/useGetHyperPlayListings'
1514
import useGetQuests from 'frontend/hooks/useGetQuests'
1615
import {
@@ -41,10 +40,6 @@ export function QuestsPage() {
4140
const searchParam = searchParams.get('search')
4241
const [searchText, setSearchText] = useState(searchParam ?? '')
4342
const [activeFilter, setActiveFilter] = useState<QuestFilter>('all')
44-
const [selectedSort, setSelectedSort] = useState<itemType>({
45-
text: 'Alphabetically (ASC)',
46-
id: 'ALPHA_ASC'
47-
})
4843

4944
useEffect(() => {
5045
window.api.trackScreen('Quests Page')
@@ -123,31 +118,30 @@ export function QuestsPage() {
123118
}
124119
})
125120

126-
const sortedQuests = [...(quests ?? [])].sort((a, b) => {
127-
const sortMultiplier = selectedSort.id === 'ALPHA_ASC' ? 1 : -1
128-
return a.name.localeCompare(b.name) * sortMultiplier
129-
})
130-
131121
const gameTitleMatches = (quest: Quest) => {
132122
const title = listings ? listings[quest.project_id]?.project_meta?.name : ''
133123
return title?.toLowerCase().startsWith(searchText.toLowerCase())
134124
}
135125

136-
const searchFilteredQuests = sortedQuests?.filter((quest) => {
126+
const searchFilteredQuests = quests?.filter((quest) => {
137127
const questTitleMatch = quest.name
138128
.toLowerCase()
139129
.startsWith(searchText.toLowerCase())
140-
return questTitleMatch || gameTitleMatches(quest)
130+
const gameTitleMatch = gameTitleMatches(quest)
131+
const searchByKeywords = searchText
132+
.toLowerCase()
133+
.split(' ')
134+
.some(
135+
(term) =>
136+
quest.name?.toLowerCase().includes(term) ||
137+
quest.description?.toLowerCase().includes(term)
138+
)
139+
return questTitleMatch || gameTitleMatch || searchByKeywords
141140
})
142141

143142
const initialQuestId = searchFilteredQuests?.[0]?.id ?? null
144143
const visibleQuestId = selectedQuestId ?? initialQuestId
145144

146-
const achievementsSortOptions = [
147-
{ text: 'Alphabetically (ASC)', id: 'ALPHA_ASC' },
148-
{ text: 'Alphabetically (DES)', id: 'ALPHA_DES' }
149-
]
150-
151145
const imagesToPreload: string[] = []
152146
const gameElements =
153147
searchFilteredQuests?.map(({ id, project_id, name, ...rest }) => {
@@ -197,11 +191,6 @@ export function QuestsPage() {
197191
<QuestsSummaryTable
198192
games={gameElements}
199193
imagesToPreload={imagesToPreload}
200-
sortProps={{
201-
options: achievementsSortOptions,
202-
selected: selectedSort,
203-
onItemChange: setSelectedSort
204-
}}
205194
filterProps={{ activeFilter, setActiveFilter }}
206195
isFetching={questsResults?.data.isFetching}
207196
isPageLoading={questsResults?.data.isLoading}

0 commit comments

Comments
 (0)