1.5.4
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "lncvrt-games-launcher",
|
||||
"private": true,
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "lncvrt-games-launcher"
|
||||
version = "1.5.3"
|
||||
version = "1.5.4"
|
||||
authors = ["Lncvrt"]
|
||||
edition = "2024"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Lncvrt Games Launcher",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"identifier": "xyz.lncvrt.games-launcher",
|
||||
"build": {
|
||||
"beforeDevCommand": "next dev",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Lncvrt Games Launcher",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"identifier": "xyz.lncvrt.games-launcher",
|
||||
"build": {
|
||||
"beforeDevCommand": "next dev",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Lncvrt Games Launcher",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"identifier": "xyz.lncvrt.games-launcher",
|
||||
"build": {
|
||||
"beforeDevCommand": "next dev",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"$schema": "https://schema.tauri.app/config/2",
|
||||
"productName": "Lncvrt Games Launcher",
|
||||
"version": "1.5.3",
|
||||
"version": "1.5.4",
|
||||
"identifier": "xyz.lncvrt.games-launcher",
|
||||
"build": {
|
||||
"beforeDevCommand": "next dev",
|
||||
|
||||
@@ -43,9 +43,11 @@ export default function Sidebar () {
|
||||
hidden={platform() != 'macos'}
|
||||
onMouseDown={e => {
|
||||
if (e.buttons === 1) {
|
||||
e.detail === 2
|
||||
? getCurrentWindow().toggleMaximize()
|
||||
: getCurrentWindow().startDragging()
|
||||
if (e.detail === 2) {
|
||||
getCurrentWindow().toggleMaximize()
|
||||
} else {
|
||||
getCurrentWindow().startDragging()
|
||||
}
|
||||
}
|
||||
}}
|
||||
></div>
|
||||
@@ -62,9 +64,11 @@ export default function Sidebar () {
|
||||
onMouseDown={e => {
|
||||
if (platform() != 'macos') return
|
||||
if (e.buttons === 1) {
|
||||
e.detail === 2
|
||||
? getCurrentWindow().toggleMaximize()
|
||||
: getCurrentWindow().startDragging()
|
||||
if (e.detail === 2) {
|
||||
getCurrentWindow().toggleMaximize()
|
||||
} else {
|
||||
getCurrentWindow().startDragging()
|
||||
}
|
||||
}
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -23,10 +23,6 @@ export default function VersionInfo () {
|
||||
viewingInfoFromDownloads,
|
||||
setPopupMode
|
||||
} = useGlobal()
|
||||
if (!managingVersion || !downloadedVersionsConfig) return <></>
|
||||
|
||||
const versionInfo = getVersionInfo(managingVersion)
|
||||
const gameInfo = getGameInfo(versionInfo?.game)
|
||||
const [versionSize, setVersionSize] = useState<number | null>(null)
|
||||
|
||||
useEffect(() => {
|
||||
@@ -37,6 +33,11 @@ export default function VersionInfo () {
|
||||
})
|
||||
}, [managingVersion, setVersionSize])
|
||||
|
||||
if (!managingVersion || !downloadedVersionsConfig) return <></>
|
||||
|
||||
const versionInfo = getVersionInfo(managingVersion)
|
||||
const gameInfo = getGameInfo(versionInfo?.game)
|
||||
|
||||
return (
|
||||
<>
|
||||
<p className='text-xl text-center'>
|
||||
|
||||
@@ -26,18 +26,25 @@ export default function Installs () {
|
||||
} = useGlobal()
|
||||
|
||||
const params = useSearchParams()
|
||||
const [category, setCategory] = useState<number>(-1)
|
||||
|
||||
const id = Number(params.get('id') || 0)
|
||||
if (!id) return <p>Invalid game</p>
|
||||
const game = serverVersionList?.games.find(g => g.id === id)
|
||||
if (!game) return <p>Invalid game</p>
|
||||
|
||||
const [category, setCategory] = useState<number>(-1)
|
||||
const [lastId, setLastId] = useState(id)
|
||||
|
||||
useEffect(() => {
|
||||
if (!showPopup) return
|
||||
setSelectedVersionList([])
|
||||
}, [normalConfig, setSelectedVersionList, showPopup])
|
||||
|
||||
if (!id || !game) return <p>Invalid game</p>
|
||||
|
||||
if (lastId !== id) {
|
||||
setLastId(id)
|
||||
setCategory(-1)
|
||||
}
|
||||
|
||||
return (
|
||||
<div className='mx-4 mt-4'>
|
||||
<div className='flex justify-between items-center mb-4'>
|
||||
@@ -76,10 +83,31 @@ export default function Installs () {
|
||||
}`}
|
||||
>
|
||||
{category == -1 &&
|
||||
Object.entries(game.categoryNames).map(([key, value]) => {
|
||||
Object.entries(game.categoryNames)
|
||||
.sort(([a], [b]) => Number(b) - Number(a))
|
||||
.filter(([key]) => {
|
||||
const count = Object.keys(
|
||||
downloadedVersionsConfig?.list ?? {}
|
||||
).filter(v => {
|
||||
const info = getVersionInfo(v)
|
||||
if (!info) return false
|
||||
|
||||
if (
|
||||
platform() === 'linux' &&
|
||||
info.wine &&
|
||||
!normalConfig?.settings.useWineOnUnixWhenNeeded
|
||||
)
|
||||
return false
|
||||
|
||||
return info.game === id && info.category === Number(key)
|
||||
}).length
|
||||
|
||||
return count >= 1
|
||||
})
|
||||
.map(([key, value]) => {
|
||||
return (
|
||||
<div
|
||||
key={crypto.randomUUID()}
|
||||
key={value}
|
||||
className={`downloads-entry ${
|
||||
normalConfig?.settings.useLegacyInteractButtons
|
||||
? ''
|
||||
@@ -91,7 +119,8 @@ export default function Installs () {
|
||||
: 'Click to view category'
|
||||
}
|
||||
onClick={() => {
|
||||
if (normalConfig?.settings.useLegacyInteractButtons) return
|
||||
if (normalConfig?.settings.useLegacyInteractButtons)
|
||||
return
|
||||
setCategory(Number(key))
|
||||
}}
|
||||
>
|
||||
@@ -114,11 +143,13 @@ export default function Installs () {
|
||||
if (
|
||||
platform() === 'linux' &&
|
||||
info.wine &&
|
||||
!normalConfig?.settings.useWineOnUnixWhenNeeded
|
||||
!normalConfig?.settings
|
||||
.useWineOnUnixWhenNeeded
|
||||
)
|
||||
return false
|
||||
return (
|
||||
info.game === id && info.category == Number(key)
|
||||
info.game === id &&
|
||||
info.category == Number(key)
|
||||
)
|
||||
}).length ?? 0
|
||||
return `${count} install${count === 1 ? '' : 's'}`
|
||||
@@ -128,7 +159,9 @@ export default function Installs () {
|
||||
|
||||
<button
|
||||
className='button absolute right-0 bottom-0'
|
||||
hidden={!normalConfig?.settings.useLegacyInteractButtons}
|
||||
hidden={
|
||||
!normalConfig?.settings.useLegacyInteractButtons
|
||||
}
|
||||
title='Click to view category'
|
||||
onClick={() => setCategory(Number(key))}
|
||||
>
|
||||
@@ -277,9 +310,19 @@ export default function Installs () {
|
||||
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
|
||||
executable: verInfo.executable,
|
||||
displayName: verInfo.displayName,
|
||||
useWine: !!(
|
||||
platform() === 'linux' &&
|
||||
verInfo.wine &&
|
||||
normalConfig?.settings.useWineOnUnixWhenNeeded
|
||||
),
|
||||
wineCommand:
|
||||
normalConfig?.settings.wineOnUnixCommand
|
||||
})
|
||||
}}
|
||||
hidden={
|
||||
|
||||
Reference in New Issue
Block a user