Skip to content

Commit

Permalink
Merge pull request #1788 from StarWarsFoundryVTT/macro_1786
Browse files Browse the repository at this point in the history
Macro 1786
  • Loading branch information
wrycu authored Feb 6, 2025
2 parents 8e778fc + c90401e commit 2fda474
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Remove usage of deprecated `math.clamped` in favor of `math.clamp`
* Fix skill roll sometimes showing a pool of only 2 difficulty when clicked ([#1763](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1763))
* XP Spending now uses a generic symbol instead of a dollar sign ([#1732](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1732))
* Fix for skill-roll macros not being created on drag-and-drop into macro hotbar ([#1786](/~https://github.com/StarWarsFoundryVTT/StarWarsFFG/issues/1786))

`1.905`
* Fixes
Expand Down
8 changes: 4 additions & 4 deletions modules/helpers/macros.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ export async function createFFGMacro(bar, data, slot) {
img: item.img,
command: command,
});
} else if (data.data.type === "skill") {
}
} else if (data.data.type === "skill") {
const actor = game.actors.get(data.actorId);
const command = `
// game.ffg.DiceHelpers.rollSkillDirect(skill, characteristic, difficulty, actorSheet, flavortext, sound);
const ffgactor = game.actors.get("${data.actorId}");
const skill = ffgactor.data.data.skills["${data.data.skill}"];
const characteristic = ffgactor.data.data.characteristics["${data.data.characteristic}"];
const skill = ffgactor.system.skills["${data.data.skill}"];
const characteristic = ffgactor.system.characteristics["${data.data.characteristic}"];
const actorSheet = ffgactor.sheet.getData();
game.ffg.DiceHelpers.rollSkillDirect(skill, characteristic, 2, actorSheet);`;
macro = await createMacroItem({
Expand All @@ -78,7 +79,6 @@ export async function createFFGMacro(bar, data, slot) {
command: command,
});
}
}
if (macro) {
game.user.assignHotbarMacro(macro, slot);
}
Expand Down

0 comments on commit 2fda474

Please sign in to comment.