Skip to content

Commit

Permalink
1.5.0
Browse files Browse the repository at this point in the history
Added setting to change the icon of a spell scroll created by dragging a spell to a scroll icon. This varies by spell level.
  • Loading branch information
jopeek committed Apr 23, 2020
1 parent 1497f21 commit 02bd9a9
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 1 deletion.
Binary file added icons/Scroll0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added icons/Scroll9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions lootsheetnpc5e.js
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,7 @@ class LootSheet5eNPC extends ActorSheet5eNPC {

// get the name of the primary actor for a player
const actor = game.actors.get(u.data.character);
//console.log("Loot Sheet | Checking actor", actor);

if (actor) {

Expand Down Expand Up @@ -512,6 +513,12 @@ Hooks.on('preCreateOwnedItem', (actor, item, data) => {
if (item.type === "spell") {
//console.log("Loot Sheet | dragged spell item", item);

let changeScrollIcon = game.settings.get("lootsheetnpc5e", "changeScrollIcon");

if (changeScrollIcon) item.img = "modules/lootsheetnpc5e/icons/Scroll" + item.data.level + ".png";

//console.log("Loot Sheet | check changeScrollIcon", changeScrollIcon);

item.name = "Scroll of " + item.name;
item.type = "consumable";
item.data.price = Math.round(10 * Math.pow(2.6, item.data.level));
Expand Down Expand Up @@ -540,4 +547,20 @@ Hooks.on('preCreateOwnedItem', (actor, item, data) => {
}
} else return;

});

Hooks.once("init", () => {

/**
* Register better rolls setting
*/
game.settings.register("lootsheetnpc5e", "changeScrollIcon", {
name: "Change icon for Spell Scrolls?",
hint: "Changes the icon for spell scrolls to a scroll icon. If left unchecked, retains the spell's icon.",
scope: "world",
config: true,
default: true,
type: Boolean
});

});
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "lootsheetnpc5e",
"title": "Loot Sheet NPC 5e",
"description": "This module adds an additional NPC sheet which can be used for loot containers such as chests or shopkeepers.",
"version": "1.4.1",
"version": "1.5.0",
"minimumCoreVersion": "0.5.5",
"compatibleCoreVersion": "0.5.5",
"author": "Jan Ole Peek (ChalkOne)",
Expand Down

0 comments on commit 02bd9a9

Please sign in to comment.