Show whether a game version is verified instead of a nearest adaptation
Patches locate themselves in each game build, so nothing is chosen per game version: a version without a check record is installed with every patch tried, and the copy's patch check says which features work. The pages showed an "adaptation version" and, for an unchecked version, the nearest checked one as if its patches were used. They now show whether the version is verified, and say that an unverified one still tries every patch.
This commit is contained in:
1 parent
f4d2916f0d
commit
abf958e2a6
8 files changed
+36
-54
No files matched your search
@@ -49,7 +49,7 @@
|
||||
"spaceValue": "About 97 GB (copy installation)",
|
||||
"currentCopy": "Current copy",
|
||||
"copyName": "Game copy",
|
||||
"adaptation": "Adaptation",
|
||||
"adaptation": "Check status",
|
||||
"features": "Features",
|
||||
"allAvailable": "✓ All available",
|
||||
"someMissing": "⚠ {{count}} unavailable",
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
"adaptation": {
|
||||
"verified": "✓ Verified",
|
||||
"nearest": "⚠ Nearest version"
|
||||
"unverified": "⚠ Not verified"
|
||||
},
|
||||
"bar": {
|
||||
"notInstalled": "Not installed",
|
||||
@@ -114,8 +114,8 @@
|
||||
"body": "Select the folder where War Thunder is installed.",
|
||||
"dialogTitle": "Select the War Thunder installation folder",
|
||||
"notAGame": "The selected folder is not a War Thunder installation. Missing: {{files}}",
|
||||
"versionVerified": "Game version {{version}} · Adaptation {{version}} (verified)",
|
||||
"versionUnverified": "Game version {{version}} will use adaptation {{nearest}}. Check the patches to see which features are available.",
|
||||
"versionVerified": "Game version {{version}} (verified)",
|
||||
"versionUnverified": "Game version {{version}} has no check record yet. Installing still tries every patch; the patch check shows which features are available.",
|
||||
"versionUnknown": "unknown",
|
||||
"size": "Size {{size}} · {{files}} files",
|
||||
"measuring": "Calculating size…"
|
||||
@@ -211,8 +211,8 @@
|
||||
"rename": "Rename",
|
||||
"source": "Installation source",
|
||||
"version": "Game version",
|
||||
"adaptation": "Adaptation",
|
||||
"adaptationHint": "Selected automatically by game version",
|
||||
"adaptation": "Check status",
|
||||
"adaptationHint": "Whether every patch was checked on this game version and verified in game",
|
||||
"location": "Location",
|
||||
"method": "Installation type",
|
||||
"methods": {
|
||||
@@ -231,6 +231,7 @@
|
||||
"lead": "Patch compatibility determines which features are available. Installation requires all essential patches.",
|
||||
"essential": "Required",
|
||||
"verifiedOn": "Verified: {{version}}",
|
||||
"passedCheck": "Passed the patch check (this game version is not verified)",
|
||||
"unavailable": "Patch does not apply: {{patches}}",
|
||||
"allAvailable": "All available",
|
||||
"someMissing": "{{count}} unavailable",
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
"spaceValue": "约 97 GB(复制安装)",
|
||||
"currentCopy": "当前副本",
|
||||
"copyName": "游戏副本",
|
||||
"adaptation": "适配版本",
|
||||
"adaptation": "核对状态",
|
||||
"features": "功能",
|
||||
"allAvailable": "✓ 全部可用",
|
||||
"someMissing": "⚠ {{count}} 项不可用",
|
||||
@@ -57,7 +57,7 @@
|
||||
},
|
||||
"adaptation": {
|
||||
"verified": "✓ 已核对",
|
||||
"nearest": "⚠ 就近适配"
|
||||
"unverified": "⚠ 未核对"
|
||||
},
|
||||
"bar": {
|
||||
"notInstalled": "未安装",
|
||||
@@ -114,8 +114,8 @@
|
||||
"body": "选择已安装的战争雷霆文件夹。",
|
||||
"dialogTitle": "选择战争雷霆安装文件夹",
|
||||
"notAGame": "所选文件夹不是战争雷霆的安装文件夹,缺少:{{files}}",
|
||||
"versionVerified": "游戏版本 {{version}} · 适配版本 {{version}}(已核对)",
|
||||
"versionUnverified": "游戏版本 {{version}} 将使用适配版本 {{nearest}}。可用功能以补丁检查结果为准。",
|
||||
"versionVerified": "游戏版本 {{version}}(已核对)",
|
||||
"versionUnverified": "游戏版本 {{version}} 还没有核对记录。安装时仍会逐个尝试全部补丁,可用功能以补丁检查结果为准。",
|
||||
"versionUnknown": "未知",
|
||||
"size": "大小 {{size}} · {{files}} 个文件",
|
||||
"measuring": "正在统计大小…"
|
||||
@@ -211,8 +211,8 @@
|
||||
"rename": "重命名",
|
||||
"source": "安装来源",
|
||||
"version": "游戏版本",
|
||||
"adaptation": "适配版本",
|
||||
"adaptationHint": "按游戏版本自动选择",
|
||||
"adaptation": "核对状态",
|
||||
"adaptationHint": "这个游戏版本是否检查过全部补丁并在游戏里验证过",
|
||||
"location": "位置",
|
||||
"method": "安装方式",
|
||||
"methods": {
|
||||
@@ -231,6 +231,7 @@
|
||||
"lead": "补丁检查结果决定功能是否可用。安装需要全部必需补丁。",
|
||||
"essential": "必需",
|
||||
"verifiedOn": "已核对:{{version}}",
|
||||
"passedCheck": "补丁检查通过(这个游戏版本未核对)",
|
||||
"unavailable": "补丁不适用:{{patches}}",
|
||||
"allAvailable": "全部可用",
|
||||
"someMissing": "{{count}} 项不可用",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { Copies } from '@shared/schemas/install.ts';
|
||||
import { Sheet } from '../../components/Sheet.tsx';
|
||||
import { adaptationFor } from '../../versions.ts';
|
||||
import { isVerified } from '../../versions.ts';
|
||||
|
||||
interface CopyListProps {
|
||||
readonly registry: Copies;
|
||||
@@ -29,7 +29,11 @@ export function CopyList({ registry, supportedVersions, onSelect, onAdd }: CopyL
|
||||
<dt>{t('copies.summary.version')}</dt>
|
||||
<dd>{copy.gameVersion ?? unknown}</dd>
|
||||
<dt>{t('copies.summary.adaptation')}</dt>
|
||||
<dd>{adaptationFor(copy.gameVersion, supportedVersions) ?? unknown}</dd>
|
||||
<dd>
|
||||
{isVerified(copy.gameVersion, supportedVersions)
|
||||
? <span className="ok">{t('adaptation.verified')}</span>
|
||||
: <span className="warn">{t('adaptation.unverified')}</span>}
|
||||
</dd>
|
||||
<dt>{t('copies.summary.location')}</dt>
|
||||
<dd className="folder-path" title={copy.copyPath}>{copy.copyPath}</dd>
|
||||
</dl>
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { InstallRecord } from '@shared/schemas/install.ts';
|
||||
import { Row } from '../../components/Row.tsx';
|
||||
import { Sheet } from '../../components/Sheet.tsx';
|
||||
import { ipcInvoke } from '../../ipc.ts';
|
||||
import { adaptationFor, isVerified } from '../../versions.ts';
|
||||
import { isVerified } from '../../versions.ts';
|
||||
import { missingFeatures } from './missing-features.ts';
|
||||
|
||||
interface CopySummaryProps {
|
||||
@@ -37,8 +37,7 @@ export function CopySummary({ record, supportedVersions, onShowFeatures, onError
|
||||
</Row>
|
||||
<Row label={t('copies.summary.version')}>{record.gameVersion ?? t('source.versionUnknown')}</Row>
|
||||
<Row label={t('copies.summary.adaptation')} hint={t('copies.summary.adaptationHint')}>
|
||||
{adaptationFor(record.gameVersion, supportedVersions) ?? t('source.versionUnknown')}
|
||||
<span className={verified ? 'ok' : 'warn'}>{verified ? t('adaptation.verified') : t('adaptation.nearest')}</span>
|
||||
<span className={verified ? 'ok' : 'warn'}>{verified ? t('adaptation.verified') : t('adaptation.unverified')}</span>
|
||||
</Row>
|
||||
<Row label={t('copies.summary.location')}>{folder(record.copyPath)}</Row>
|
||||
<Row label={t('copies.summary.method')}>{t(`copies.summary.methods.${record.method}`)}</Row>
|
||||
|
||||
@@ -4,7 +4,7 @@ import type { InstallRecord, PatchFeature } from '@shared/schemas/install.ts';
|
||||
import { Sheet } from '../../components/Sheet.tsx';
|
||||
import { featureName } from '../../features.ts';
|
||||
import { ipcInvoke } from '../../ipc.ts';
|
||||
import { adaptationFor } from '../../versions.ts';
|
||||
import { isVerified } from '../../versions.ts';
|
||||
|
||||
interface FeatureStatusProps {
|
||||
readonly record: InstallRecord;
|
||||
@@ -31,7 +31,9 @@ export function FeatureStatus({ record, supportedVersions, onError }: FeatureSta
|
||||
for (const patch of record.unavailablePatches) {
|
||||
for (const tag of patch.features) unavailable.set(tag, [...(unavailable.get(tag) ?? []), patch.patchId]);
|
||||
}
|
||||
const adaptation = adaptationFor(record.gameVersion, supportedVersions) ?? t('source.versionUnknown');
|
||||
const available = isVerified(record.gameVersion, supportedVersions)
|
||||
? t('copies.features.verifiedOn', { version: record.gameVersion })
|
||||
: t('copies.features.passedCheck');
|
||||
const sections = groupBySection(features ?? []);
|
||||
|
||||
return (
|
||||
@@ -54,7 +56,7 @@ export function FeatureStatus({ record, supportedVersions, onError }: FeatureSta
|
||||
{feature.essential && <> <span className="tag">{t('copies.features.essential')}</span></>}
|
||||
</span>
|
||||
<span className={failed ? 'feature-note feature-note-warning' : 'feature-note'}>
|
||||
{failed ? t('copies.features.unavailable', { patches: failed.join(', ') }) : t('copies.features.verifiedOn', { version: adaptation })}
|
||||
{failed ? t('copies.features.unavailable', { patches: failed.join(', ') }) : available}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { InstallRecord } from '@shared/schemas/install.ts';
|
||||
import type { Destination } from '../../shell/navigation.ts';
|
||||
import { adaptationFor, isVerified } from '../../versions.ts';
|
||||
import { isVerified } from '../../versions.ts';
|
||||
import { missingFeatures } from '../copies/missing-features.ts';
|
||||
|
||||
interface HomeSideProps {
|
||||
@@ -35,7 +35,6 @@ export function HomeSide({ record, copies, supportedVersions, onNavigate, onSele
|
||||
);
|
||||
}
|
||||
const missing = missingFeatures(record).length;
|
||||
const adaptation = adaptationFor(record.gameVersion, supportedVersions);
|
||||
return (
|
||||
<>
|
||||
<h3 className="side-heading">{t('side.currentCopy')}</h3>
|
||||
@@ -59,10 +58,9 @@ export function HomeSide({ record, copies, supportedVersions, onNavigate, onSele
|
||||
<dl className="kv">
|
||||
<dt>{t('side.adaptation')}</dt>
|
||||
<dd>
|
||||
{adaptation ?? t('source.versionUnknown')}{' '}
|
||||
{isVerified(record.gameVersion, supportedVersions)
|
||||
? <span className="ok">{t('adaptation.verified')}</span>
|
||||
: <span className="warn">{t('adaptation.nearest')}</span>}
|
||||
: <span className="warn">{t('adaptation.unverified')}</span>}
|
||||
</dd>
|
||||
<dt>{t('side.features')}</dt>
|
||||
<dd>
|
||||
|
||||
@@ -4,7 +4,7 @@ import { FolderField } from '../../components/FolderField.tsx';
|
||||
import { Notice } from '../../components/Notice.tsx';
|
||||
import { formatBytes } from '../../format.ts';
|
||||
import { ipcInvoke } from '../../ipc.ts';
|
||||
import { adaptationFor, isVerified } from '../../versions.ts';
|
||||
import { isVerified } from '../../versions.ts';
|
||||
|
||||
interface SourceStepProps {
|
||||
readonly source: GameFolderInspection | null;
|
||||
@@ -48,10 +48,7 @@ function SourceVerdict({ source, sourceSize, supportedVersions }: { readonly sou
|
||||
return (
|
||||
<Notice tone="warning">
|
||||
<p>
|
||||
{t('source.versionUnverified', {
|
||||
version: source.version ?? t('source.versionUnknown'),
|
||||
nearest: adaptationFor(source.version, supportedVersions) ?? t('source.versionUnknown'),
|
||||
})}
|
||||
{t('source.versionUnverified', { version: source.version ?? t('source.versionUnknown') })}
|
||||
</p>
|
||||
<p className="small">{size}</p>
|
||||
</Notice>
|
||||
|
||||
@@ -1,31 +1,11 @@
|
||||
/**
|
||||
* Game versions against the versions the patches were verified on (multi-version adaptation:
|
||||
* the adaptation is chosen by the copy's version; without one for it, the nearest is used).
|
||||
* Game versions against the versions with a check record (patches/versions/). There is no
|
||||
* per-version selection of patches: every patch locates itself in the game build, so a version
|
||||
* without a record is still installed with every patch tried, and the patch check of that copy
|
||||
* says which features are available (docs/architecture.md 5.2).
|
||||
*/
|
||||
|
||||
/** Whether the patches were verified on this game version. */
|
||||
/** Whether this game version has a check record: every patch checked on it and verified in game. */
|
||||
export function isVerified(version: string | null, supported: readonly string[]): boolean {
|
||||
return version !== null && supported.includes(version);
|
||||
}
|
||||
|
||||
/**
|
||||
* The adaptation used for a game version: the version itself when verified, otherwise the
|
||||
* newest verified version not above it, otherwise the oldest verified version.
|
||||
*/
|
||||
export function adaptationFor(version: string | null, supported: readonly string[]): string | null {
|
||||
const sorted = [...supported].sort(compareVersions);
|
||||
if (sorted.length === 0) return null;
|
||||
if (version === null) return sorted.at(-1) ?? null;
|
||||
const notAbove = sorted.filter((candidate) => compareVersions(candidate, version) <= 0);
|
||||
return notAbove.at(-1) ?? sorted[0] ?? null;
|
||||
}
|
||||
|
||||
function compareVersions(a: string, b: string): number {
|
||||
const left = a.split('.').map(Number);
|
||||
const right = b.split('.').map(Number);
|
||||
for (let index = 0; index < Math.max(left.length, right.length); index += 1) {
|
||||
const difference = (left[index] ?? 0) - (right[index] ?? 0);
|
||||
if (difference !== 0) return difference;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user