diff --git a/src/app/GlobalProvider.tsx b/src/app/GlobalProvider.tsx index 8d7035c..5272055 100644 --- a/src/app/GlobalProvider.tsx +++ b/src/app/GlobalProvider.tsx @@ -64,8 +64,8 @@ type GlobalCtxType = { settings: Store | null notificationsAllowed: boolean sidebarAlwaysShowGames: boolean - unixUseWine: boolean - unixWineCommand: string + linuxUseWine: boolean + linuxWineCommand: string theme: string } diff --git a/src/app/game/page.tsx b/src/app/game/page.tsx index 62e4d12..251f19f 100644 --- a/src/app/game/page.tsx +++ b/src/app/game/page.tsx @@ -31,8 +31,8 @@ export default function Installs () { setDownloadedVersionsConfig, downloadVersions, downloadProgress, - unixUseWine, - unixWineCommand + linuxUseWine, + linuxWineCommand } = useGlobal() const params = useSearchParams() @@ -130,7 +130,7 @@ export default function Installs () { const info = getVersionInfo(v) if (!info) return false - if (platform() == 'linux' && info.wine && !unixUseWine) + if (platform() == 'linux' && info.wine && !linuxUseWine) return false return info.game === id && info.category === Number(key) @@ -165,7 +165,7 @@ export default function Installs () { if ( platform() == 'linux' && info.wine && - !unixUseWine + !linuxUseWine ) return false return ( @@ -196,7 +196,7 @@ export default function Installs () { .filter(v => { const info = getVersionInfo(v) if (!info) return false - if (platform() == 'linux' && info.wine && !unixUseWine) + if (platform() == 'linux' && info.wine && !linuxUseWine) return false return ( info.game === id && @@ -291,9 +291,9 @@ export default function Installs () { useWine: !!( platform() == 'linux' && verInfo.wine && - unixUseWine + linuxUseWine ), - wineCommand: unixWineCommand + wineCommand: linuxWineCommand }) }} onContextMenu={e => { diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 585e1e0..b2bfa68 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -90,8 +90,9 @@ export default function RootLayout ({ useState(false) const [sidebarAlwaysShowGames, setSidebarAlwaysShowGames] = useState(false) - const [unixUseWine, setUnixUseWine] = useState(false) - const [unixWineCommand, setUnixWineCommand] = useState('wine %path%') + const [linuxUseWine, setLinuxUseWine] = useState(false) + const [linuxWineCommand, setLinuxWineCommand] = + useState('wine %path%') const [theme, setTheme] = useState('dark') function getSpecialVersionsList (game?: number): GameVersion[] { @@ -102,7 +103,7 @@ export default function RootLayout ({ v => !Object.keys(downloadedVersionsConfig?.list ?? []).includes(v.id) ) .filter(v => { - if (platformName == 'linux' && v.wine && unixUseWine) return false + if (platformName == 'linux' && v.wine && linuxUseWine) return false if (game && v.game != game) return false if (category != -1 && v.category != category) return false @@ -155,7 +156,7 @@ export default function RootLayout ({ } | null { if (!downloadedVersionsConfig || !serverVersionList) return null - const allowWine = platformName !== 'linux' || unixUseWine + const allowWine = platformName !== 'linux' || linuxUseWine const installed = Object.keys(downloadedVersionsConfig.list).filter(v => { const info = getVersionInfo(v) @@ -363,8 +364,8 @@ export default function RootLayout ({ version: client, notificationsAllowed: true, sidebarAlwaysShowGames: true, - unixUseWine: false, - unixWineCommand: 'wine %path%', + linuxUseWine: false, + linuxWineCommand: 'wine %path%', theme: 'dark' } }) @@ -408,12 +409,12 @@ export default function RootLayout ({ ) if (raw.settings.useWineOnUnixWhenNeeded) settingsLocal?.set( - 'unixUseWine', + 'linuxUseWine', Boolean(raw.settings.useWineOnUnixWhenNeeded) ) if (raw.settings.wineOnUnixCommand) settingsLocal?.set( - 'unixWineCommand', + 'linuxWineCommand', String(raw.settings.wineOnUnixCommand) ) if (raw.settings.theme) { @@ -707,9 +708,9 @@ export default function RootLayout ({ watch('sidebarAlwaysShowGames', v => setSidebarAlwaysShowGames(v ?? true) ) - watch('unixUseWine', v => setUnixUseWine(v ?? false)) - watch('unixWineCommand', v => - setUnixWineCommand(v ?? 'wine %path%') + watch('linuxUseWine', v => setLinuxUseWine(v ?? false)) + watch('linuxWineCommand', v => + setLinuxWineCommand(v ?? 'wine %path%') ) return () => { @@ -793,8 +794,8 @@ export default function RootLayout ({ settings, notificationsAllowed, sidebarAlwaysShowGames, - unixUseWine, - unixWineCommand, + linuxUseWine, + linuxWineCommand, theme }} > diff --git a/src/app/settings/page.tsx b/src/app/settings/page.tsx index 53cc41a..7ccbddd 100644 --- a/src/app/settings/page.tsx +++ b/src/app/settings/page.tsx @@ -11,8 +11,8 @@ export default function Settings () { version, notificationsAllowed, sidebarAlwaysShowGames, - unixUseWine, - unixWineCommand, + linuxUseWine, + linuxWineCommand, theme } = useGlobal() @@ -40,22 +40,22 @@ export default function Settings () { title="This setting will make it so when you are on a page like this, the games won't disappear." /> { - await settings?.set('unixUseWine', !unixUseWine) + await settings?.set('linuxUseWine', !linuxUseWine) }} className={platform() == 'linux' ? '' : 'hidden'} /> - + { - await settings?.set('unixUseWine', e.target.value) + await settings?.set('linuxWineCommand', e.target.value) }} className={`input-field my-1 ${ - platform() == 'linux' && unixUseWine ? '' : 'hidden' + platform() == 'linux' && linuxWineCommand ? '' : 'hidden' }`} >
diff --git a/src/componets/Sidebar.tsx b/src/componets/Sidebar.tsx index f48d98e..817eaa5 100644 --- a/src/componets/Sidebar.tsx +++ b/src/componets/Sidebar.tsx @@ -37,7 +37,7 @@ export default function Sidebar () { category, setCategory, sidebarAlwaysShowGames, - unixUseWine + linuxUseWine } = useGlobal() const pathname = usePathname() @@ -137,7 +137,7 @@ export default function Sidebar () { const info = getVersionInfo(v) if (!info) return false - if (platform() == 'linux' && info.wine && !unixUseWine) + if (platform() == 'linux' && info.wine && !linuxUseWine) return false return info.game === i.id && info.category === Number(key)