Revenge/src/index.ts

35 lines
1 KiB
TypeScript
Raw Normal View History

import { patchLogHook } from "@lib/debug";
import { patchCommands } from "@lib/commands";
import { initPlugins } from "@lib/plugins";
import { patchAssets } from "@ui/assets";
import initSettings from "@ui/settings";
import fixTheme from "@ui/fixTheme";
import windowObject from "@lib/windowObject";
import logger from "@lib/logger";
2022-10-18 22:04:55 +00:00
// This logs in the native logging implementation, e.g. logcat
2022-10-18 22:04:55 +00:00
console.log("Hello from Vendetta!");
(async () => {
2022-10-25 22:50:18 +00:00
try {
// Load everything in parallel
const unloads = await Promise.all([
patchLogHook(),
patchAssets(),
patchCommands(),
fixTheme(),
initSettings(),
]);
// Assign window object
window.vendetta = await windowObject(unloads);
// Once done, load plugins
unloads.push(await initPlugins());
// We good :)
logger.log("Vendetta is ready!");
} catch (e: any) {
2023-01-07 03:13:16 +00:00
alert(`Vendetta failed to initialize... ${e.stack || e.toString()}`);
2022-10-25 22:50:18 +00:00
}
})();