FIx pour Babele 2.8.X
Validation JSON / validate (push) Successful in 17s
Release Creation / build (release) Successful in 58s

This commit is contained in:
2026-04-27 23:58:55 +02:00
parent df1e0b9952
commit 0d20d76db0
53 changed files with 9322 additions and 9028 deletions
+18 -1
View File
@@ -20,7 +20,15 @@ export function initTravelV2() {
// Enregistrer la commande dans le système WFRP4e si disponible
if (game.wfrp4e?.commands) {
console.log("TravelV2: Enregistrement de la commande /voyage");
// Patch warhammer-lib 3.0.2 bug: parseArgs crashes when no args provided
// (already applied by inn-init if it ran first, but safe to apply again)
if (game.wfrp4e.commands.parseArgs && !game.wfrp4e.commands._parseArgsPatched) {
const _origParseArgs = game.wfrp4e.commands.parseArgs.bind(game.wfrp4e.commands);
game.wfrp4e.commands.parseArgs = function(command, text) {
return _origParseArgs(command, text ?? "");
};
game.wfrp4e.commands._parseArgsPatched = true;
}
game.wfrp4e.commands.add({
voyage: {
description: "Outil de calcul de distances de voyage (FR)",
@@ -61,6 +69,15 @@ export function initTravelV2() {
const target = event.currentTarget;
TravelDistanceV2.handleTravelClick(event, target);
});
// Bouton "Enregistrer dans le journal"
html.find('button[data-action="saveVoyageToJournal"]').click(async (event) => {
event.preventDefault();
const btn = event.currentTarget;
const from = btn.dataset.from;
const to = btn.dataset.to;
await TravelDistanceV2.saveVoyageToJournal(from, to, message.content);
});
});
console.log("TravelV2: Module de voyage initialisé");