Skip to content

Commit f8b77ff

Browse files
committed
tech: install and play from gamecard and gamepage
1 parent 8170bed commit f8b77ff

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

src/frontend/screens/Game/GamePage/index.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ export default observer(function GamePage(): React.JSX.Element | null {
125125
const isLinux = platform === 'linux'
126126
const isMac = platform === 'darwin'
127127
const isSideloaded = runner === 'sideload'
128+
const isSteam = runner === 'steam'
128129

129130
const isInstalling = DMQueueState.isInstalling(appName)
130131
const isPlaying = status === 'playing'
@@ -249,7 +250,7 @@ export default observer(function GamePage(): React.JSX.Element | null {
249250
runner === 'hyperplay' ? hpPlatforms : othersPlatforms
250251

251252
if (
252-
runner !== 'sideload' &&
253+
!['sideload', 'steam'].includes(runner) &&
253254
!notSupportedGame &&
254255
!notInstallable &&
255256
!isOffline
@@ -931,7 +932,10 @@ export default observer(function GamePage(): React.JSX.Element | null {
931932
}
932933

933934
async function mainAction(is_installed: boolean) {
934-
// TODO: Add a way to pause download from the game page
935+
if (isSteam) {
936+
window.api.openExternalUrl(`steam://install/${appName}`)
937+
return
938+
}
935939

936940
// resume download
937941
if (isPaused) {

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,10 +434,14 @@ const GameCard = ({
434434
)
435435

436436
async function mainAction(runner: Runner) {
437+
if (runner === 'steam') {
438+
window.api.openExternalUrl(`steam://install/${appName}`)
439+
return
440+
}
441+
437442
if (isInstalling || isExtracting || isPaused) {
438443
return setShowStopInstallModal(true)
439444
}
440-
441445
// ask to install if the game is not installed
442446
if (!isInstalled && !isQueued && gameInfo.runner !== 'sideload') {
443447
return install({

0 commit comments

Comments
 (0)