Skip to content

Commit

Permalink
Merge pull request #538 from MangoFVTT/develop
Browse files Browse the repository at this point in the history
release/3.4.1
  • Loading branch information
MangoFVTT authored Nov 19, 2024
2 parents 138c5f2 + ddd3070 commit 0522615
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/utils/activity.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ export class ActivityUtility {
const activity = message.getAssociatedActivity();
const actor = message.getAssociatedActor();

activity.item.flags.dnd5e ??= {};
activity.item.flags.dnd5e.scaling = message.flags.dnd5e.scaling ?? 0;

const usageConfig = {
Expand Down
7 changes: 5 additions & 2 deletions src/utils/hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const HOOKS_DND5E = {
PRE_ROLL_ATTACK: "dnd5e.preRollAttackV2",
PRE_ROLL_DAMAGE: "dnd5e.preRollDamageV2",
PRE_USE_ACTIVITY: "dnd5e.preUseActivity",
PRE_CREATE_USAGE_MESSAGE: "dnd5e.preCreateUsageMessage",
POST_USE_ACTIVITY: "dnd5e.postUseActivity",
ACTIVITY_CONSUMPTION: "dnd5e.activityConsumption",
DISPLAY_CARD: "dnd5e.displayCard",
RENDER_CHAT_MESSAGE: "dnd5e.renderChatMessage",
Expand Down Expand Up @@ -98,12 +98,15 @@ export class HooksUtility {

if (SettingsUtility.getSettingValue(SETTING_NAMES.QUICK_ACTIVITY_ENABLED)) {
Hooks.on(HOOKS_DND5E.PRE_USE_ACTIVITY, (activity, usageConfig, dialogConfig, messageConfig) => {
activity._triggerSubsequentActions = function() {};
RollUtility.processActivity(usageConfig, dialogConfig, messageConfig);
ActivityUtility.setRenderFlags(activity, messageConfig);
return true;
});

Hooks.on(HOOKS_DND5E.POST_USE_ACTIVITY, (activity, usageConfig, results) => {
return false;
});

Hooks.on(HOOKS_DND5E.PRE_ROLL_ATTACK, (config, dialog, message) => {
if (!message.data?.flags || !message.data.flags[MODULE_SHORT]?.quickRoll) return true;

Expand Down

0 comments on commit 0522615

Please sign in to comment.