lee1121
lee1121
Blind chat message is public instead since v11
I've updated to v11 today from v10.303 and now my blind chat messages aren't working anymore and I cannot figure out why. Extra confusingly, just adding the "blind: true", causes the message to become a public message, rather than the private gm message it's based on. chatMessage = ChatMessage.create({ speaker: speaker, content: html, whisper: game.users.filter(u => u.isGM), blind: true }); Do any of you happen to have any pointers? Thanks in advance 🙂 Edit: I failed to mention that I have looked at the v11 breaking changes and didn't see anything that should have affected this
5 replies
Default item macro is overriding my custom item macro
I'm trying to create and assign an item macro to the hotbar. It's mostly working, but has one unexpected behaviour that I cannot figure out. Whenever I drag an item to the hotbar, it creates the macro successfully in the Macros Directory, however a "Display [item name]" macro is also created and that's assigned to the hotbar instead. I'm fairly sure this is the default Foundry item macro and it's overriding my hotbar assignment, as it's stil created and assigned when I comment out my createItemMacro function. Is there any way to disable the "Display [item name]" macro from being created for my items? Thanks in advance 🙂 My createItemMacro function, for reference:
async function createAvariceItemMacro(data, slot) {
// First, determine if this is a valid owned item.
if (data.type !== "Item") return;
if (!data.uuid.includes('Actor.') && !data.uuid.includes('Token.')) {
return ui.notifications.warn("You can only create macro buttons for owned Items");
}
// If it is, retrieve it based on the uuid.
const item = await Item.fromDropData(data);

// Create the macro command using the uuid.
const command = `game.cryptsofavarice.rollItemMacro("${item.name}");`;
let macro = game.macros.find(m => (m.name === item.name) && (m.command === command));
if (!macro) {
macro = await Macro.create({
name: item.name,
type: "script",
img: item.img,
command: command,
flags: { "cryptsofavarice.itemMacro": true }
});
}
game.user.assignHotbarMacro(macro, slot);
return false;
}
async function createAvariceItemMacro(data, slot) {
// First, determine if this is a valid owned item.
if (data.type !== "Item") return;
if (!data.uuid.includes('Actor.') && !data.uuid.includes('Token.')) {
return ui.notifications.warn("You can only create macro buttons for owned Items");
}
// If it is, retrieve it based on the uuid.
const item = await Item.fromDropData(data);

// Create the macro command using the uuid.
const command = `game.cryptsofavarice.rollItemMacro("${item.name}");`;
let macro = game.macros.find(m => (m.name === item.name) && (m.command === command));
if (!macro) {
macro = await Macro.create({
name: item.name,
type: "script",
img: item.img,
command: command,
flags: { "cryptsofavarice.itemMacro": true }
});
}
game.user.assignHotbarMacro(macro, slot);
return false;
}
6 replies