diff --git a/public/locales/en/gamepage.json b/public/locales/en/gamepage.json index f31785437d..c821d24450 100644 --- a/public/locales/en/gamepage.json +++ b/public/locales/en/gamepage.json @@ -51,6 +51,8 @@ }, "button": { "add_to_favourites": "Add To Favourites", + "browse_files": "Browse Files", + "browse_wine_prefix": "Browse Wine Prefix", "cancel": "Pause/Cancel", "changelog": "Show Changelog", "continue": "Continue Download", diff --git a/src/frontend/screens/Game/GamePage/index.tsx b/src/frontend/screens/Game/GamePage/index.tsx index 0e0e181491..6069c5291d 100644 --- a/src/frontend/screens/Game/GamePage/index.tsx +++ b/src/frontend/screens/Game/GamePage/index.tsx @@ -300,7 +300,7 @@ export default React.memo(function GamePage(): JSX.Element | null { } const isMacNative = ['osx', 'Mac'].includes(installPlatform ?? '') - const isLinuxNative = installPlatform === 'linux' + const isLinuxNative = ['linux', 'Linux'].includes(installPlatform ?? '') // create setting context functions const contextValues: GameContextType = { diff --git a/src/frontend/screens/Game/GameSubMenu/index.tsx b/src/frontend/screens/Game/GameSubMenu/index.tsx index 3845cd0b46..2cc41cb9ee 100644 --- a/src/frontend/screens/Game/GameSubMenu/index.tsx +++ b/src/frontend/screens/Game/GameSubMenu/index.tsx @@ -1,6 +1,6 @@ import './index.css' -import React, { useContext, useEffect, useState } from 'react' +import React, { useCallback, useContext, useEffect, useState } from 'react' import { GameInfo, GameStatus, Runner } from 'common/types' @@ -50,7 +50,7 @@ export default function GamesSubmenu({ showDialogModal, setIsSettingsModalOpen } = useContext(ContextProvider) - const { is } = useContext(GameContext) + const { is, gameSettings } = useContext(GameContext) const isWin = platform === 'win32' const isLinux = platform === 'linux' @@ -233,6 +233,25 @@ export default function GamesSubmenu({ isInstalled && !isThirdPartyManaged + const hasWine = + !is.win && !is.native && gameSettings?.wineVersion.type !== 'crossover' + + const onBrowseFiles = useCallback(() => { + const path = gameInfo.install.install_path || gameInfo.folder_name + + if (path) { + window.api.openFolder(path) + } + }, [gameInfo]) + + const onBrowsePrefix = useCallback(() => { + const path = gameSettings?.winePrefix + + if (path) { + window.api.openFolder(path) + } + }, [gameSettings]) + return ( <>
@@ -377,6 +396,22 @@ export default function GamesSubmenu({ {t('game.modify', 'Modify Installation')} )} + {isInstalled && ( + + )} + {hasWine && ( + + )}
{showModal && (