feat(launcher): create dedicated WTOffline subfolder and default versioned client name
This commit is contained in:
1 parent
bfedc3d27e
commit
2820d40d87
7 files changed
+88
-11
No files matched your search
@@ -152,7 +152,8 @@
|
||||
"spaceSavingPending": "Calculating how much space can be saved.",
|
||||
"spaceSavingUnavailable": "This installation has no large resources eligible for space-saving copying.",
|
||||
"sameVolumeRequired": "Select a destination on the same volume as the original installation.",
|
||||
"targetTitle": "Select a folder for the client",
|
||||
"targetTitle": "Select an install location (a WTOffline subfolder will be created)",
|
||||
"targetSubfolderHint": "A dedicated WTOffline folder is automatically created under the selected location to keep game files organized.",
|
||||
"inPlace": "In-place installation",
|
||||
"inPlaceBody": "Uses the selected game folder directly as the client. Original files are backed up to wtoffline\\stock, and patches are applied on first launch.",
|
||||
"existing": "Add existing client",
|
||||
|
||||
@@ -152,7 +152,8 @@
|
||||
"spaceSavingPending": "正在估算可节省的空间。",
|
||||
"spaceSavingUnavailable": "该安装目录没有可用于省空间复制的大型资源。",
|
||||
"sameVolumeRequired": "请选择与原版位于同一磁盘卷的目标文件夹。",
|
||||
"targetTitle": "选择存放客户端的文件夹",
|
||||
"targetTitle": "选择安装位置(将自动创建 WTOffline 子文件夹)",
|
||||
"targetSubfolderHint": "将在所选位置下自动创建独立的 WTOffline 文件夹存放游戏文件,避免文件散落。",
|
||||
"inPlace": "原位安装",
|
||||
"inPlaceBody": "使用所选游戏文件夹作为客户端。原版文件备份至 wtoffline\\stock,首次启动时将应用补丁。",
|
||||
"existing": "添加已有客户端",
|
||||
|
||||
@@ -30,7 +30,7 @@ export function MethodStep({ source, sourceSize, choice, onChoice, onError }: Me
|
||||
const choose = (method: Method): void => onChoice({ method, target: choice.target, steamConfirmed: false });
|
||||
const inspectTarget = (path: string): void => {
|
||||
onChoice((current) => ({ ...current, target: null, steamConfirmed: false }));
|
||||
ipcInvoke('install:inspectTargetFolder', { path, stockPath: source.path })
|
||||
ipcInvoke('install:inspectTargetFolder', { path, stockPath: source.path, version: source.version })
|
||||
.then((target) => onChoice((current) => ({ ...current, target, steamConfirmed: false })))
|
||||
.catch(onError);
|
||||
};
|
||||
@@ -43,6 +43,7 @@ export function MethodStep({ source, sourceSize, choice, onChoice, onError }: Me
|
||||
const targetPicker = (
|
||||
<>
|
||||
<FolderField path={choice.target?.path ?? null} dialogTitle={t('method.targetTitle')} onChosen={inspectTarget} onError={onError} />
|
||||
<p className="small">{t('method.targetSubfolderHint')}</p>
|
||||
{choice.target && <TargetVerdict target={choice.target} sourceSize={sourceSize} method={choice.method} />}
|
||||
{steamWarning}
|
||||
</>
|
||||
|
||||
@@ -119,9 +119,20 @@ export function useInstallWizard({ onInstalled }: WizardOptions) {
|
||||
const chooseSource = (found: GameFolderInspection | null): void => {
|
||||
setSource(found);
|
||||
setStockSource(null);
|
||||
const defaultMethod = mode === 'existing' || found?.hasOfflineBackup || found?.needsStockSource ? 'existing' : 'copy';
|
||||
const isExisting = mode === 'existing' || found?.hasOfflineBackup || found?.needsStockSource;
|
||||
const defaultMethod = isExisting ? 'existing' : 'copy';
|
||||
setChoice({ method: defaultMethod, target: null, steamConfirmed: false });
|
||||
setName(found?.path.split(/[\\/]/).filter(Boolean).at(-1) ?? '');
|
||||
if (!found) {
|
||||
setName('');
|
||||
return;
|
||||
}
|
||||
const folderName = found.path.split(/[\\/]/).filter(Boolean).at(-1) ?? '';
|
||||
const genericName = /^(war thunder|wtoffline)$/i.test(folderName);
|
||||
if (!isExisting || genericName || !folderName) {
|
||||
setName(found.version ? `WTOffline ${found.version}` : 'WTOffline');
|
||||
} else {
|
||||
setName(folderName);
|
||||
}
|
||||
};
|
||||
|
||||
const install = (): void => {
|
||||
|
||||
Reference in new issue
Block a user