fix(launcher): enable standard game launch
Remove the development gate from the launcher and keep the guarded development handoff available. Verified by type checking, Windows packaging, and opening the packaged launcher with a temporary profile.
This commit is contained in:
1 parent
746b74c564
commit
b3a30c0fd9
10 files changed
+8
-26
No files matched your search
@@ -2,7 +2,7 @@ import { useEffect, useState, type ReactNode } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { IpcOutput } from '@shared/ipc/contract.ts';
|
||||
import type { Copies } from '@shared/schemas/install.ts';
|
||||
import { ORDINARY_LAUNCH_ENABLED, type LaunchState } from '@shared/schemas/launch.ts';
|
||||
import type { LaunchState } from '@shared/schemas/launch.ts';
|
||||
import type { Settings } from '@shared/schemas/settings.ts';
|
||||
import { Sheet } from './components/Sheet.tsx';
|
||||
import { applyLanguage, resolveLanguage } from './i18n/index.ts';
|
||||
@@ -98,7 +98,6 @@ export function App({ info, initialSettings, initialCopies }: AppProps) {
|
||||
const perCopyStatus = ['version-changed', 'failed', 'port-busy', 'server-exited'].includes(launch.phase);
|
||||
const launchStatus: LaunchState = perCopyStatus && launch.copyId && launch.copyId !== record?.id ? { phase: 'ready' } : launch;
|
||||
const home = homeBar(record, launchStatus, t, wizard.start, {
|
||||
canStart: ORDINARY_LAUNCH_ENABLED || (info.development && settings.developerMode),
|
||||
start: () => { ipcInvoke('launch:start').catch(report); },
|
||||
stop: () => { ipcInvoke('launch:stop').catch(report); },
|
||||
checkVersion: () => go({ page: 'copies', section: 'features' }),
|
||||
|
||||
@@ -644,7 +644,7 @@
|
||||
"launch_no_copy": "A game copy must be installed before launching.",
|
||||
"launch_busy": "A launch is already in progress.",
|
||||
"launch_failed": "Launch failed. See the launcher log.",
|
||||
"launch_disabled": "Standard launch is pending isolation verification.",
|
||||
"launch_platform_unsupported": "Game launch requires Windows.",
|
||||
"launch_lab_required": "Enable developer mode to launch through the isolated lab.",
|
||||
"launch_lab_missing": "The isolated lab automation could not be loaded.",
|
||||
"launch_lab_version": "The lab copy and the stock backup must use the same game version.",
|
||||
|
||||
@@ -644,7 +644,7 @@
|
||||
"launch_no_copy": "启动前需要安装游戏副本。",
|
||||
"launch_busy": "启动流程正在运行。",
|
||||
"launch_failed": "启动失败。请查看启动器日志。",
|
||||
"launch_disabled": "普通启动待隔离验收。",
|
||||
"launch_platform_unsupported": "启动游戏需要 Windows。",
|
||||
"launch_lab_required": "请启用开发模式以通过隔离实验副本启动。",
|
||||
"launch_lab_missing": "无法读取隔离实验自动化配置。",
|
||||
"launch_lab_version": "实验副本和原版文件备份必须使用同一游戏版本。",
|
||||
|
||||
@@ -5,7 +5,6 @@ import type { BarModel } from '../../shell/bar-model.ts';
|
||||
import { missingFeatures } from '../copies/missing-features.ts';
|
||||
|
||||
interface LaunchActions {
|
||||
readonly canStart: boolean;
|
||||
readonly start: () => void;
|
||||
readonly stop: () => void;
|
||||
readonly checkVersion: () => void;
|
||||
@@ -19,8 +18,8 @@ export function homeBar(
|
||||
onInstall: () => void,
|
||||
actions: LaunchActions,
|
||||
): BarModel {
|
||||
const launch = { label: t('bar.launch'), onClick: actions.start, disabled: !actions.canStart };
|
||||
const retry = { label: t('launch.retry'), onClick: actions.start, disabled: !actions.canStart };
|
||||
const launch = { label: t('bar.launch'), onClick: actions.start };
|
||||
const retry = { label: t('launch.retry'), onClick: actions.start };
|
||||
const starting = { label: t('launch.starting'), disabled: true };
|
||||
const progress = { value: state.filesWritten ?? 0, max: state.filesTotal || null };
|
||||
switch (state.phase) {
|
||||
@@ -85,9 +84,6 @@ export function homeBar(
|
||||
primary: { label: t('bar.install'), onClick: onInstall },
|
||||
};
|
||||
}
|
||||
if (!actions.canStart) {
|
||||
return { tone: 'warn', title: t('errors.launch_disabled'), primary: launch };
|
||||
}
|
||||
const missing = missingFeatures(record).length;
|
||||
return {
|
||||
tone: missing ? 'warn' : 'ok',
|
||||
|
||||
@@ -2,7 +2,6 @@ import { useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import type { IpcOutput } from '@shared/ipc/contract.ts';
|
||||
import { parseLaunchArguments } from '@shared/launch-arguments.ts';
|
||||
import { ORDINARY_LAUNCH_ENABLED } from '@shared/schemas/launch.ts';
|
||||
import { LAUNCH_ARGUMENTS_LIMIT, type Settings, type SettingsPatch } from '@shared/schemas/settings.ts';
|
||||
import { Row } from '../../components/Row.tsx';
|
||||
import { Sheet } from '../../components/Sheet.tsx';
|
||||
@@ -37,9 +36,6 @@ export function LaunchSettings({ settings, development, onError }: LaunchSetting
|
||||
</Sheet>
|
||||
);
|
||||
}
|
||||
if (!ORDINARY_LAUNCH_ENABLED) {
|
||||
return <Sheet title={title}><p className="lead">{t('errors.launch_disabled')}</p></Sheet>;
|
||||
}
|
||||
|
||||
return (
|
||||
<Sheet title={title}>
|
||||
|
||||
Reference in new issue
Block a user