2022-10-18 22:04:55 +00:00
|
|
|
import patcher from "@lib/patcher";
|
|
|
|
import logger from "@lib/logger";
|
|
|
|
import * as metro from "@metro/filters";
|
|
|
|
import * as common from "@metro/common";
|
2022-10-22 22:26:06 +00:00
|
|
|
import { all, find, getAssetByID, getAssetByName, getAssetIDByName } from "@ui/assets";
|
|
|
|
import patchAssets from "@ui/assets";
|
2022-10-20 06:58:17 +00:00
|
|
|
import initSettings from "@ui/settings";
|
|
|
|
import { patchLogHook } from "@lib/debug";
|
2022-10-18 22:04:55 +00:00
|
|
|
|
|
|
|
console.log("Hello from Vendetta!");
|
2022-10-19 06:58:32 +00:00
|
|
|
let erroredOnLoad = false;
|
2022-10-18 22:04:55 +00:00
|
|
|
|
|
|
|
try {
|
2022-10-18 22:59:45 +00:00
|
|
|
initSettings();
|
2022-10-22 22:26:06 +00:00
|
|
|
patchAssets();
|
2022-10-19 22:11:44 +00:00
|
|
|
patchLogHook();
|
2022-10-18 22:59:45 +00:00
|
|
|
|
2022-10-18 22:04:55 +00:00
|
|
|
window.vendetta = {
|
|
|
|
patcher: patcher,
|
|
|
|
metro: { ...metro, common: common },
|
|
|
|
logger: logger,
|
2022-10-22 22:26:06 +00:00
|
|
|
ui: {
|
|
|
|
assets: {
|
|
|
|
all: all,
|
|
|
|
find: find,
|
|
|
|
getAssetByID: getAssetByID,
|
|
|
|
getAssetByName: getAssetByName,
|
|
|
|
getAssetIDByName: getAssetIDByName,
|
|
|
|
},
|
|
|
|
},
|
2022-10-18 22:04:55 +00:00
|
|
|
};
|
|
|
|
} catch (e: Error | any) {
|
2022-10-19 06:58:32 +00:00
|
|
|
erroredOnLoad = true;
|
2022-10-18 22:04:55 +00:00
|
|
|
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
2022-10-19 06:58:32 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (!erroredOnLoad) logger.log("Vendetta is ready!");
|