fix: auto-bootstrap SLA full install on world load and bump system version

This commit is contained in:
2026-03-04 21:41:32 +00:00
parent 74fea240ba
commit 1650924bb7
3 changed files with 25 additions and 2 deletions
+1 -1
View File
@@ -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"
+23
View File
@@ -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 });
+1 -1
View File
@@ -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",