2023-02-04 02:30:46 +00:00
|
|
|
import { patchLogHook } from "@lib/debug";
|
|
|
|
import { patchCommands } from "@lib/commands";
|
|
|
|
import { initPlugins } from "@lib/plugins";
|
|
|
|
import { patchAssets } from "@ui/assets";
|
2022-10-20 06:58:17 +00:00
|
|
|
import initSettings from "@ui/settings";
|
2023-02-04 02:30:46 +00:00
|
|
|
import fixTheme from "@ui/fixTheme";
|
|
|
|
import windowObject from "@lib/windowObject";
|
|
|
|
import logger from "@lib/logger";
|
2022-10-18 22:04:55 +00:00
|
|
|
|
2023-02-04 02:30:46 +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!");
|
|
|
|
|
2023-02-26 00:34:16 +00:00
|
|
|
(async () => {
|
2022-10-25 22:50:18 +00:00
|
|
|
try {
|
2023-02-04 02:30:46 +00:00
|
|
|
// Load everything in parallel
|
|
|
|
const unloads = await Promise.all([
|
|
|
|
patchLogHook(),
|
|
|
|
patchAssets(),
|
|
|
|
patchCommands(),
|
|
|
|
fixTheme(),
|
|
|
|
initSettings(),
|
|
|
|
]);
|
2023-01-01 21:10:09 +00:00
|
|
|
|
2023-02-04 02:30:46 +00:00
|
|
|
// 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
|
|
|
}
|
2023-02-26 00:34:16 +00:00
|
|
|
})();
|