feat(saves): merge bulk research and purchase into one launcher action

In the launcher's Saves -> Vehicles & Research page, "Research all" only
filled vehicle RP without purchasing them, requiring players to buy each
vehicle manually in-game while a separate "Grant regular vehicles" button
already added them to the hangar.

Merge the two actions into a single "Research and buy all" (`purchase`) action
alongside "Unlock modifications" (`equipment`), and switch bulk modification
unlocking in save-research.ts to ProfileEquipmentIndex so large saves stay
O(N) and write cleanly across chunked modification blocks.

Verified with root and launcher npm run typecheck, launcher electron-vite
build, and en/zh-CN locale key parity (631 keys).
This commit is contained in:
N0VAN0M4LY committed 2026-12-03 01:19:20 +08:00
1 parent 4e72bf3746
commit deffcd6dde
5 files changed
+11 -15

No files matched your search

@@ -341,8 +341,7 @@
"country": "Country",
"type": "Vehicle type",
"actions": "Bulk actions",
"research": "Research all",
"purchase": "Grant regular vehicles",
"purchase": "Research and buy all",
"equipment": "Unlock modifications",
"empty": "This client has no eligible research branches.",
"rank": "Rank {{rank}}",
@@ -341,8 +341,7 @@
"country": "国家",
"type": "兵种",
"actions": "批量操作",
"research": "全部研发",
"purchase": "获得常规载具",
"purchase": "全部研发并购买",
"equipment": "解锁改装件",
"empty": "此客户端没有可编辑的研发分支。",
"rank": "等级 {{rank}}",
@@ -11,7 +11,7 @@ interface Props {
readonly onError: (error: unknown) => void;
}
const ACTIONS = ['research', 'purchase', 'equipment'] as const;
const ACTIONS = ['purchase', 'equipment'] as const;
export function SaveResearch({ copyId, userId, readOnly, onError }: Props) {
const { t, i18n } = useTranslation();
+1 -1
View File
@@ -94,7 +94,7 @@ export const OfficialPreviewSchema = z.object({
omitted: z.array(z.string()),
});
export const ResearchBranchSchema = z.object({ country: z.string().min(1), type: z.string().min(1) });
export const ResearchOperationSchema = z.enum(['research', 'purchase', 'equipment']);
export const ResearchOperationSchema = z.enum(['purchase', 'equipment']);
export const SaveResearchSchema = z.object({
branches: z.array(ResearchBranchSchema),
selected: ResearchBranchSchema.nullable(),