diff --git a/sla-brp/world.json b/sla-brp/world.json index f51853e..7d97339 100644 --- a/sla-brp/world.json +++ b/sla-brp/world.json @@ -15,7 +15,7 @@ "maximum": "13" }, "system": "sla-industries-brp", - "systemVersion": "13.1.55", + "systemVersion": "13.1.56", "manifest": "https://raw.githubusercontent.com/slaguru666/sla_industries_brp/main/sla-brp/world.json", "download": "https://github.com/slaguru666/sla_industries_brp/releases/latest/download/sla-brp.zip", "url": "https://github.com/slaguru666/sla_industries_brp" diff --git a/sla-industries-brp/module/brp.mjs b/sla-industries-brp/module/brp.mjs index ca6d2d3..80341ba 100644 --- a/sla-industries-brp/module/brp.mjs +++ b/sla-industries-brp/module/brp.mjs @@ -171,6 +171,29 @@ Hooks.once("ready", async function () { console.warn("sla-industries-brp | Unable to attach SLABPNToolkit to game.brp", err); } } + // Bootstrap a complete SLA install once per world/system version on GM login. + if (game.user?.isGM && game.world && game.brp?.SLASeedImporter?.runFullSLAInstaller) { + try { + const installFlagKey = "fullInstallVersion"; + const currentVersion = String(game.system.version ?? ""); + const installedVersion = String(await game.world.getFlag("sla-industries-brp", installFlagKey) ?? ""); + if (installedVersion !== currentVersion) { + const result = await game.brp.SLASeedImporter.runFullSLAInstaller({ + overwrite: false, + pruneCompendia: false, + notify: false + }); + if (result?.ok !== false) { + await game.world.setFlag("sla-industries-brp", installFlagKey, currentVersion); + ui.notifications.info(`SLA content bootstrap complete (${currentVersion}).`); + } else { + console.warn("sla-industries-brp | SLA content bootstrap skipped/failed", result); + } + } + } catch (err) { + console.warn("sla-industries-brp | Failed SLA automatic full install bootstrap", err); + } + } if (game.user?.isGM && game.brp?.SLABPNToolkit?.ensureRulebookJournal) { try { await game.brp.SLABPNToolkit.ensureRulebookJournal({ notify: false, syncPages: true }); diff --git a/sla-industries-brp/system.json b/sla-industries-brp/system.json index 04d2bb2..435c19c 100644 --- a/sla-industries-brp/system.json +++ b/sla-industries-brp/system.json @@ -2,7 +2,7 @@ "id": "sla-industries-brp", "title": "SLA Industries BRP (Draft)", "description": "Draft SLA Industries conversion of the BRP system for FoundryVTT.", - "version": "13.1.55", + "version": "13.1.56", "compatibility": { "minimum": "13", "verified": "13.350",