Add the ability to display / edit the description from the item sheet
This commit is contained in:
parent
46a235b603
commit
69db3ca719
13 changed files with 168 additions and 17 deletions
|
|
@ -1,3 +1,5 @@
|
|||
const { getType } = foundry.utils;
|
||||
|
||||
// MARK: filePath
|
||||
export function filePath(path) {
|
||||
if (path.startsWith(`/`)) {
|
||||
|
|
@ -6,6 +8,24 @@ export function filePath(path) {
|
|||
return `systems/ripcrypt/${path}`;
|
||||
};
|
||||
|
||||
// MARK: toBoolean
|
||||
/**
|
||||
* Converts a value into a boolean based on the type of the value provided
|
||||
*
|
||||
* @param {any} val The value to convert
|
||||
*/
|
||||
export function toBoolean(val) {
|
||||
switch (getType(val)) {
|
||||
case `string`: {
|
||||
return val === `true`;
|
||||
};
|
||||
case `number`: {
|
||||
return val === 1;
|
||||
};
|
||||
};
|
||||
return Boolean(val);
|
||||
};
|
||||
|
||||
// MARK: documentSorter
|
||||
/**
|
||||
* @typedef {Object} Sortable
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue