Update for Foundry v13

This commit is contained in:
2025-05-09 21:54:10 +02:00
parent c2f9934f5f
commit e1cea78059
122 changed files with 303 additions and 390 deletions

View File

@@ -31,7 +31,7 @@ Hooks.once('init', async function () {
config: BOL
};
// Game socket
// Game socket
game.socket.on("system.bol", sockmsg => {
BoLUtility.onSocketMessage(sockmsg);
})
@@ -51,13 +51,13 @@ Hooks.once('init', async function () {
CONFIG.Combat.documentClass = BoLCombatManager;
// Register sheet application classes
Actors.unregisterSheet("core", ActorSheet);
Actors.registerSheet("bol", BoLActorSheet, { types: ["character", "encounter"], makeDefault: true })
Actors.registerSheet("bol", BoLVehicleSheet, { types: ["vehicle"], makeDefault: true })
Actors.registerSheet("bol", BoLHordeSheet, { types: ["horde"], makeDefault: true })
foundry.documents.collections.Actors.unregisterSheet("core", foundry.appv1.sheets.ActorSheet);
foundry.documents.collections.Actors.registerSheet("bol", BoLActorSheet, { types: ["character", "encounter"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("bol", BoLVehicleSheet, { types: ["vehicle"], makeDefault: true })
foundry.documents.collections.Actors.registerSheet("bol", BoLHordeSheet, { types: ["horde"], makeDefault: true })
Items.unregisterSheet("core", ItemSheet);
Items.registerSheet("bol", BoLItemSheet, { makeDefault: true });
foundry.documents.collections.Items.unregisterSheet("core", foundry.appv1.sheets.ItemSheet);
foundry.documents.collections.Items.registerSheet("bol", BoLItemSheet, { makeDefault: true });
// Inot useful stuff
BoLUtility.init()
@@ -78,7 +78,7 @@ Hooks.once('init', async function () {
Babele.get().setSystemTranslationsDir("compendiums");
}
});
@@ -91,7 +91,7 @@ function welcomeMessage() {
game.i18n.localize("BOL.chat.welcome4") + "</p><p>" +
game.i18n.localize("BOL.chat.welcome5") + "</p>" +
game.i18n.localize("BOL.chat.welcome6")
let rulebook = game.modules.find( m => m.id === "bol-rulebook")
if ( !rulebook ) {
content += "<p>" + game.i18n.localize("BOL.chat.bolRulebookMessage") + "</p>"
@@ -101,7 +101,7 @@ function welcomeMessage() {
whisper: [game.user.id],
content: content
})
if (game.user.isGM && game.i18n.lang == 'en' && !game.modules.find(m => m.id == "babele") ){
ChatMessage.create({
user: game.user.id,
@@ -109,7 +109,7 @@ function welcomeMessage() {
content: `<div id="welcome-message-bol"><span class="rdd-roll-part">
<strong>WARNING ! English language selected, but Babele module is not installed !<br>Please install babele from the module tab in Foundry interface.`
} )
ui.notifications.warn("WARNING ! English language selected, but babele module is not installed !<br>Please install babele from the module tab in Foundry interface.")
ui.notifications.warn("WARNING ! English language selected, but babele module is not installed !<br>Please install babele from the module tab in Foundry interface.")
}
}
@@ -166,13 +166,11 @@ Hooks.once('ready', async function () {
"d6B": "d6H (Bonus)",
"d6BB": "d6H + Bonus die",
}
if (game.i18n.lang === "fr") {
game.bol.config.damageValues = damageFR;
} else {
game.bol.config.damageValues = damageEN;
}
})