Due to the roll refactor rollRecharge ignores changing message.create to false preRollRechargeV2.
In the code createMessage (which determines display the chat card or not) is recorded before calling BasicRoll.build, but after the preRollRecharge hook fires, so that changes made in preRollRechargeV2 are ignored, but changes made in preRollRecharge are honored.
I could not see any simple way to resolve the issue but wanted to understand if this is a wont fix and will work around it.,
if ( "dnd5e.preRollRecharge" in Hooks.events ) {
foundry.utils.logCompatibilityWarning(
"The `dnd5e.preRollRecharge` hook has been deprecated and replaced with `dnd5e.preRollRechargeV2`.",
{ since: "DnD5e 4.0", until: "DnD5e 4.4" }
);
const hookData = {
formula: rollConfig.rolls[0].parts[0], data: rollConfig.rolls[0].data,
target: rollConfig.rolls[0].options.target, chatMessage: messageConfig.create
};
if ( Hooks.call("dnd5e.preRollRecharge", this, hookData) === false ) return;
rollConfig.rolls[0].parts[0] = hookData.formula;
rollConfig.rolls[0].data = hookData.data;
rollConfig.rolls[0].options.target = hookData.target;
messageConfig.create = hookData.chatMessage;
}
const createMessage = messageConfig.create !== false;
messageConfig.create = false;
const rolls = await CONFIG.Dice.BasicRoll.build(rollConfig, dialogConfig, messageConfig);
```js
Due to the roll refactor rollRecharge ignores changing message.create to false preRollRechargeV2. In the code createMessage (which determines display the chat card or not) is recorded before calling BasicRoll.build, but after the preRollRecharge hook fires, so that changes made in preRollRechargeV2 are ignored, but changes made in preRollRecharge are honored.
I could not see any simple way to resolve the issue but wanted to understand if this is a wont fix and will work around it.,