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
+17 -1
View File
@@ -18,7 +18,15 @@ export function initInn() {
// Enregistrer la commande dans le système WFRP4e si disponible
if (game.wfrp4e?.commands) {
console.log("Inn: Enregistrement de la commande /auberge");
// Patch warhammer-lib 3.0.2 bug: parseArgs crashes when no args provided
// (match.groups.args is undefined when user types command without arguments)
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({
auberge: {
description: "Jets sur les tables d'auberge (FR)",
@@ -89,5 +97,13 @@ export function initInn() {
ui.notifications.warn("Seul le MJ peut utiliser les tables d'auberge.");
}
});
// Bouton "Enregistrer dans le journal Menus"
html.find('button[data-action="saveMenuToJournal"]').click(async (event) => {
event.preventDefault();
const btn = event.currentTarget;
const menuName = btn.dataset.menuName;
await InnRoller.saveMenuToJournal(menuName, message.content);
});
});
}