forked from public/foundryvtt-wh4-lang-fr-fr
FIx pour Babele 2.8.X
This commit is contained in:
+17
-1
@@ -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);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user