feat(launcher): redesign the main launcher window
The window is now a fixed 1120x720 frameless window with its own title bar: page navigation, language, minimize and close. The layout follows the game's launcher: a side panel, the main area over the background, and a bottom bar with the state of the current task and the primary action. The colours and type follow the game's website: dark blue-grey, red actions, Roboto Condensed (bundled, OFL), cyan progress. - Pages: home (requirements before installation, the current copy after), copies (copy details with folders to open, feature status grouped by inventory section), settings (language), about. - The install wizard is a hook shared by the side panel (step list), the main area (current step) and the bottom bar (back, next, install, cancel, copy progress). - The adaptation shown for a game version is the version itself when the patches were verified on it, otherwise the nearest verified one. - Both language packs are rewritten in consistent product wording. - New IPC: app:openFolder, install:listFeatures (patcher's new patchFeatures), window:minimize, window:close; app:getInfo reports the supported game versions. Launching is not built yet; its button stays disabled. Checked: launcher typecheck (main and renderer), electron-vite build, root typecheck. Ran the window from a scratch user data folder over the remote debugging port: every page and section in Chinese and English, empty and installed state, the wizard's first step, both new IPC calls, no console errors and no overflow.
This commit is contained in:
1 parent
c442d6b83c
commit
81c900a61d
51 files changed
+2810
-771
No files matched your search
@@ -14,6 +14,8 @@ export const IPC_CHANNEL_PREFIXES = [
|
||||
'install:',
|
||||
/** The launcher's own settings. */
|
||||
'settings:',
|
||||
/** The launcher window itself (it draws its own title bar). */
|
||||
'window:',
|
||||
] as const;
|
||||
|
||||
/** Prefix of main → renderer event channels. */
|
||||
|
||||
@@ -6,6 +6,7 @@ import {
|
||||
InstallRecordSchema,
|
||||
InstallRequestSchema,
|
||||
PatchCheckSchema,
|
||||
PatchFeatureSchema,
|
||||
TargetFolderInspectionSchema,
|
||||
} from '../schemas/install.ts';
|
||||
import { SettingsPatchSchema, SettingsSchema } from '../schemas/settings.ts';
|
||||
@@ -26,8 +27,15 @@ export const ipcContract = {
|
||||
/** The operating system's preferred language, as Electron reports it (e.g. "zh-CN"). */
|
||||
systemLocale: z.string(),
|
||||
userDataPath: z.string(),
|
||||
/** The game versions every patch was verified on. */
|
||||
supportedGameVersions: z.array(z.string()),
|
||||
}),
|
||||
},
|
||||
'app:openFolder': {
|
||||
/** Opens a folder in the file manager; refused unless it exists. */
|
||||
input: z.object({ path: z.string().min(1) }),
|
||||
output: z.void(),
|
||||
},
|
||||
'dialog:pickFolder': {
|
||||
/** The dialog title, already translated by the window. */
|
||||
input: z.object({ title: z.string().optional() }),
|
||||
@@ -65,6 +73,11 @@ export const ipcContract = {
|
||||
input: z.void(),
|
||||
output: z.object({ record: InstallRecordSchema.nullable(), defaultDataPath: z.string() }),
|
||||
},
|
||||
'install:listFeatures': {
|
||||
/** Every feature the patches cover; which of them a copy lacks is in its install record. */
|
||||
input: z.void(),
|
||||
output: z.array(PatchFeatureSchema),
|
||||
},
|
||||
'settings:get': {
|
||||
input: z.void(),
|
||||
output: SettingsSchema,
|
||||
@@ -73,6 +86,14 @@ export const ipcContract = {
|
||||
input: SettingsPatchSchema,
|
||||
output: SettingsSchema,
|
||||
},
|
||||
'window:minimize': {
|
||||
input: z.void(),
|
||||
output: z.void(),
|
||||
},
|
||||
'window:close': {
|
||||
input: z.void(),
|
||||
output: z.void(),
|
||||
},
|
||||
} as const;
|
||||
|
||||
export const ipcEvents = {
|
||||
|
||||
@@ -51,6 +51,16 @@ export const UnavailablePatchSchema = z.object({
|
||||
});
|
||||
export type UnavailablePatch = z.output<typeof UnavailablePatchSchema>;
|
||||
|
||||
/** A feature inventory row the patches cover, with the patches behind it. */
|
||||
export const PatchFeatureSchema = z.object({
|
||||
/** The feature tag, e.g. "K-侦察"; the letter before the dash is the inventory section. */
|
||||
tag: z.string(),
|
||||
/** A copy cannot run, or cannot stay apart from the online game, without it. */
|
||||
essential: z.boolean(),
|
||||
patchIds: z.array(z.string()),
|
||||
});
|
||||
export type PatchFeature = z.output<typeof PatchFeatureSchema>;
|
||||
|
||||
/** Which patches fit the game build; nothing is written by the check. */
|
||||
export const PatchCheckSchema = z.object({
|
||||
exePatchesReady: z.number(),
|
||||
|
||||
Reference in new issue
Block a user