Merge branch 'v1.5-fix-macros' into 'v1.5'
Fix ajout de macros en v9 See merge request LeRatierBretonnien/foundryvtt-reve-de-dragon!311
This commit is contained in:
commit
eb54f3a467
@ -17,7 +17,7 @@ export class RdDHotbar {
|
|||||||
return
|
return
|
||||||
let item = documentData.data
|
let item = documentData.data
|
||||||
let command = `game.system.rdd.RdDHotbar.rollMacro("${item.name}", "${item.type}");`;
|
let command = `game.system.rdd.RdDHotbar.rollMacro("${item.name}", "${item.type}");`;
|
||||||
let macro = game.macros.entities.find(m => (m.name === item.name) && (m.command === command));
|
let macro = game.macros.contents.find(m => (m.name === item.name) && (m.command === command));
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
macro = await Macro.create({
|
macro = await Macro.create({
|
||||||
name: item.name,
|
name: item.name,
|
||||||
@ -32,7 +32,7 @@ export class RdDHotbar {
|
|||||||
else if (documentData.type == "Actor") {
|
else if (documentData.type == "Actor") {
|
||||||
let actor = game.actors.get(documentData.id);
|
let actor = game.actors.get(documentData.id);
|
||||||
let command = `game.actors.get("${documentData.id}").sheet.render(true)`
|
let command = `game.actors.get("${documentData.id}").sheet.render(true)`
|
||||||
let macro = game.macros.entities.find(m => (m.name === actor.name) && (m.command === command));
|
let macro = game.macros.contents.find(m => (m.name === actor.name) && (m.command === command));
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
macro = await Macro.create({
|
macro = await Macro.create({
|
||||||
name: actor.data.name,
|
name: actor.data.name,
|
||||||
@ -47,7 +47,7 @@ export class RdDHotbar {
|
|||||||
else if (documentData.type == "JournalEntry") {
|
else if (documentData.type == "JournalEntry") {
|
||||||
let journal = game.journal.get(documentData.id);
|
let journal = game.journal.get(documentData.id);
|
||||||
let command = `game.journal.get("${documentData.id}").sheet.render(true)`
|
let command = `game.journal.get("${documentData.id}").sheet.render(true)`
|
||||||
let macro = game.macros.entities.find(m => (m.name === journal.name) && (m.command === command));
|
let macro = game.macros.contents.find(m => (m.name === journal.name) && (m.command === command));
|
||||||
if (!macro) {
|
if (!macro) {
|
||||||
macro = await Macro.create({
|
macro = await Macro.create({
|
||||||
name: journal.data.name,
|
name: journal.data.name,
|
||||||
|
Loading…
Reference in New Issue
Block a user