From 0c09bbce7a698d5034756e3ad549eea664a941de Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Sun, 1 Oct 2023 20:08:45 +0100 Subject: [PATCH 01/16] [UI/UX] Use Tabs on Game Settings --- .../components/SettingsModal/index.scss | 2 +- .../components/SettingsModal/index.tsx | 2 +- src/frontend/screens/Settings/index.tsx | 2 +- .../sections/GamesSettings/index.scss | 20 +++ .../Settings/sections/GamesSettings/index.tsx | 154 ++++++++++-------- 5 files changed, 105 insertions(+), 75 deletions(-) diff --git a/src/frontend/screens/Settings/components/SettingsModal/index.scss b/src/frontend/screens/Settings/components/SettingsModal/index.scss index eb7d819789..33788204f9 100644 --- a/src/frontend/screens/Settings/components/SettingsModal/index.scss +++ b/src/frontend/screens/Settings/components/SettingsModal/index.scss @@ -2,8 +2,8 @@ width: 65vw; display: flex; flex-direction: column; - justify-content: space-between; max-width: 800px; + min-height: 50vh; .log-box { width: 100%; diff --git a/src/frontend/screens/Settings/components/SettingsModal/index.tsx b/src/frontend/screens/Settings/components/SettingsModal/index.tsx index 1af5db7173..7096cc14a3 100644 --- a/src/frontend/screens/Settings/components/SettingsModal/index.tsx +++ b/src/frontend/screens/Settings/components/SettingsModal/index.tsx @@ -51,7 +51,7 @@ function SettingsModal({ gameInfo, type }: Props) { - {type === 'settings' ? : } + {type === 'settings' ? : } diff --git a/src/frontend/screens/Settings/index.tsx b/src/frontend/screens/Settings/index.tsx index dd85697ee3..182bc22568 100644 --- a/src/frontend/screens/Settings/index.tsx +++ b/src/frontend/screens/Settings/index.tsx @@ -121,7 +121,7 @@ function Settings() { {isGeneralSettings && } - {isGamesSettings && } + {isGamesSettings && } {isSyncSettings && } {isAdvancedSetting && } {isLogSettings && } diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.scss b/src/frontend/screens/Settings/sections/GamesSettings/index.scss index 6c51b87c15..e1657c3657 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.scss +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.scss @@ -26,6 +26,26 @@ } } +.MuiTabs-root { + padding-bottom: var(--space-xs); + + .MuiTabs-scroller { + .MuiTabs-indicator { + background-color: var(--accent); + } + + .MuiTabs-flexContainer { + .MuiTab-root { + color: var(--text-default); + } + + .Mui-selected { + color: var(--accent); + } + } + } +} + // details, should have an hover effect and a pointer cursor and also the summary should be bold and have a background color details { cursor: pointer; diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 1b2e44f396..a669c95236 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -37,15 +37,33 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faInfoCircle } from '@fortawesome/free-solid-svg-icons' import useSetting from 'frontend/hooks/useSetting' import { defaultWineVersion } from '../..' -import Collapsible from 'frontend/components/UI/Collapsible/Collapsible' import SyncSaves from '../SyncSaves' import FooterInfo from '../FooterInfo' +import { Tabs, Tab } from '@mui/material' -type Props = { - useDetails?: boolean +type TabPanelProps = { + children?: React.ReactNode + index: number + value: number } -export default function GamesSettings({ useDetails = true }: Props) { +function TabPanel(props: TabPanelProps) { + const { children, value, index, ...other } = props + + return ( + + ) +} + +export default function GamesSettings() { const { t } = useTranslation() const { platform } = useContext(ContextProvider) const { isDefault, gameInfo } = useContext(SettingsContext) @@ -57,6 +75,24 @@ export default function GamesSettings({ useDetails = true }: Props) { const hasCloudSaves = gameInfo?.cloud_save_enabled && gameInfo.install.platform !== 'linux' + // Get the latest used tab index for the current game + const latestTabIndex = parseInt( + localStorage.getItem(`${gameInfo!.app_name}-setting_tab`) || '0' + ) + const [value, setValue] = useState(latestTabIndex) + + const handleChange = ( + event: React.ChangeEvent, + newValue: number + ) => { + setValue(newValue) + // Store the latest used tab index for the current game + localStorage.setItem( + `${gameInfo!.app_name}-setting_tab`, + newValue.toString() + ) + } + useEffect(() => { if (gameInfo) { const getIsNative = async () => { @@ -82,101 +118,75 @@ export default function GamesSettings({ useDetails = true }: Props) {

)} - {!nativeGame && ( - <> - + + {!isWin && } + + {!isCrossover && !isWin && ( + + )} + {hasCloudSaves && ( + + )} + + + + {!nativeGame && ( + <> - {!isCrossover && ( <> {isLinux && ( <> - - - - - )} - - - )} - - - )} - - - - - - - {!nativeGame && } - - {!isWin && !nativeGame && ( - <> - - - {isLinux && ( - <> + - - - - - + )} )} + - - - {isLinux && } - - - - - - - - - - + + {!isCrossover && ( + <> + + + + + + + + + + + + + )} + + + - + + - + {hasCloudSaves && ( - + - + )} - + {!isDefault && } ) } From 256a75eb519767e68f2fb847c3684cf78485bee7 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Sun, 1 Oct 2023 21:01:18 +0100 Subject: [PATCH 02/16] fix: deadcode --- .../components/UI/Collapsible/Collapsible.tsx | 24 ------------------- 1 file changed, 24 deletions(-) delete mode 100644 src/frontend/components/UI/Collapsible/Collapsible.tsx diff --git a/src/frontend/components/UI/Collapsible/Collapsible.tsx b/src/frontend/components/UI/Collapsible/Collapsible.tsx deleted file mode 100644 index b852da18b3..0000000000 --- a/src/frontend/components/UI/Collapsible/Collapsible.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import React from 'react' - -type Props = { - isOpen: boolean - summary: string - children: React.ReactNode - isCollapsible?: boolean -} - -const Collapsible = ({ isOpen, isCollapsible, children, summary }: Props) => { - return isCollapsible ? ( -
- {summary} - {children} -
- ) : ( -
-

{summary}

- {children} -
- ) -} - -export default Collapsible From 2703dcbb04e3acc18aee151b15cbe0c93b403dcb Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Mon, 2 Oct 2023 10:20:24 +0100 Subject: [PATCH 03/16] fix: crash on app settings --- .../Settings/sections/GamesSettings/index.tsx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index a669c95236..c3274798a8 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -76,9 +76,10 @@ export default function GamesSettings() { gameInfo?.cloud_save_enabled && gameInfo.install.platform !== 'linux' // Get the latest used tab index for the current game - const latestTabIndex = parseInt( - localStorage.getItem(`${gameInfo!.app_name}-setting_tab`) || '0' - ) + const localStorageKey = gameInfo + ? `${gameInfo!.app_name}-setting_tab` + : 'default' + const latestTabIndex = parseInt(localStorage.getItem(localStorageKey) || '0') const [value, setValue] = useState(latestTabIndex) const handleChange = ( @@ -87,10 +88,7 @@ export default function GamesSettings() { ) => { setValue(newValue) // Store the latest used tab index for the current game - localStorage.setItem( - `${gameInfo!.app_name}-setting_tab`, - newValue.toString() - ) + localStorage.setItem(localStorageKey, newValue.toString()) } useEffect(() => { From 8596ac909bfc00fd2b19b9e9005b5bb83b8d450e Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Mon, 2 Oct 2023 10:41:20 +0100 Subject: [PATCH 04/16] fix: fields appearing and order by OS --- .../Settings/components/BattlEyeRuntime.tsx | 8 +++++++- .../screens/Settings/components/EacRuntime.tsx | 6 +++++- .../Settings/sections/GamesSettings/index.tsx | 14 +++++++------- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/frontend/screens/Settings/components/BattlEyeRuntime.tsx b/src/frontend/screens/Settings/components/BattlEyeRuntime.tsx index e390abb3fa..f5c97cde12 100644 --- a/src/frontend/screens/Settings/components/BattlEyeRuntime.tsx +++ b/src/frontend/screens/Settings/components/BattlEyeRuntime.tsx @@ -1,9 +1,10 @@ -import React, { useState } from 'react' +import React, { useContext, useState } from 'react' import { useTranslation } from 'react-i18next' import { ToggleSwitch } from 'frontend/components/UI' import useSetting from 'frontend/hooks/useSetting' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faSyncAlt } from '@fortawesome/free-solid-svg-icons' +import ContextProvider from 'frontend/state/ContextProvider' const BattlEyeRuntime = () => { const { t } = useTranslation() @@ -12,6 +13,11 @@ const BattlEyeRuntime = () => { 'battlEyeRuntime', false ) + const { platform } = useContext(ContextProvider) + + if (platform !== 'linux') { + return null + } const handleBattlEyeRuntime = async () => { if (!battlEyeRuntime) { diff --git a/src/frontend/screens/Settings/components/EacRuntime.tsx b/src/frontend/screens/Settings/components/EacRuntime.tsx index 116fed17ec..ee039b17b0 100644 --- a/src/frontend/screens/Settings/components/EacRuntime.tsx +++ b/src/frontend/screens/Settings/components/EacRuntime.tsx @@ -11,7 +11,11 @@ const EacRuntime = () => { const [installing, setInstalling] = useState(false) const [eacRuntime, setEacRuntime] = useSetting('eacRuntime', false) const [useGameMode, setUseGameMode] = useSetting('useGameMode', false) - const { showDialogModal } = useContext(ContextProvider) + const { showDialogModal, platform } = useContext(ContextProvider) + + if (platform !== 'linux') { + return null + } const handleEacRuntime = async () => { if (!eacRuntime) { diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index c3274798a8..6d8fa8ecbf 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -153,21 +153,21 @@ export default function GamesSettings() { + + + {!isCrossover && ( <> - - - - - - - )} + + + + From f05cf9b12bef6b61cd10e0bf8144beeec20f8dee Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Mon, 2 Oct 2023 11:11:30 +0100 Subject: [PATCH 05/16] fix: fix and improve Tools Buttons --- src/backend/main.ts | 4 +-- .../Settings/components/Tools/index.scss | 28 ++++++++++++++- .../Settings/components/Tools/index.tsx | 36 +++++++++++++------ 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/backend/main.ts b/src/backend/main.ts index 54be864db9..48983d6070 100644 --- a/src/backend/main.ts +++ b/src/backend/main.ts @@ -625,7 +625,7 @@ ipcMain.handle('callTool', async (event, { tool, exe, appName, runner }) => { await Winetricks.run(runner, appName, event) break case 'winecfg': - runWineCommandOnGame(runner, appName, { + await runWineCommandOnGame(runner, appName, { gameSettings, commandParts: ['winecfg'], wait: false @@ -634,7 +634,7 @@ ipcMain.handle('callTool', async (event, { tool, exe, appName, runner }) => { case 'runExe': if (exe) { const workingDir = path.parse(exe).dir - runWineCommandOnGame(runner, appName, { + await runWineCommandOnGame(runner, appName, { gameSettings, commandParts: [exe], wait: false, diff --git a/src/frontend/screens/Settings/components/Tools/index.scss b/src/frontend/screens/Settings/components/Tools/index.scss index 1b1a42cfdc..056988378f 100644 --- a/src/frontend/screens/Settings/components/Tools/index.scss +++ b/src/frontend/screens/Settings/components/Tools/index.scss @@ -8,6 +8,13 @@ .button { padding-block: var(--space-lg); margin: 0 var(--space-3xs); + display: flex; + align-items: center; + border-radius: 8px; + } + + .active { + animation: fading 1s alternate infinite; } .drag { @@ -20,7 +27,12 @@ text-decoration: none; white-space: nowrap; - & > span { + & div { + position: relative; + top: -18px; + } + + & span { transition: 350ms; font-size: var(--text-xs); font-style: italic; @@ -29,3 +41,17 @@ } } } + +@keyframes fading { + 0% { + opacity: 0.5; + } + + 50% { + opacity: 0.8; + } + + 100% { + opacity: 1; + } +} diff --git a/src/frontend/screens/Settings/components/Tools/index.tsx b/src/frontend/screens/Settings/components/Tools/index.tsx index 9b2bf70554..a2e0ef14ea 100644 --- a/src/frontend/screens/Settings/components/Tools/index.tsx +++ b/src/frontend/screens/Settings/components/Tools/index.tsx @@ -14,6 +14,7 @@ export default function Tools() { const { t } = useTranslation() const [winecfgRunning, setWinecfgRunning] = useState(false) const [winetricksRunning, setWinetricksRunning] = useState(false) + const [runExeRunning, setRunExeRunning] = useState(false) const [progress, setProgress] = useState([]) const { appName, runner, isDefault } = useContext(SettingsContext) const { platform } = useContext(ContextProvider) @@ -25,20 +26,26 @@ export default function Tools() { type Tool = 'winecfg' | 'winetricks' | string async function callTools(tool: Tool, exe?: string) { - if (tool === 'winetricks') { - setWinetricksRunning(true) + const toolStates = { + winetricks: setWinetricksRunning, + winecfg: setWinecfgRunning, + runExe: setRunExeRunning } - if (tool === 'winecfg') { - setWinecfgRunning(true) + + if (tool in toolStates) { + toolStates[tool](true) } + await window.api.callTool({ tool, exe, appName, runner }) - setWinetricksRunning(false) - setWinecfgRunning(false) + + if (tool in toolStates) { + toolStates[tool](false) + } } useEffect(() => { @@ -98,6 +105,12 @@ export default function Tools() { ev.preventDefault() } + console.log('toolsSettings', { + winetricksRunning, + winecfgRunning, + runExeRunning + }) + return ( <> From 451d13046200e12a8950b74e407efe5fcc8e2673 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Mon, 2 Oct 2023 11:27:19 +0100 Subject: [PATCH 06/16] chore: make animation more obvious --- src/frontend/screens/Settings/components/Tools/index.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontend/screens/Settings/components/Tools/index.scss b/src/frontend/screens/Settings/components/Tools/index.scss index 056988378f..d9db0660e9 100644 --- a/src/frontend/screens/Settings/components/Tools/index.scss +++ b/src/frontend/screens/Settings/components/Tools/index.scss @@ -44,11 +44,13 @@ @keyframes fading { 0% { - opacity: 0.5; + opacity: 0.2; } 50% { - opacity: 0.8; + opacity: 0.5; + background-color: var(--navbar-background); + color: var(--text-default); } 100% { From de7a616a41deec06ee2201d0edc28efb4ea4b110 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Tue, 3 Oct 2023 09:57:47 +0100 Subject: [PATCH 07/16] fix: tab order bug and native options --- .../Settings/sections/GamesSettings/index.tsx | 90 ++++++++++--------- 1 file changed, 48 insertions(+), 42 deletions(-) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 6d8fa8ecbf..9f726a47e0 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -43,8 +43,8 @@ import { Tabs, Tab } from '@mui/material' type TabPanelProps = { children?: React.ReactNode - index: number - value: number + index: string + value: string } function TabPanel(props: TabPanelProps) { @@ -79,12 +79,12 @@ export default function GamesSettings() { const localStorageKey = gameInfo ? `${gameInfo!.app_name}-setting_tab` : 'default' - const latestTabIndex = parseInt(localStorage.getItem(localStorageKey) || '0') + const latestTabIndex = localStorage.getItem(localStorageKey) || 'wine' const [value, setValue] = useState(latestTabIndex) const handleChange = ( event: React.ChangeEvent, - newValue: number + newValue: string ) => { setValue(newValue) // Store the latest used tab index for the current game @@ -117,60 +117,68 @@ export default function GamesSettings() { )} - {!isWin && } - + {!isWin && !nativeGame && } + {!isCrossover && !isWin && ( - + )} {hasCloudSaves && ( - + )} - - {!nativeGame && ( - <> - - - - {!isCrossover && ( - <> - - {isLinux && ( - <> - - - - )} - - - - - - )} - - )} + + <> + + + + {!isCrossover && ( + <> + + {isLinux && ( + <> + + + + )} + + + + + + + )} + - - + + {!nativeGame && } {!isCrossover && ( <> - )} - - + {!nativeGame && ( + <> + + + + )} - + @@ -178,11 +186,9 @@ export default function GamesSettings() { - {hasCloudSaves && ( - - - - )} + + + {!isDefault && } From cc880c7344efcdc0a3e4d8f6b43a9b5301719f98 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 4 Oct 2023 12:07:51 +0100 Subject: [PATCH 08/16] feat: make modal static and tabs scrollable --- .../screens/Settings/components/SettingsModal/index.scss | 1 + .../screens/Settings/sections/GamesSettings/index.tsx | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontend/screens/Settings/components/SettingsModal/index.scss b/src/frontend/screens/Settings/components/SettingsModal/index.scss index 33788204f9..f2c6ec7d76 100644 --- a/src/frontend/screens/Settings/components/SettingsModal/index.scss +++ b/src/frontend/screens/Settings/components/SettingsModal/index.scss @@ -2,6 +2,7 @@ width: 65vw; display: flex; flex-direction: column; + flex: 1 1 60vh; max-width: 800px; min-height: 50vh; diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 9f726a47e0..a1918e405f 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -116,7 +116,12 @@ export default function GamesSettings() {

)} - + {!isWin && !nativeGame && } {!isCrossover && !isWin && ( From 362da072c1fa3c8392b8f6e485bddfb943986d93 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 4 Oct 2023 12:13:26 +0100 Subject: [PATCH 09/16] chore: pr comments --- .../Settings/components/Tools/index.scss | 6 +-- .../Settings/components/Tools/index.tsx | 12 +----- .../Settings/sections/GamesSettings/index.tsx | 40 +++++++++---------- 3 files changed, 22 insertions(+), 36 deletions(-) diff --git a/src/frontend/screens/Settings/components/Tools/index.scss b/src/frontend/screens/Settings/components/Tools/index.scss index d9db0660e9..87fcc85919 100644 --- a/src/frontend/screens/Settings/components/Tools/index.scss +++ b/src/frontend/screens/Settings/components/Tools/index.scss @@ -26,11 +26,7 @@ flex-direction: column; text-decoration: none; white-space: nowrap; - - & div { - position: relative; - top: -18px; - } + justify-content: center; & span { transition: 350ms; diff --git a/src/frontend/screens/Settings/components/Tools/index.tsx b/src/frontend/screens/Settings/components/Tools/index.tsx index a2e0ef14ea..807e94fcdf 100644 --- a/src/frontend/screens/Settings/components/Tools/index.tsx +++ b/src/frontend/screens/Settings/components/Tools/index.tsx @@ -105,12 +105,6 @@ export default function Tools() { ev.preventDefault() } - console.log('toolsSettings', { - winetricksRunning, - winecfgRunning, - runExeRunning - }) - return ( <>
@@ -149,10 +143,8 @@ export default function Tools() { })} onClick={handleRunExe} > -
- {t('setting.runexe.title')}
- {t('setting.runexe.message')} -
+ {t('setting.runexe.title')}
+ {t('setting.runexe.message')}
diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index a1918e405f..92cf7ce330 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -139,27 +139,25 @@ export default function GamesSettings() {
- <> - - - - {!isCrossover && ( - <> - - {isLinux && ( - <> - - - - )} - - - - - - - )} - + + + + {!isCrossover && ( + <> + + {isLinux && ( + <> + + + + )} + + + + + + + )} From 8110e5fa5623bab19d27277f1776182d78110289 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 4 Oct 2023 12:38:21 +0100 Subject: [PATCH 10/16] fix: windows tabs --- .../Settings/sections/GamesSettings/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 92cf7ce330..7b5faa2f37 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -123,13 +123,15 @@ export default function GamesSettings() { variant="scrollable" > {!isWin && !nativeGame && } - - {!isCrossover && !isWin && ( - + {!isWin && ( + )} + + + {hasCloudSaves && ( Date: Wed, 4 Oct 2023 12:40:36 +0100 Subject: [PATCH 11/16] fix: show more settings on windows --- .../screens/Settings/sections/GamesSettings/index.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 7b5faa2f37..7e9f6e8dd7 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -79,7 +79,8 @@ export default function GamesSettings() { const localStorageKey = gameInfo ? `${gameInfo!.app_name}-setting_tab` : 'default' - const latestTabIndex = localStorage.getItem(localStorageKey) || 'wine' + const latestTabIndex = + localStorage.getItem(localStorageKey) || (isWin ? 'advanced' : 'wine') const [value, setValue] = useState(latestTabIndex) const handleChange = ( @@ -179,11 +180,11 @@ export default function GamesSettings() { )} - - + + From a83d77825c6583c7fcac12c5b1ebef365dfe98d1 Mon Sep 17 00:00:00 2001 From: Flavio F Lima Date: Wed, 4 Oct 2023 13:01:03 +0100 Subject: [PATCH 12/16] chore: hide game defaults on windows --- .../Sidebar/components/SidebarLinks/index.tsx | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/frontend/components/UI/Sidebar/components/SidebarLinks/index.tsx b/src/frontend/components/UI/Sidebar/components/SidebarLinks/index.tsx index dff001dca6..292c479493 100644 --- a/src/frontend/components/UI/Sidebar/components/SidebarLinks/index.tsx +++ b/src/frontend/components/UI/Sidebar/components/SidebarLinks/index.tsx @@ -213,18 +213,23 @@ export default function SidebarLinks() { > {t('settings.navbar.general')} - - - {t('settings.navbar.games_settings_defaults', 'Game Defaults')} - - + {!isWin && ( + + + {t( + 'settings.navbar.games_settings_defaults', + 'Game Defaults' + )} + + + )} Date: Fri, 6 Oct 2023 11:28:23 +0100 Subject: [PATCH 13/16] chore: hide settings button for browser games --- src/frontend/screens/Game/GamePage/index.tsx | 3 ++- .../screens/Library/components/GameCard/index.tsx | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/frontend/screens/Game/GamePage/index.tsx b/src/frontend/screens/Game/GamePage/index.tsx index bbca953d49..58337902d3 100644 --- a/src/frontend/screens/Game/GamePage/index.tsx +++ b/src/frontend/screens/Game/GamePage/index.tsx @@ -106,6 +106,7 @@ export default React.memo(function GamePage(): JSX.Element | null { const isLinux = platform === 'linux' const isMac = platform === 'darwin' const isSideloaded = runner === 'sideload' + const isBrowserGame = gameInfo?.install.platform === 'Browser' const isInstalling = status === 'installing' const isPlaying = status === 'playing' @@ -308,7 +309,7 @@ export default React.memo(function GamePage(): JSX.Element | null {

{title}

- + {!isBrowserGame && }
diff --git a/src/frontend/screens/Library/components/GameCard/index.tsx b/src/frontend/screens/Library/components/GameCard/index.tsx index a893446c01..8dc2a2b85d 100644 --- a/src/frontend/screens/Library/components/GameCard/index.tsx +++ b/src/frontend/screens/Library/components/GameCard/index.tsx @@ -117,6 +117,8 @@ const GameCard = ({ const { status, folder, label } = hasStatus(appName, gameInfo, size) + const isBrowserGame = gameInfo.install.platform === 'Browser' + useEffect(() => { setIsLaunching(false) const updateGameInfo = async () => { @@ -311,15 +313,12 @@ const GameCard = ({ // settings label: t('submenu.settings', 'Settings'), onclick: () => setIsSettingsModalOpen(true, 'settings', gameInfo), - show: isInstalled && !isUninstalling + show: isInstalled && !isUninstalling && !isBrowserGame }, { label: t('submenu.logs', 'Logs'), onclick: () => setIsSettingsModalOpen(true, 'log', gameInfo), - show: - isInstalled && - !isUninstalling && - gameInfo.install.platform !== 'Browser' + show: isInstalled && !isUninstalling && !isBrowserGame }, { // hide @@ -385,6 +384,8 @@ const GameCard = ({ ) } + const showSettingsButton = isInstalled && !isUninstalling && !isBrowserGame + return (
{showUninstallModal && ( @@ -464,7 +465,7 @@ const GameCard = ({ )} - {isInstalled && !isUninstalling && ( + {showSettingsButton && ( <> Date: Fri, 6 Oct 2023 12:58:07 +0100 Subject: [PATCH 14/16] fix: fix native and sideload settings --- .../Settings/sections/GamesSettings/index.tsx | 57 +++++++++++++------ 1 file changed, 39 insertions(+), 18 deletions(-) diff --git a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx index 7e9f6e8dd7..9eb92bd9cd 100644 --- a/src/frontend/screens/Settings/sections/GamesSettings/index.tsx +++ b/src/frontend/screens/Settings/sections/GamesSettings/index.tsx @@ -53,7 +53,6 @@ function TabPanel(props: TabPanelProps) { return (