Remove legacy interaction option
This commit is contained in:
@@ -9,5 +9,5 @@
|
||||
}
|
||||
|
||||
.downloads-entry {
|
||||
@apply flex justify-between items-center m-2 p-2 rounded-lg text-gray-200 text-lg transition-colors bg-(--col2) hover:bg-(--col3) border border-(--col4) hover:border-(--col5);
|
||||
@apply flex justify-between items-center m-2 p-2 rounded-lg text-gray-200 text-lg transition-colors bg-(--col2) hover:bg-(--col3) border border-(--col4) hover:border-(--col5) cursor-pointer;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useSearchParams } from 'next/navigation'
|
||||
import { platform } from '@tauri-apps/plugin-os'
|
||||
import { faWarning } from '@fortawesome/free-solid-svg-icons'
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
|
||||
import { ask } from '@tauri-apps/plugin-dialog'
|
||||
import { ask, message } from '@tauri-apps/plugin-dialog'
|
||||
import { BaseDirectory, exists, remove } from '@tauri-apps/plugin-fs'
|
||||
import { writeVersionsConfig } from '../util/BazookaManager'
|
||||
|
||||
@@ -20,7 +20,6 @@ export default function Installs () {
|
||||
setFadeOut,
|
||||
setSelectedVersionList,
|
||||
downloadedVersionsConfig,
|
||||
downloadProgress,
|
||||
normalConfig,
|
||||
setManagingVersion,
|
||||
getVersionInfo,
|
||||
@@ -123,21 +122,9 @@ export default function Installs () {
|
||||
return (
|
||||
<div
|
||||
key={key}
|
||||
className={`downloads-entry ${
|
||||
normalConfig?.settings.useLegacyInteractButtons
|
||||
? ''
|
||||
: 'cursor-pointer'
|
||||
}`}
|
||||
title={
|
||||
normalConfig?.settings.useLegacyInteractButtons
|
||||
? ''
|
||||
: 'Click to view category'
|
||||
}
|
||||
onClick={() => {
|
||||
if (normalConfig?.settings.useLegacyInteractButtons)
|
||||
return
|
||||
setCategory(Number(key))
|
||||
}}
|
||||
className={'downloads-entry'}
|
||||
title={'Click to view category'}
|
||||
onClick={() => setCategory(Number(key))}
|
||||
>
|
||||
<div className='h-18 w-screen relative'>
|
||||
<p className='text-2xl'>{value}</p>
|
||||
@@ -171,17 +158,6 @@ export default function Installs () {
|
||||
})()}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<button
|
||||
className='button absolute right-0 bottom-0'
|
||||
hidden={
|
||||
!normalConfig?.settings.useLegacyInteractButtons
|
||||
}
|
||||
title='Click to view category'
|
||||
onClick={() => setCategory(Number(key))}
|
||||
>
|
||||
Installs
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
@@ -217,33 +193,23 @@ export default function Installs () {
|
||||
.map(entry => (
|
||||
<div
|
||||
key={entry}
|
||||
className={`downloads-entry ${
|
||||
normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
? ''
|
||||
: 'cursor-pointer'
|
||||
}`}
|
||||
className={'downloads-entry'}
|
||||
title={
|
||||
normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
? ''
|
||||
: 'Click to launch game. Right-click to manage this version install'
|
||||
'Click to launch game. Right-click to manage this version install'
|
||||
}
|
||||
onClick={async () => {
|
||||
if (
|
||||
normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
)
|
||||
) {
|
||||
await message(
|
||||
"Can't launch game. Need revision update.",
|
||||
{ title: 'Error launching game', kind: 'error' }
|
||||
)
|
||||
return
|
||||
}
|
||||
const verInfo = getVersionInfo(entry)
|
||||
if (verInfo == undefined) return
|
||||
const gameInfo = getGameInfo(verInfo.game)
|
||||
@@ -262,15 +228,6 @@ export default function Installs () {
|
||||
}}
|
||||
onContextMenu={e => {
|
||||
e.preventDefault()
|
||||
if (
|
||||
normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
setManagingVersion(entry)
|
||||
setPopupMode(2)
|
||||
setShowPopup(true)
|
||||
@@ -346,58 +303,6 @@ export default function Installs () {
|
||||
>
|
||||
View Info
|
||||
</button>
|
||||
<button
|
||||
className='button'
|
||||
hidden={
|
||||
!normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
}
|
||||
onClick={e => {
|
||||
e.stopPropagation()
|
||||
setManagingVersion(entry)
|
||||
setPopupMode(2)
|
||||
setShowPopup(true)
|
||||
setFadeOut(false)
|
||||
}}
|
||||
title='Click to manage this version install'
|
||||
>
|
||||
Manage
|
||||
</button>
|
||||
<button
|
||||
className='button'
|
||||
onClick={e => {
|
||||
e.stopPropagation()
|
||||
const verInfo = getVersionInfo(entry)
|
||||
if (verInfo == undefined) return
|
||||
const gameInfo = getGameInfo(verInfo.game)
|
||||
if (gameInfo == undefined) return
|
||||
invoke('launch_game', {
|
||||
name: verInfo.id,
|
||||
executable: verInfo.executable,
|
||||
displayName: verInfo.displayName,
|
||||
useWine: !!(
|
||||
platform() === 'linux' &&
|
||||
verInfo.wine &&
|
||||
normalConfig?.settings.useWineOnUnixWhenNeeded
|
||||
),
|
||||
wineCommand:
|
||||
normalConfig?.settings.wineOnUnixCommand
|
||||
})
|
||||
}}
|
||||
hidden={
|
||||
!normalConfig?.settings.useLegacyInteractButtons ||
|
||||
needsRevisionUpdate(
|
||||
getVersionInfo(entry)?.lastRevision,
|
||||
entry
|
||||
)
|
||||
}
|
||||
title='Click to launch game'
|
||||
>
|
||||
Launch
|
||||
</button>
|
||||
<button
|
||||
className='button'
|
||||
onClick={async e => {
|
||||
|
||||
@@ -68,18 +68,9 @@ export default function Installs () {
|
||||
.map(i => (
|
||||
<div
|
||||
key={i.id}
|
||||
className={`downloads-entry ${
|
||||
normalConfig?.settings.useLegacyInteractButtons
|
||||
? ''
|
||||
: 'cursor-pointer'
|
||||
}`}
|
||||
title={
|
||||
normalConfig?.settings.useLegacyInteractButtons
|
||||
? ''
|
||||
: 'Click to view game installs'
|
||||
}
|
||||
className={'downloads-entry'}
|
||||
title={'Click to view game installs'}
|
||||
onClick={() => {
|
||||
if (normalConfig?.settings.useLegacyInteractButtons) return
|
||||
setCategory(-1)
|
||||
router.push('/game?id=' + i.id)
|
||||
}}
|
||||
@@ -128,18 +119,6 @@ export default function Installs () {
|
||||
<p>{i.verified ? 'Verified' : 'Unverified'}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div
|
||||
className='button absolute right-0 bottom-0'
|
||||
hidden={!normalConfig?.settings.useLegacyInteractButtons}
|
||||
title='Click to view game installs'
|
||||
onClick={() => {
|
||||
setCategory(-1)
|
||||
router.push('/game?id=' + i.id)
|
||||
}}
|
||||
>
|
||||
Installs
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))
|
||||
|
||||
@@ -11,8 +11,6 @@ export default function Settings () {
|
||||
const [allowNotifications, setAllowNotifications] = useState(false)
|
||||
const [alwaysShowGamesInSidebar, setAlwaysShowGamesInSidebar] =
|
||||
useState(false)
|
||||
const [useLegacyInteractButtons, setUseLegacyInteractButtons] =
|
||||
useState(false)
|
||||
const [useWineOnUnixWhenNeeded, setUseWineOnUnixWhenNeeded] = useState(false)
|
||||
const [wineOnUnixCommand, setWineOnUnixCommand] = useState('wine %path%')
|
||||
const [theme, setTheme] = useState(0)
|
||||
@@ -27,9 +25,6 @@ export default function Settings () {
|
||||
setAlwaysShowGamesInSidebar(
|
||||
normalConfig.settings.alwaysShowGamesInSidebar
|
||||
)
|
||||
setUseLegacyInteractButtons(
|
||||
normalConfig.settings.useLegacyInteractButtons
|
||||
)
|
||||
setUseWineOnUnixWhenNeeded(
|
||||
normalConfig.settings.useWineOnUnixWhenNeeded
|
||||
)
|
||||
@@ -92,29 +87,6 @@ export default function Settings () {
|
||||
}}
|
||||
title="This setting will make it so when you are on a page like this, the games won't disappear."
|
||||
/>
|
||||
<Setting
|
||||
label='Show Installs/Launch/Manage Buttons'
|
||||
value={useLegacyInteractButtons}
|
||||
onChange={async () => {
|
||||
if (!normalConfig) return
|
||||
setUseLegacyInteractButtons(!useLegacyInteractButtons)
|
||||
setNormalConfig({
|
||||
...normalConfig,
|
||||
settings: {
|
||||
...normalConfig.settings,
|
||||
useLegacyInteractButtons: !useLegacyInteractButtons
|
||||
}
|
||||
})
|
||||
await writeNormalConfig({
|
||||
...normalConfig,
|
||||
settings: {
|
||||
...normalConfig.settings,
|
||||
useLegacyInteractButtons: !useLegacyInteractButtons
|
||||
}
|
||||
})
|
||||
}}
|
||||
title='Enable the legacy method of using the installs/launch/manage buttons. In the future this setting may be removed so try and get used to the new method.'
|
||||
/>
|
||||
<Setting
|
||||
label='Use wine when needed to launch games'
|
||||
value={useWineOnUnixWhenNeeded}
|
||||
|
||||
@@ -2,7 +2,6 @@ export class SettingsType {
|
||||
constructor (
|
||||
public allowNotifications: boolean = true,
|
||||
public alwaysShowGamesInSidebar: boolean = true,
|
||||
public useLegacyInteractButtons: boolean = false,
|
||||
public useWineOnUnixWhenNeeded: boolean = false,
|
||||
public wineOnUnixCommand: string = 'wine %path%',
|
||||
public theme: number = 0
|
||||
|
||||
Reference in New Issue
Block a user