From 4ec597967a947d8be09ca96257b2d8cc193546bd Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 3 Feb 2026 18:51:40 -0700 Subject: [PATCH] 1.5.4 --- package.json | 2 +- src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 2 +- src-tauri/tauri.linux.conf.json | 2 +- src-tauri/tauri.macos.conf.json | 2 +- src-tauri/tauri.windows.conf.json | 2 +- src/app/componets/Sidebar.tsx | 16 +-- src/app/componets/VersionInfo.tsx | 9 +- src/app/game/page.tsx | 169 +++++++++++++++++++----------- 9 files changed, 127 insertions(+), 79 deletions(-) diff --git a/package.json b/package.json index 93d4fd9..384a60e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "lncvrt-games-launcher", "private": true, - "version": "1.5.3", + "version": "1.5.4", "type": "module", "scripts": { "dev": "next dev", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 261f2f2..64ec916 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "lncvrt-games-launcher" -version = "1.5.3" +version = "1.5.4" authors = ["Lncvrt"] edition = "2024" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 1013407..a4f8d8c 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -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", diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 1013407..a4f8d8c 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -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", diff --git a/src-tauri/tauri.macos.conf.json b/src-tauri/tauri.macos.conf.json index d98c36f..f14be6a 100644 --- a/src-tauri/tauri.macos.conf.json +++ b/src-tauri/tauri.macos.conf.json @@ -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", diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 896f3e0..9897af6 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -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", diff --git a/src/app/componets/Sidebar.tsx b/src/app/componets/Sidebar.tsx index fe8de48..95662d9 100644 --- a/src/app/componets/Sidebar.tsx +++ b/src/app/componets/Sidebar.tsx @@ -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() + } } }} > @@ -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() + } } }} > diff --git a/src/app/componets/VersionInfo.tsx b/src/app/componets/VersionInfo.tsx index 0bdf4fb..b1a96e8 100644 --- a/src/app/componets/VersionInfo.tsx +++ b/src/app/componets/VersionInfo.tsx @@ -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(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 ( <>

diff --git a/src/app/game/page.tsx b/src/app/game/page.tsx index 6224484..260b514 100644 --- a/src/app/game/page.tsx +++ b/src/app/game/page.tsx @@ -26,18 +26,25 @@ export default function Installs () { } = useGlobal() const params = useSearchParams() - const [category, setCategory] = useState(-1) const id = Number(params.get('id') || 0) - if (!id) return

Invalid game

const game = serverVersionList?.games.find(g => g.id === id) - if (!game) return

Invalid game

+ + const [category, setCategory] = useState(-1) + const [lastId, setLastId] = useState(id) useEffect(() => { if (!showPopup) return setSelectedVersionList([]) }, [normalConfig, setSelectedVersionList, showPopup]) + if (!id || !game) return

Invalid game

+ + if (lastId !== id) { + setLastId(id) + setCategory(-1) + } + return (
@@ -76,68 +83,94 @@ export default function Installs () { }`} > {category == -1 && - Object.entries(game.categoryNames).map(([key, value]) => { - return ( -
{ - if (normalConfig?.settings.useLegacyInteractButtons) return - setCategory(Number(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 -
e.stopPropagation()} - > -

- {(() => { - 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'}` - })()} -

+ 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 ( +
{ + if (normalConfig?.settings.useLegacyInteractButtons) + return + setCategory(Number(key)) + }} + > +
+

{value}

+ +
e.stopPropagation()} + > +

+ {(() => { + 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'}` + })()} +

+
+ +
- -
-
- ) - })} + ) + })} {Object.keys(downloadedVersionsConfig?.list ?? []).filter(v => { const info = getVersionInfo(v) if (!info) return false @@ -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={