[Init] Async-ify, for future use
This commit is contained in:
parent
91be38564d
commit
88e4f357a4
1 changed files with 28 additions and 23 deletions
51
src/index.ts
51
src/index.ts
|
@ -8,30 +8,35 @@ import initSettings from "@ui/settings";
|
||||||
import { patchLogHook } from "@lib/debug";
|
import { patchLogHook } from "@lib/debug";
|
||||||
|
|
||||||
console.log("Hello from Vendetta!");
|
console.log("Hello from Vendetta!");
|
||||||
let erroredOnLoad = false;
|
|
||||||
|
|
||||||
try {
|
async function init() {
|
||||||
initSettings();
|
let erroredOnLoad = false;
|
||||||
patchAssets();
|
|
||||||
patchLogHook();
|
|
||||||
|
|
||||||
window.vendetta = {
|
try {
|
||||||
patcher: patcher,
|
initSettings();
|
||||||
metro: { ...metro, common: common },
|
patchAssets();
|
||||||
logger: logger,
|
patchLogHook();
|
||||||
ui: {
|
|
||||||
assets: {
|
window.vendetta = {
|
||||||
all: all,
|
patcher: patcher,
|
||||||
find: find,
|
metro: { ...metro, common: common },
|
||||||
getAssetByID: getAssetByID,
|
logger: logger,
|
||||||
getAssetByName: getAssetByName,
|
ui: {
|
||||||
getAssetIDByName: getAssetIDByName,
|
assets: {
|
||||||
|
all: all,
|
||||||
|
find: find,
|
||||||
|
getAssetByID: getAssetByID,
|
||||||
|
getAssetByName: getAssetByName,
|
||||||
|
getAssetIDByName: getAssetIDByName,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
};
|
} catch (e: Error | any) {
|
||||||
} catch (e: Error | any) {
|
erroredOnLoad = true;
|
||||||
erroredOnLoad = true;
|
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
||||||
alert(`Vendetta failed to initialize...\n${e.stack || e.toString()}`);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!erroredOnLoad) logger.log("Vendetta is ready!");
|
if (!erroredOnLoad) logger.log("Vendetta is ready!");
|
||||||
|
};
|
||||||
|
|
||||||
|
init();
|
Loading…
Reference in a new issue