This commit is contained in:
2026-02-03 18:51:40 -07:00
parent be4b8fc3ee
commit 4ec597967a
9 changed files with 127 additions and 79 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "lncvrt-games-launcher", "name": "lncvrt-games-launcher",
"private": true, "private": true,
"version": "1.5.3", "version": "1.5.4",
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "lncvrt-games-launcher" name = "lncvrt-games-launcher"
version = "1.5.3" version = "1.5.4"
authors = ["Lncvrt"] authors = ["Lncvrt"]
edition = "2024" edition = "2024"

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.3", "version": "1.5.4",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.3", "version": "1.5.4",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.3", "version": "1.5.4",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",

View File

@@ -1,7 +1,7 @@
{ {
"$schema": "https://schema.tauri.app/config/2", "$schema": "https://schema.tauri.app/config/2",
"productName": "Lncvrt Games Launcher", "productName": "Lncvrt Games Launcher",
"version": "1.5.3", "version": "1.5.4",
"identifier": "xyz.lncvrt.games-launcher", "identifier": "xyz.lncvrt.games-launcher",
"build": { "build": {
"beforeDevCommand": "next dev", "beforeDevCommand": "next dev",

View File

@@ -43,9 +43,11 @@ export default function Sidebar () {
hidden={platform() != 'macos'} hidden={platform() != 'macos'}
onMouseDown={e => { onMouseDown={e => {
if (e.buttons === 1) { if (e.buttons === 1) {
e.detail === 2 if (e.detail === 2) {
? getCurrentWindow().toggleMaximize() getCurrentWindow().toggleMaximize()
: getCurrentWindow().startDragging() } else {
getCurrentWindow().startDragging()
}
} }
}} }}
></div> ></div>
@@ -62,9 +64,11 @@ export default function Sidebar () {
onMouseDown={e => { onMouseDown={e => {
if (platform() != 'macos') return if (platform() != 'macos') return
if (e.buttons === 1) { if (e.buttons === 1) {
e.detail === 2 if (e.detail === 2) {
? getCurrentWindow().toggleMaximize() getCurrentWindow().toggleMaximize()
: getCurrentWindow().startDragging() } else {
getCurrentWindow().startDragging()
}
} }
}} }}
> >

View File

@@ -23,10 +23,6 @@ export default function VersionInfo () {
viewingInfoFromDownloads, viewingInfoFromDownloads,
setPopupMode setPopupMode
} = useGlobal() } = useGlobal()
if (!managingVersion || !downloadedVersionsConfig) return <></>
const versionInfo = getVersionInfo(managingVersion)
const gameInfo = getGameInfo(versionInfo?.game)
const [versionSize, setVersionSize] = useState<number | null>(null) const [versionSize, setVersionSize] = useState<number | null>(null)
useEffect(() => { useEffect(() => {
@@ -37,6 +33,11 @@ export default function VersionInfo () {
}) })
}, [managingVersion, setVersionSize]) }, [managingVersion, setVersionSize])
if (!managingVersion || !downloadedVersionsConfig) return <></>
const versionInfo = getVersionInfo(managingVersion)
const gameInfo = getGameInfo(versionInfo?.game)
return ( return (
<> <>
<p className='text-xl text-center'> <p className='text-xl text-center'>

View File

@@ -26,18 +26,25 @@ export default function Installs () {
} = useGlobal() } = useGlobal()
const params = useSearchParams() const params = useSearchParams()
const [category, setCategory] = useState<number>(-1)
const id = Number(params.get('id') || 0) const id = Number(params.get('id') || 0)
if (!id) return <p>Invalid game</p>
const game = serverVersionList?.games.find(g => g.id === id) 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(() => { useEffect(() => {
if (!showPopup) return if (!showPopup) return
setSelectedVersionList([]) setSelectedVersionList([])
}, [normalConfig, setSelectedVersionList, showPopup]) }, [normalConfig, setSelectedVersionList, showPopup])
if (!id || !game) return <p>Invalid game</p>
if (lastId !== id) {
setLastId(id)
setCategory(-1)
}
return ( return (
<div className='mx-4 mt-4'> <div className='mx-4 mt-4'>
<div className='flex justify-between items-center mb-4'> <div className='flex justify-between items-center mb-4'>
@@ -76,68 +83,94 @@ export default function Installs () {
}`} }`}
> >
{category == -1 && {category == -1 &&
Object.entries(game.categoryNames).map(([key, value]) => { Object.entries(game.categoryNames)
return ( .sort(([a], [b]) => Number(b) - Number(a))
<div .filter(([key]) => {
key={crypto.randomUUID()} const count = Object.keys(
className={`downloads-entry ${ downloadedVersionsConfig?.list ?? {}
normalConfig?.settings.useLegacyInteractButtons ).filter(v => {
? '' const info = getVersionInfo(v)
: 'cursor-pointer' if (!info) return false
}`}
title={
normalConfig?.settings.useLegacyInteractButtons
? ''
: 'Click to view category'
}
onClick={() => {
if (normalConfig?.settings.useLegacyInteractButtons) return
setCategory(Number(key))
}}
>
<div className='h-18 w-screen relative'>
<p className='text-2xl'>{value}</p>
<div if (
className='entry-info-item flex absolute left-0 bottom-0' platform() === 'linux' &&
title='The amount of versions installed of this game in installed/installable format.' info.wine &&
onClick={e => e.stopPropagation()} !normalConfig?.settings.useWineOnUnixWhenNeeded
> )
<p> return false
{(() => {
const count = return info.game === id && info.category === Number(key)
Object.keys( }).length
downloadedVersionsConfig?.list ?? []
).filter(v => { return count >= 1
const info = getVersionInfo(v) })
if (!info) return false .map(([key, value]) => {
if ( return (
platform() === 'linux' && <div
info.wine && key={value}
!normalConfig?.settings.useWineOnUnixWhenNeeded className={`downloads-entry ${
) normalConfig?.settings.useLegacyInteractButtons
return false ? ''
return ( : 'cursor-pointer'
info.game === id && info.category == Number(key) }`}
) title={
}).length ?? 0 normalConfig?.settings.useLegacyInteractButtons
return `${count} install${count === 1 ? '' : 's'}` ? ''
})()} : 'Click to view category'
</p> }
onClick={() => {
if (normalConfig?.settings.useLegacyInteractButtons)
return
setCategory(Number(key))
}}
>
<div className='h-18 w-screen relative'>
<p className='text-2xl'>{value}</p>
<div
className='entry-info-item flex absolute left-0 bottom-0'
title='The amount of versions installed of this game in installed/installable format.'
onClick={e => e.stopPropagation()}
>
<p>
{(() => {
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 ?? 0
return `${count} install${count === 1 ? '' : 's'}`
})()}
</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>
<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>
</div> )
) })}
})}
{Object.keys(downloadedVersionsConfig?.list ?? []).filter(v => { {Object.keys(downloadedVersionsConfig?.list ?? []).filter(v => {
const info = getVersionInfo(v) const info = getVersionInfo(v)
if (!info) return false if (!info) return false
@@ -277,9 +310,19 @@ export default function Installs () {
e.stopPropagation() e.stopPropagation()
const verInfo = getVersionInfo(entry) const verInfo = getVersionInfo(entry)
if (verInfo == undefined) return if (verInfo == undefined) return
const gameInfo = getGameInfo(verInfo.game)
if (gameInfo == undefined) return
invoke('launch_game', { invoke('launch_game', {
name: verInfo.id, 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={ hidden={