mirror of
https://github.com/dream-pep/koring-launcher.git
synced 2026-09-12 05:45:18 +08:00
Integrate @xmcl/task, import instances & UI updates
Add a new xmcl task system and instance-import workflow. Introduces electron/core/task.ts with @xmcl/task executors (install, sims), task lifecycle IPC (start/pause/resume/cancel) and stage mapping. Detect mod loaders in instance scanner and add importExistingInstance with IPC. Update front-end task store, types and UI (TaskButton, TaskCard, TaskQueue, TaskDebug) to support paused state, xmcl path/state and pause/resume actions. Improve game-dir UI with loader badges and bulk import. Small UX/dialog tweaks (alert-dialog, About) and dependency/pnpm workspace updates. Adds Koring.yml theme default.
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
getFabricVersionList,
|
||||
getQuiltVersionList,
|
||||
scanGameDirectories,
|
||||
importExistingInstance,
|
||||
type InstanceRuntime,
|
||||
type InstanceConfig,
|
||||
} from '../core/instance';
|
||||
@@ -205,4 +206,32 @@ export function registerInstanceHandlers(win: WinRef) {
|
||||
return { success: false, data: null, error: String(e) };
|
||||
}
|
||||
});
|
||||
|
||||
// 从已安装版本导入实例
|
||||
ipcMain.handle('instance:import', async (_event, payload: {
|
||||
name: string;
|
||||
gamePath: string;
|
||||
versionId: string;
|
||||
description?: string;
|
||||
java?: string;
|
||||
minMemory?: number;
|
||||
maxMemory?: number;
|
||||
}) => {
|
||||
try {
|
||||
const data = await importExistingInstance(
|
||||
payload.name,
|
||||
payload.gamePath,
|
||||
payload.versionId,
|
||||
{
|
||||
description: payload.description,
|
||||
java: payload.java,
|
||||
minMemory: payload.minMemory,
|
||||
maxMemory: payload.maxMemory,
|
||||
}
|
||||
);
|
||||
return { success: true, data, error: null };
|
||||
} catch (e: unknown) {
|
||||
return { success: false, data: null, error: String(e) };
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user