feat: Implemented public plugin system accessible from the store.
feat: Implemented external ryujinx integration plugin refactor: moved sdk types and schemas to own workspace package fix: Fixed emulator launch with no game
This commit is contained in:
parent
9051834ace
commit
38cb752552
124 changed files with 1918 additions and 1067 deletions
39
src/packages/gameflow-sdk/hooks/emulators.ts
Normal file
39
src/packages/gameflow-sdk/hooks/emulators.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
|
||||
import { EmulatorPostInstallContextType } from "../index";
|
||||
import { DownloadFileEntry, EmulatorSourceEntryType, EmulatorSystem } from "../shared";
|
||||
import { AsyncSeriesBailHook, AsyncSeriesHook } from "tapable";
|
||||
|
||||
export default class EmulatorHooks
|
||||
{
|
||||
fetchBiosDownload = new AsyncSeriesBailHook<[ctx: {
|
||||
emulator: string;
|
||||
systems: EmulatorSystem[];
|
||||
biosFolder: string;
|
||||
}], { auth?: string, files: DownloadFileEntry[]; } | undefined>(['ctx']);
|
||||
|
||||
/**
|
||||
* Triggered when emulator is downloaded or updated
|
||||
*/
|
||||
emulatorPostInstall = new AsyncSeriesHook<[ctx: EmulatorPostInstallContextType], { emulator: string; }>(['ctx']);
|
||||
findEmulatorSource = new AsyncSeriesHook<[ctx: { emulator: string; sources: EmulatorSourceEntryType[]; }]>(['ctx']);
|
||||
findEmulatorForSystem = new AsyncSeriesHook<[ctx: { system: string; emulators: string[]; }]>(['ctx']);
|
||||
|
||||
constructor()
|
||||
{
|
||||
this.emulatorPostInstall.intercept({
|
||||
register (tap)
|
||||
{
|
||||
return {
|
||||
...tap,
|
||||
fn: async (ctx: EmulatorPostInstallContextType, ...rest: any[]) =>
|
||||
{
|
||||
if (ctx.emulator === tap.emulator)
|
||||
{
|
||||
tap.fn(ctx, ...rest);
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue