fix: Fixed romm login, now uses token
feat: Moved romm to internal plugin fix: Made focusing and navigation more reliable fix: Loading errors on first time launch
This commit is contained in:
parent
7c10f4e4c2
commit
816d50ae4d
81 changed files with 1659 additions and 1097 deletions
|
|
@ -1,25 +1,26 @@
|
|||
import { PluginManager } from "./plugin-manager";
|
||||
|
||||
import pcsx2 from './builtin/emulators/com.simeonradivoev.gameflow.pcsx2/package.json';
|
||||
import romm from './builtin/sources/com.simeonradivoev.gameflow.romm/package.json';
|
||||
import { PluginDescriptionSchema, PluginDescriptionType, PluginSchema } from "@/bun/types/typesc.schema";
|
||||
import path from "node:path";
|
||||
|
||||
export default async function register (pluginManager: PluginManager)
|
||||
{
|
||||
|
||||
const plugins: (PluginDescriptionType & { main: string; root: string; })[] = [
|
||||
{ ...pcsx2, root: './builtin/emulators/com.simeonradivoev.gameflow.pcsx2' }
|
||||
const plugins: (PluginDescriptionType & { main: string; load: () => Promise<any>; })[] = [
|
||||
{ ...pcsx2, load: () => import('./builtin/emulators/com.simeonradivoev.gameflow.pcsx2/pcsx2') },
|
||||
{ ...romm, load: () => import('./builtin/sources/com.simeonradivoev.gameflow.romm/romm') },
|
||||
];
|
||||
|
||||
await Promise.all(plugins.map(async (pluginPackage) =>
|
||||
{
|
||||
const file = await import(`./${path.join(pluginPackage.root, pluginPackage.main)}`);
|
||||
const file = await pluginPackage.load();
|
||||
if (file.default && typeof file.default === 'function')
|
||||
{
|
||||
const pluginInstance = new file.default();
|
||||
const plugin = await PluginSchema.parseAsync(pluginInstance);
|
||||
await PluginSchema.parseAsync(pluginInstance);
|
||||
const description = await PluginDescriptionSchema.parseAsync(pluginPackage);
|
||||
pluginManager.register(plugin, description, 'builtin');
|
||||
pluginManager.register(pluginInstance, description, 'builtin');
|
||||
}
|
||||
}));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue