fix(foundry): poprawki zgodności v13/v14 + skrypt NeDB→LevelDB

Poprawki punktowe (niskiego ryzyka, z fallbackiem na v11/v12):
- greyknights/auto-loadout: pochodzenie z paczki przez _stats.compendiumSource
  (flags.core.sourceId deprecated od v12)
- greyknights/gk-glow-toggle: canvas.perception.update -> płaska flaga
  refreshLighting (stary format {lighting:{refresh}} nie działa od v11)
- greyknights/helpers: TextEditor -> foundry.applications.ux.TextEditor;
  game.ui -> ui (martwy no-op)
- greyknights/ui-gkpanel: scene control tool v13 onClick -> onChange
- voidships-builder/voidships: loadTemplates -> foundry.applications.handlebars
- voidships-builder/voidship-actor: Actors -> foundry.documents.collections.Actors
- usunięto śmieciowe packs/*.db.bak

Skrypt help_scripts/pack_nedb_to_leveldb.mjs: przepakowuje kompendia NeDB(.db)
-> LevelDB (wymagane w v11+/v13/v14), czyta paczki z module.json, domyślnie
dry-run. Wykrywa też rozbieżność: gk-greyknights i wg-voidships-journal mają
w manifeście ścieżkę bez .db, a na dysku plik NeDB.

Nie ruszano vendored investigation-board (do aktualizacji z upstreamu).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit was merged in pull request #2.
This commit is contained in:
2026-07-29 19:31:37 +02:00
parent 5715da67de
commit a67c18d691
9 changed files with 165 additions and 42 deletions
+2 -1
View File
@@ -54,7 +54,8 @@ Hooks.once("ready", () => {
window._gkAutoLoadoutHookId = Hooks.on("createItem", async (item, opts, userId) => {
try {
if (item?.type !== "archetype") return;
const src = item?.flags?.core?.sourceId || "";
// v12+: pochodzenie z paczki przeniesione do _stats.compendiumSource (flags.core.sourceId deprecated)
const src = item?._stats?.compendiumSource || item?.flags?.core?.sourceId || "";
const isFromOurPack = src.startsWith(PACK_SRC_PREFIX);
const isOurGKByName = item?.name === "Grey Knight (Archetype)";
if (!isFromOurPack && !isOurGKByName) return;
+2 -2
View File
@@ -21,13 +21,13 @@
luminosity:0.5, attenuation:0.35, saturation:0, contrast:0, shadows:0,
animation:{ type:"pulse", speed:3, intensity:4, reverse:false } }
});
await canvas.perception.update({ lighting: { refresh: true } });
await canvas.perception.update({ refreshLighting: true });
};
const setGlowOff = async () => {
const prev = token.document.getFlag(FLAG_SCOPE, FLAG_KEY);
if (prev) { await token.document.update({ light: prev }); await token.document.unsetFlag(FLAG_SCOPE, FLAG_KEY); }
else { await token.document.update({ light: { dim:0, bright:0, color:null } }); }
await canvas.perception.update({ lighting: { refresh: true } });
await canvas.perception.update({ refreshLighting: true });
};
if (wasDisabled) { await setGlowOn(); ChatMessage.create({ content: `<b>Aegis:</b> Warding Runes <span style="color:#66ccff">ENGAGED</span>. (Akcja)` }); }
else { await setGlowOff(); ChatMessage.create({ content: `<b>Aegis:</b> Warding Runes DISENGAGED.` }); }
+5 -2
View File
@@ -52,7 +52,9 @@ async function gkResolveActorFromMessage(doc) {
}
async function gkIsPsychicMessage(doc) {
try {
const raw = `${doc.flavor || ""} ${TextEditor?.stripHTML(doc.content || "") || ""}`.toLowerCase();
// v13: TextEditor przeniesiony do foundry.applications.ux (global deprecated) — z fallbackiem na v11/v12
const _TE = foundry.applications?.ux?.TextEditor?.implementation ?? globalThis.TextEditor;
const raw = `${doc.flavor || ""} ${_TE?.stripHTML?.(doc.content || "") || ""}`.toLowerCase();
const keys = ["psychic","psychic mastery","psychic power","moc psioniczna","smite","hammerhand","sanctuary","shrouding","might of titan"];
if (keys.some(k=>raw.includes(k))) return true;
const flagsStr = JSON.stringify(doc.flags || {}).toLowerCase();
@@ -105,7 +107,8 @@ Hooks.once("ready", () => {
const ok = await ensureHasItemByName(actor, "Smite", "psychicPower");
if (!ok) {
ui.notifications?.warn("Smite not found in available packs. Please add a Librarius power manually.");
game.ui?.sidebar?.tabs?.compendium?.activate();
// globalny obiekt to `ui`, nie `game.ui`; activateTab działa w v12/v13
ui.sidebar?.activateTab?.("compendium");
}
}
} catch (e) { console.error("gk-greyknight — Brotherhood prompt:", e); }
+1 -1
View File
@@ -188,7 +188,7 @@ Hooks.on("getSceneControlButtons", (controls) => {
button: true,
visible: true,
order: 999,
onClick: () => GKFocusPanel.toggle()
onChange: () => GKFocusPanel.toggle()
};
}
});