WIP home page & rework some stuff

This commit is contained in:
Lncvrt committed 2026-07-29 06:26:52 -07:00
1 parent 28b88f4033
commit 5ce8aa76ab
6 files changed
+154 -99

No files matched your search

+35 -30
View File
@@ -384,6 +384,39 @@ export default function RootLayout ({
)
}
const uninstallVersion = async (
version: string,
updateList: boolean = true
) => {
if (updateList)
await versions?.set(
'list',
Object.fromEntries(
Object.entries(versionsList).filter(([k]) => k !== version)
)
)
if (
await exists(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
version,
{
baseDir: customDataLocation ? undefined : BaseDirectory.AppLocalData
}
)
)
await remove(
(customDataLocation ? customDataLocation + '/' : null) +
'game/' +
version,
{
baseDir: customDataLocation ? undefined : BaseDirectory.AppLocalData,
recursive: true
}
)
}
const launchGame = async (versionInfo: GameVersion) => {
if (needsRevisionUpdate(versionInfo.lastRevision, versionInfo.id)) {
const answer = await ask(
@@ -409,36 +442,7 @@ export default function RootLayout ({
setFadeOut(false)
//uninstall
await versions?.set(
'list',
Object.fromEntries(
Object.entries(versionsList).filter(([k]) => k !== versionInfo.id)
)
)
if (
await exists(
customDataLocation
? customDataLocation + '/'
: null + 'game/' + versionInfo.id,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData
}
)
)
await remove(
customDataLocation
? customDataLocation + '/'
: null + 'game/' + versionInfo.id,
{
baseDir: customDataLocation
? undefined
: BaseDirectory.AppLocalData,
recursive: true
}
)
await uninstallVersion(versionInfo.id)
//reinstall
setSelectedVersionList([versionInfo.id])
@@ -912,6 +916,7 @@ export default function RootLayout ({
managingGame,
setManagingGame,
needsRevisionUpdate,
uninstallVersion,
launchGame
}}
>