feat(launcher): prompt for stock source when adding patched client without backup

This commit is contained in:
N0VAN0M4LY committed 2026-11-30 20:59:38 +08:00
1 parent 39228c6e75
commit bfedc3d27e
13 files changed
+195 -41

No files matched your search

+4
View File
@@ -69,6 +69,10 @@ export const APP_ERROR_CODES = [
'folder_unreadable',
/** The chosen folder lacks the files of a War Thunder installation (params: path). */
'not_a_game_folder',
/** A patched client lacking wtoffline/stock needs an unpatched original game folder. */
'stock_source_invalid',
/** The chosen original game folder has a different version than the patched client. */
'stock_source_version_mismatch',
/** The folder chosen for the copy cannot take it (params: problem, one of TARGET_PROBLEMS). */
'target_not_usable',
/** A copy or data folder is inside a Steam library and the player has not confirmed the warning. */
+6 -2
View File
@@ -89,8 +89,12 @@ export const ipcContract = {
output: FolderSizeSchema,
},
'install:checkPatches': {
/** The game folder to install from, and the data folder whose store tuning the build uses. */
input: z.object({ gamePath: z.string().min(1), dataPath: z.string().min(1) }),
/** The game folder to install from, optional stock source folder, and the data folder whose store tuning the build uses. */
input: z.object({
gamePath: z.string().min(1),
dataPath: z.string().min(1),
stockSourcePath: z.string().min(1).optional(),
}),
output: PatchCheckSchema,
},
'install:start': {
@@ -14,6 +14,8 @@ export const GameFolderInspectionSchema = z.object({
inSteamLibrary: z.boolean(),
/** True when the folder already holds a complete wtoffline/stock backup from an offline setup. */
hasOfflineBackup: z.boolean(),
/** True when the folder is already patched for offline use but lacks a wtoffline/stock backup. */
needsStockSource: z.boolean(),
});
export type GameFolderInspection = z.output<typeof GameFolderInspectionSchema>;
@@ -111,11 +113,15 @@ export const InstallRequestSchema = z.discriminatedUnion('method', [
method: z.literal('in-place'),
/** The player's prepared game folder, used as the game copy. */
gamePath: z.string().min(1),
/** Optional unpatched game folder to supply the 4 stock files when the folder is already patched. */
stockSourcePath: z.string().min(1).optional(),
}),
InstallChoicesSchema.extend({
method: z.literal('existing'),
/** An already prepared offline client folder registered directly without copying. */
gamePath: z.string().min(1),
/** Optional unpatched game folder to supply the 4 stock files when wtoffline/stock is missing. */
stockSourcePath: z.string().min(1).optional(),
}),
]);
export type InstallRequest = z.output<typeof InstallRequestSchema>;