feat: add way to select game dir

This commit is contained in:
lucasdpt
2026-06-17 20:43:27 +02:00
parent b8204c80bd
commit 161ea50234
7 changed files with 212 additions and 18 deletions
+10 -1
View File
@@ -9,7 +9,8 @@ import {
type DeviceCodeInfo,
type UpdateStatus,
type PlayOptions,
type PackMeta
type PackMeta,
type DataDirInfo
} from '../shared/ipc'
/** API typée exposée au renderer via window.api. */
@@ -39,6 +40,14 @@ const api = {
/** Quitte et installe la mise à jour téléchargée. */
installUpdate: (): Promise<void> => ipcRenderer.invoke(IPC.updateInstall),
// --- Dossier de données ---
isFirstLaunch: (): Promise<boolean> => ipcRenderer.invoke(IPC.isFirstLaunch),
getDataDir: (): Promise<DataDirInfo> => ipcRenderer.invoke(IPC.dataDirGet),
browseDataDir: (): Promise<string | null> => ipcRenderer.invoke(IPC.dataDirBrowse),
/** relaunch=true : relance l'app (pour un changement post-installation). */
setDataDir: (dir: string, relaunch: boolean): Promise<string> =>
ipcRenderer.invoke(IPC.dataDirSet, dir, relaunch),
// --- Abonnements aux événements (retournent une fonction de désabonnement) ---
onProgress: (cb: (e: ProgressEvent) => void): (() => void) => {
const handler = (_: unknown, e: ProgressEvent): void => cb(e)