1.5.4
This commit is contained in:
@@ -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",
|
||||||
|
|||||||
@@ -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"
|
||||||
|
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -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'>
|
||||||
|
|||||||
@@ -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,10 +83,31 @@ export default function Installs () {
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{category == -1 &&
|
{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 (
|
return (
|
||||||
<div
|
<div
|
||||||
key={crypto.randomUUID()}
|
key={value}
|
||||||
className={`downloads-entry ${
|
className={`downloads-entry ${
|
||||||
normalConfig?.settings.useLegacyInteractButtons
|
normalConfig?.settings.useLegacyInteractButtons
|
||||||
? ''
|
? ''
|
||||||
@@ -91,7 +119,8 @@ export default function Installs () {
|
|||||||
: 'Click to view category'
|
: 'Click to view category'
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (normalConfig?.settings.useLegacyInteractButtons) return
|
if (normalConfig?.settings.useLegacyInteractButtons)
|
||||||
|
return
|
||||||
setCategory(Number(key))
|
setCategory(Number(key))
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@@ -114,11 +143,13 @@ export default function Installs () {
|
|||||||
if (
|
if (
|
||||||
platform() === 'linux' &&
|
platform() === 'linux' &&
|
||||||
info.wine &&
|
info.wine &&
|
||||||
!normalConfig?.settings.useWineOnUnixWhenNeeded
|
!normalConfig?.settings
|
||||||
|
.useWineOnUnixWhenNeeded
|
||||||
)
|
)
|
||||||
return false
|
return false
|
||||||
return (
|
return (
|
||||||
info.game === id && info.category == Number(key)
|
info.game === id &&
|
||||||
|
info.category == Number(key)
|
||||||
)
|
)
|
||||||
}).length ?? 0
|
}).length ?? 0
|
||||||
return `${count} install${count === 1 ? '' : 's'}`
|
return `${count} install${count === 1 ? '' : 's'}`
|
||||||
@@ -128,7 +159,9 @@ export default function Installs () {
|
|||||||
|
|
||||||
<button
|
<button
|
||||||
className='button absolute right-0 bottom-0'
|
className='button absolute right-0 bottom-0'
|
||||||
hidden={!normalConfig?.settings.useLegacyInteractButtons}
|
hidden={
|
||||||
|
!normalConfig?.settings.useLegacyInteractButtons
|
||||||
|
}
|
||||||
title='Click to view category'
|
title='Click to view category'
|
||||||
onClick={() => setCategory(Number(key))}
|
onClick={() => setCategory(Number(key))}
|
||||||
>
|
>
|
||||||
@@ -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={
|
||||||
|
|||||||
Reference in New Issue
Block a user