Skip to content

Commit

Permalink
Small fix
Browse files Browse the repository at this point in the history
  • Loading branch information
emdant committed Feb 4, 2023
1 parent d2d6f46 commit 3d41937
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
11 changes: 5 additions & 6 deletions easy-artwork.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@ function addButton(sheet, buttons) {
icon: 'far fa-images',
label: 'Show Artwork',
onclick: (e) => {
const [type, id] = sheet.id.split('-');
const entity = game[`${type}s`].get(id);
const doc = sheet.document;

game.socket.emit('shareImage', {
image: entity.data.img,
title: "",
uuid: entity.uuid
image: doc.img,
title: doc.name,
uuid: doc.uuid
});
}
});
}

Hooks.on('getActorSheetHeaderButtons', addButton);
Hooks.on('getItemSheetHeaderButtons', addButton);
Hooks.on('getItemSheetHeaderButtons', addButton);
28 changes: 17 additions & 11 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{
"name": "easy-artwork",
"id": "easy-artwork",
"title": "Easy Artwork",
"description": "Adds a button to show an artwork on the entity title bar",
"authors": [{"name":"emdant"}],
"version": "1.0.0",
"minimumCoreVersion": "0.8.5",
"compatibleCoreVersion":"0.8.9",
"description": "Adds a button to show the artwork of any Item or Actor on the entity's title bar",
"authors": [
{
"name": "emdant"
}
],
"url": "https://github.com/emdant/easy-artwork",
"changelog": "https://github.com/emdant/easy-artwork/commits/master",
"version": "1.0.1",
"scripts": [
"easy-artwork.js"
"easy-artwork.js"
],
"socket": true,
"changelog": "https://github.com/emdant/easy-artwork/commits/master",
"url":"https://github.com/emdant/easy-artwork",
"manifest":" https://github.com/emdant/easy-artwork/releases/latest/download/module.json",
"download":" https://github.com/emdant/easy-artwork/releases/latest/download/module.zip"
"download": "https://github.com/emdant/easy-artwork/releases/download/v1.0.0/module.zip",
"manifest": "https://github.com/emdant/easy-artwork/releases/latest/download/module.json",
"compatibility": {
"minimum": "10",
"verified": "10"
}
}

0 comments on commit 3d41937

Please sign in to comment.