1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-12-13 18:21:51 +00:00

Add support for loading mods from external sources in DEV

This commit is contained in:
tobspr 2022-01-14 17:23:41 +01:00
parent 99e49d5abb
commit 27e4dc9ba5
2 changed files with 4 additions and 4 deletions

View File

@ -116,8 +116,8 @@ export default {
// Disables slow asserts, useful for debugging performance
// disableSlowAsserts: true,
// -----------------------------------------------------------------------------------
// Loads the dev_mod.js for developing new mods
// loadDevMod: true,
// Allows to load a mod from an external source for developing it
// externalModUrl: "http://localhost:3005/mods/demo_mod.nobuild/index.js",
// -----------------------------------------------------------------------------------
/* dev:end */
};

View File

@ -40,9 +40,9 @@ export class ModLoader {
let mods = [];
if (G_IS_STANDALONE) {
mods = await getIPCRenderer().invoke("get-mods");
} else if (G_IS_DEV && globalConfig.debug.loadDevMod) {
} else if (G_IS_DEV && globalConfig.debug.externalModUrl) {
const mod = await (
await fetch("http://localhost:3005/mods/demo_mod.nobuild/index.js", {
await fetch(globalConfig.debug.externalModUrl, {
method: "GET",
})
).text();