diff --git a/LICENSE b/LICENSE index d2e5beaf..5350ff0e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020 Repository Owner +Copyright (c) 2020 Fantasy Computerworks Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Credits: +- Manuel Vögele for his "isResponsibleGM" function implementation and wonderful SocketLib module \ No newline at end of file diff --git a/changelog.md b/changelog.md index 6950a2ab..e49fd1d9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,13 @@ # Item Piles Changelog +## Version 1.2.6 +- Added `Item Filters` setting - now you can more accurately filter items you do not want to show up in item piles, such as natural weapons +- Updated all supported systems to support the above and added migrations to convert existing settings to the new system - reset your Item Piles module settings to ensure you have the latest system configurations +- Removed `Item Type Attribute` and `Item Type Filters` as the above feature covers these cases +- Added debounce to the token image refresh so that it doesn't try to change its image too often +- Further fixes to `ItemPiles.API.addItems` +- Fixed unlinked item piles not retaining their setup when created from the actors directory + ## Version 1.2.5 - Added missing handlebars method for Foundry v0.8.9 @@ -90,8 +98,8 @@ ## Version 1.0.6 - Added API endpoints: - - `ItemPiles.API.getDocumentItemTypeFilters(TokenDocument|Actor)` - Returns the item type filters for a given item pile - - `ItemPiles.API.getDocumentItems(TokenDocument|Actor, Array|Boolean)` - Returns the items the item pile contains and can transfer + - `ItemPiles.API.getDocumentItemFilters(TokenDocument|Actor)` - Returns the item type filters for a given item pile + - `ItemPiles.API.getValidDocumentItems(TokenDocument|Actor, Array|Boolean)` - Returns the items the item pile contains and can transfer - Updated japanese localization - Fixed item piles not respecting item type filters - Fixed issue with `ItemPiles.API.turnTokenIntoItemPile` not actually turning the token into an item pile diff --git a/docs/api.md b/docs/api.md index 550e50a4..21f25783 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,21 +1,3 @@ -## How to use this API - -In your scripts, you can write `ItemPiles.API.` and then any of the entries below. - -### Example: Turning selected tokens into item piles -```js -const selectedTokens = canvas.tokens.controlled; -if(selectedTokens.length === 0) return; -ItemPiles.API.turnTokensIntoItemPiles(selectedTokens); -``` - -### Example: Reverting selected tokens from item piles back to normal tokens -```js -const selectedTokens = canvas.tokens.controlled; -if(selectedTokens.length === 0) return; -ItemPiles.API.revertTokensFromItemPiles(selectedTokens); -``` - ## Members
string
The attribute used to track the quantity of items in this system
string
The attribute used to track the item type in this system
-Array
Array
The filters for item types eligible for interaction within this system
Promise
Sets the actor class type used for the original item pile actor in this system
@@ -48,40 +28,42 @@ ItemPiles.API.revertTokensFromItemPiles(selectedTokens);Promise
Sets the inAttribute used to track the quantity of items in this system
string
Sets the attribute used to track the item type in this system
-Promise
Sets the filters for item types eligible for interaction within this system
+Promise
Sets the items filters for interaction within this system
Promise
Creates the default item pile token at a location.
Promise.<Array>
Promise.<Array>
Turns tokens and its actors into item piles
Promise.<Array>
Promise.<Array>
Reverts tokens from an item pile into a normal token and actor
Promise
Promise
Opens a pile if it is enabled and a container
Promise
Promise
Closes a pile if it is enabled and a container
Promise
Promise
Toggles a pile's closed state if it is enabled and a container
Promise
Promise
Locks a pile if it is enabled and a container
Promise
Promise
Unlocks a pile if it is enabled and a container
Promise
Promise
Toggles a pile's locked state if it is enabled and a container
Promise.<boolean>
Promise.<boolean>
Causes the item pile to play a sound as it was attempted to be opened, but was locked
boolean
Promise
Deletes a pile, calling the relevant hooks.
Promise
Promise
Remotely opens an item pile's inventory, if you have permission to edit the item pile. Passing a user ID, or a list of user IDs, will cause those users to open the item pile.
+boolean
Whether a given document is a valid pile or not
boolean
Whether the item pile is empty
Array
Returns the item type filters for a given item pile
-Array
Array
Returns the items this item pile can transfer
array
Promise
Causes all connected users to re-render a specific pile's inventory UI
Promise.<array>
Adds item to an actor, increasing item quantities if matches were found
Promise.<object>
Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0
Promise.<array>
Promise.<array>
Transfers all items between the source and the target.
Promise.<object>
Promise.<object>
Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target
Promise.<object>
Promise.<object>
Transfers all items and attributes between the source and the target.
Promise
Causes every user's token HUD to rerender
boolean/string
Checks whether an item (or item data) is of a type that is not allowed. If an array whether that type is allowed -or not, returning the type if it is NOT allowed.
-string
+### ACTOR\_CLASS\_TYPE ⇒ string
The actor class type used for the original item pile actor in this system
---
-## DYNAMIC\_ATTRIBUTES ⇒ array
+### DYNAMIC\_ATTRIBUTES ⇒ array
The attributes used to track dynamic attributes in this system
---
-## ITEM\_QUANTITY\_ATTRIBUTE ⇒ string
+### ITEM\_QUANTITY\_ATTRIBUTE ⇒ string
The attribute used to track the quantity of items in this system
-
-
----
-
-## ITEM\_TYPE\_ATTRIBUTE ⇒ string
-The attribute used to track the item type in this system
-
-
+
---
-## ITEM\_TYPE\_FILTERS ⇒ Array
+### ITEM\_FILTERS ⇒ Array
The filters for item types eligible for interaction within this system
---
-## setActorClassType(inClassType) ⇒ Promise
-Sets the actor class type used for the original item pile actor in this system
+### setActorClassType(inClassType) ⇒ Promise
+Sets the actor class type used for the original item pile actor in this system
| Param | Type |
| --- | --- |
@@ -208,8 +180,8 @@ Sets the actor class type used for the original item pile actor in this system
---
-## setDynamicAttributes(inAttributes) ⇒ Promise
-Sets the attributes used to track dynamic attributes in this system
+### setDynamicAttributes(inAttributes) ⇒ Promise
+Sets the attributes used to track dynamic attributes in this system
| Param | Type |
| --- | --- |
@@ -219,41 +191,30 @@ Sets the attributes used to track dynamic attributes in this system
---
-## setItemQuantityAttribute(inAttribute) ⇒ Promise
-Sets the inAttribute used to track the quantity of items in this system
-
-| Param | Type |
-| --- | --- |
-| inAttribute | string
|
-
-
-
----
-
-## setItemTypeAttribute(inAttribute) ⇒ string
-Sets the attribute used to track the item type in this system
+### setItemQuantityAttribute(inAttribute) ⇒ Promise
+Sets the inAttribute used to track the quantity of items in this system
| Param | Type |
| --- | --- |
| inAttribute | string
|
-
+
---
-## setItemTypeFilters(inFilters) ⇒ Promise
-Sets the filters for item types eligible for interaction within this system
+### setItemFilters(inFilters) ⇒ Promise
+Sets the items filters for interaction within this system
| Param | Type |
| --- | --- |
-| inFilters | string/array
|
+| inFilters | array
|
---
-## createItemPile(position, { items, pileActorName }) ⇒ Promise
-Creates the default item pile token at a location.
+### createItemPile(position, { items, pileActorName }) ⇒ Promise
+Creates the default item pile token at a location.
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -265,8 +226,8 @@ Creates the default item pile token at a location.
---
-## turnTokensIntoItemPiles(targets, { pileSettings, tokenSettings }) ⇒ Promise.<Array>
-Turns tokens and its actors into item piles
+### turnTokensIntoItemPiles(targets, pileSettings, tokenSettings) ⇒ Promise.<Array>
+Turns tokens and its actors into item piles
**Returns**: Promise.<Array>
- The uuids of the targets after they were turned into item piles
| Param | Type | Description |
@@ -279,8 +240,8 @@ Turns tokens and its actors into item piles
---
-## revertTokensFromItemPiles(targets, { tokenSettings }) ⇒ Promise.<Array>
-Reverts tokens from an item pile into a normal token and actor
+### revertTokensFromItemPiles(targets, tokenSettings) ⇒ Promise.<Array>
+Reverts tokens from an item pile into a normal token and actor
**Returns**: Promise.<Array>
- The uuids of the targets after they were reverted from being item piles
| Param | Type | Description |
@@ -292,8 +253,8 @@ Reverts tokens from an item pile into a normal token and actor
---
-## openItemPile(target, interactingToken) ⇒ Promise
-Opens a pile if it is enabled and a container
+### openItemPile(target, [interactingToken]) ⇒ Promise
+Opens a pile if it is enabled and a container
| Param | Type | Default |
| --- | --- | --- |
@@ -304,8 +265,8 @@ Opens a pile if it is enabled and a container
---
-## closeItemPile(target, interactingToken) ⇒ Promise
-Closes a pile if it is enabled and a container
+### closeItemPile(target, [interactingToken]) ⇒ Promise
+Closes a pile if it is enabled and a container
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -316,8 +277,8 @@ Closes a pile if it is enabled and a container
---
-## toggleItemPileClosed(target, interactingToken) ⇒ Promise
-Toggles a pile's closed state if it is enabled and a container
+### toggleItemPileClosed(target, [interactingToken]) ⇒ Promise
+Toggles a pile's closed state if it is enabled and a container
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -328,8 +289,8 @@ Toggles a pile's closed state if it is enabled and a container
---
-## lockItemPile(target, interactingToken) ⇒ Promise
-Locks a pile if it is enabled and a container
+### lockItemPile(target, [interactingToken]) ⇒ Promise
+Locks a pile if it is enabled and a container
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -340,8 +301,8 @@ Locks a pile if it is enabled and a container
---
-## unlockItemPile(target, interactingToken) ⇒ Promise
-Unlocks a pile if it is enabled and a container
+### unlockItemPile(target, [interactingToken]) ⇒ Promise
+Unlocks a pile if it is enabled and a container
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -352,8 +313,8 @@ Unlocks a pile if it is enabled and a container
---
-## toggleItemPileLocked(target, interactingToken) ⇒ Promise
-Toggles a pile's locked state if it is enabled and a container
+### toggleItemPileLocked(target, [interactingToken]) ⇒ Promise
+Toggles a pile's locked state if it is enabled and a container
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -364,8 +325,8 @@ Toggles a pile's locked state if it is enabled and a container
---
-## rattleItemPile(target, interactingToken) ⇒ Promise.<boolean>
-Causes the item pile to play a sound as it was attempted to be opened, but was locked
+### rattleItemPile(target, [interactingToken]) ⇒ Promise.<boolean>
+Causes the item pile to play a sound as it was attempted to be opened, but was locked
| Param | Type | Default |
| --- | --- | --- |
@@ -376,8 +337,8 @@ Causes the item pile to play a sound as it was attempted to be opened, but was l
---
-## isItemPileLocked(target) ⇒ boolean
-Whether an item pile is locked. If it is not enabled or not a container, it is always false.
+### isItemPileLocked(target) ⇒ boolean
+Whether an item pile is locked. If it is not enabled or not a container, it is always false.
| Param | Type |
| --- | --- |
@@ -387,8 +348,8 @@ Whether an item pile is locked. If it is not enabled or not a container, it is a
---
-## isItemPileClosed(target) ⇒ boolean
-Whether an item pile is closed. If it is not enabled or not a container, it is always false.
+### isItemPileClosed(target) ⇒ boolean
+Whether an item pile is closed. If it is not enabled or not a container, it is always false.
| Param | Type |
| --- | --- |
@@ -398,8 +359,8 @@ Whether an item pile is closed. If it is not enabled or not a container, it is a
---
-## isItemPileContainer(target) ⇒ boolean
-Whether an item pile is a container. If it is not enabled, it is always false.
+### isItemPileContainer(target) ⇒ boolean
+Whether an item pile is a container. If it is not enabled, it is always false.
| Param | Type |
| --- | --- |
@@ -409,8 +370,8 @@ Whether an item pile is a container. If it is not enabled, it is always false.
---
-## updateItemPile(target, newData, { interactingToken, tokenSettings }) ⇒ Promise
-Updates a pile with new data.
+### updateItemPile(target, newData, { interactingToken, tokenSettings }) ⇒ Promise
+Updates a pile with new data.
| Param | Type | Default |
| --- | --- | --- |
@@ -423,101 +384,89 @@ Updates a pile with new data.
---
-## deleteItemPile(target) ⇒ Promise
-Deletes a pile, calling the relevant hooks.
+### deleteItemPile(target) ⇒ Promise
+Deletes a pile, calling the relevant hooks.
| Param | Type |
| --- | --- |
| target | Token/TokenDocument
|
-
---
-## openItemPileInventory(target, userIds, { inspectingTarget, useDefaultCharacter }) ⇒ Promise
-Remotely opens an item pile's inventory, if you have permission to edit the item pile. Passing a user ID, or a list of user IDs, will cause those users to open the item pile.
+### openItemPileInventory(target, userIds, { inspectingTarget, useDefaultCharacter }) ⇒ Promise
+Remotely opens an item pile's inventory, if you have permission to edit the item pile. Passing a user ID, or a list of user IDs, will cause those users to open the item pile.
| Param | Type | Description |
| --- | --- | --- |
| target | Token/TokenDocument/Actor
| The item pile actor or token whose inventory to open |
-| userIds | array<string>
| The IDs of the users that should open this item pile inventory |
-| inspectingTarget | boolean/Token/TokenDocument/Actor
| This will force the users to inspect this item pile as a specific character |
-| useDefaultCharacter | boolean
| Causes the users to inspect the item pile inventory as their default character |
+| userIds | array.<string>
| The IDs of the users that should open this item pile inventory |
+| [inspectingTarget] | boolean/Token/TokenDocument/Actor
| This will force the users to inspect this item pile as a specific character |
+| [useDefaultCharacter] | boolean
| Causes the users to inspect the item pile inventory as their default character |
---
-## isValidItemPile(document) ⇒ boolean
-Whether a given document is a valid pile or not
+### isValidItemPile(document) ⇒ boolean
+Whether a given document is a valid pile or not
| Param | Type |
| --- | --- |
-| document | TokenDocument
\| Actor
|
+| document | Token/TokenDocument
\| Actor
|
---
-## isItemPileEmpty(target) ⇒ boolean
-Whether the item pile is empty
+### isItemPileEmpty(target) ⇒ boolean
+Whether the item pile is empty
| Param | Type |
| --- | --- |
-| target | TokenDocument
\| Actor
|
-
-
-
----
-
-## getItemPileItemTypeFilters(target) ⇒ Array
-Returns the item type filters for a given item pile
-
-| Param |
-| --- |
-| target |
+| target | Token/TokenDocument
\| Actor
|
---
-## getItemPileItems(target, [itemTypeFilters]) ⇒ Array
-Returns the items this item pile can transfer
+### getItemPileItems(target, [itemFilters]) ⇒ Array
+Returns the items this item pile can transfer
| Param | Type | Default | Description |
| --- | --- | --- | --- |
-| target | TokenDocument
\| Actor
| | |
-| [itemTypeFilters] | array/boolean
| false
| Array of item types disallowed - will default to pile settings or module settings if none provided |
+| target | Token/TokenDocument
\| Actor
| | |
+| [itemFilters] | array/boolean
| false
| Array of item types disallowed - will default to pile settings or module settings if none provided |
---
-## getItemPileAttributes(target) ⇒ array
-Returns the attributes this item pile can transfer
+### getItemPileAttributes(target) ⇒ array
+Returns the attributes this item pile can transfer
| Param | Type |
| --- | --- |
-| target | TokenDocument
\| Actor
|
+| target | Token/TokenDocument
\| Actor
|
---
-## refreshItemPile(target) ⇒ Promise
-Refreshes the target image of an item pile, ensuring it remains in sync
+### refreshItemPile(target) ⇒ Promise
+Refreshes the target image of an item pile, ensuring it remains in sync
-| Param |
-| --- |
-| target |
+| Param | Type |
+| --- | --- |
+| target | Token/TokenDocument
\| Actor
|
---
-## rerenderItemPileInventoryApplication(inPileUuid, [deleted]) ⇒ Promise
-Causes all connected users to re-render a specific pile's inventory UI
+### rerenderItemPileInventoryApplication(inPileUuid, [deleted]) ⇒ Promise
+Causes all connected users to re-render a specific pile's inventory UI
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -528,8 +477,8 @@ Causes all connected users to re-render a specific pile's inventory UI
---
-## addItems(target, items, { interactionId }) ⇒ Promise.<array>
-Adds item to an actor, increasing item quantities if matches were found
+### addItems(target, items, { interactionId }) ⇒ Promise.<array>
+Adds item to an actor, increasing item quantities if matches were found
**Returns**: Promise.<array>
- An array of objects, each containing the item that was added or updated, and the quantity that was added
| Param | Type | Default | Description |
@@ -542,8 +491,8 @@ Adds item to an actor, increasing item quantities if matches were found
---
-## removeItems(target, items, { interactionId }) ⇒ Promise.<array>
-Subtracts the quantity of items on an actor. If the quantity of an item reaches 0, the item is removed from the actor.
+### removeItems(target, items, { interactionId }) ⇒ Promise.<array>
+Subtracts the quantity of items on an actor. If the quantity of an item reaches 0, the item is removed from the actor.
**Returns**: Promise.<array>
- An array of objects, each containing the item that was removed or updated, the quantity that was removed, and whether the item was deleted
| Param | Type | Default | Description |
@@ -556,8 +505,8 @@ Subtracts the quantity of items on an actor. If the quantity of an item reaches
---
-## transferItems(source, target, items, { interactionId }) ⇒ Promise.<object>
-Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0
+### transferItems(source, target, items, { interactionId }) ⇒ Promise.<object>
+Transfers items from the source to the target, subtracting a number of quantity from the source's item and adding it to the target's item, deleting items from the source if their quantity reaches 0
**Returns**: Promise.<object>
- An array of objects, each containing the item that was added or updated, and the quantity that was transferred
| Param | Type | Default | Description |
@@ -571,24 +520,24 @@ Transfers items from the source to the target, subtracting a number of quantity
---
-## transferAllItems(source, target, { itemTypeFilters, interactionId }) ⇒ Promise.<array>
-Transfers all items between the source and the target.
+### transferAllItems(source, target, { itemFilters, interactionId }) ⇒ Promise.<array>
+Transfers all items between the source and the target.
**Returns**: Promise.<array>
- An array containing all of the items that were transferred to the target
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| source | Actor/Token/TokenDocument
| | The actor to transfer all items from |
| target | Actor/Token/TokenDocument
| | The actor to receive all the items |
-| [itemTypeFilters] | array/boolean
| false
| Array of item types disallowed - will default to module settings if none provided |
+| [itemFilters] | array/boolean
| false
| Array of item types disallowed - will default to module settings if none provided |
| [interactionId] | string/boolean
| false
| The ID of this interaction |
---
-## addAttributes(target, attributes, { interactionId }) ⇒ Promise.<object>
-Adds to attributes on an actor
-**Returns**: Promise.<object>
- Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed
+### addAttributes(target, attributes, { interactionId }) ⇒ Promise.<object>
+Adds to attributes on an actor
+**Returns**: Promise.<object>
- An array containing a key value pair of the attribute path and the quantity of that attribute that was removed
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -600,9 +549,9 @@ Adds to attributes on an actor
---
-## removeAttributes(target, attributes, { interactionId }) ⇒ Promise.<object>
-Subtracts attributes on the target
-**Returns**: Promise.<object>
- Returns an array containing a key value pair of the attribute path and the quantity of that attribute that was removed
+### removeAttributes(target, attributes, { interactionId }) ⇒ Promise.<object>
+Subtracts attributes on the target
+**Returns**: Promise.<object>
- An array containing a key value pair of the attribute path and the quantity of that attribute that was removed
| Param | Type | Default | Description |
| --- | --- | --- | --- |
@@ -614,8 +563,8 @@ Subtracts attributes on the target
---
-## transferAttributes(source, target, attributes, { interactionId }) ⇒ Promise.<object>
-Transfers a set quantity of an attribute from a source to a target, removing it or subtracting from the source and adds it the target
+### transferAttributes(source, target, attributes, { interactionId }) ⇒ Promise.<object>
+Transfers a set quantity of an attribute from a source to a target, removing it or subtracting from the source and adds it the target
**Returns**: Promise.<object>
- An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred
| Param | Type | Default | Description |
@@ -629,8 +578,8 @@ Transfers a set quantity of an attribute from a source to a target, removing it
---
-## transferAllAttributes(source, target, { interactionId }) ⇒ Promise.<object>
-Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target
+### transferAllAttributes(source, target, { interactionId }) ⇒ Promise.<object>
+Transfers all dynamic attributes from a source to a target, removing it or subtracting from the source and adding them to the target
**Returns**: Promise.<object>
- An object containing a key value pair of each attribute transferred, the key being the attribute path and its value being the quantity that was transferred
| Param | Type | Default | Description |
@@ -643,33 +592,20 @@ Transfers all dynamic attributes from a source to a target, removing it or subtr
---
-## transferEverything(source, target, { itemTypeFilters, interactionId }) ⇒ Promise.<object>
-Transfers all items and attributes between the source and the target.
+### transferEverything(source, target, { itemFilters, interactionId }) ⇒ Promise.<object>
+Transfers all items and attributes between the source and the target.
**Returns**: Promise.<object>
- An object containing all items and attributes transferred to the target
| Param | Type | Default | Description |
| --- | --- | --- | --- |
| source | Actor/Token/TokenDocument
| | The actor to transfer all items and attributes from |
| target | Actor/Token/TokenDocument
| | The actor to receive all the items and attributes |
-| [itemTypeFilters] | array/boolean
| false
| Array of item types disallowed - will default to module settings if none provided |
+| [itemFilters] | array/boolean
| false
| Array of item types disallowed - will default to module settings if none provided |
| [interactionId] | string/boolean
| false
| The ID of this interaction |
---
-## rerenderTokenHud() ⇒ Promise
-Causes every user's token HUD to rerender
-
-
----
-
-## isItemTypeDisallowed(item, itemTypeFilters) ⇒ boolean/string
-Checks whether an item (or item data) is of a type that is not allowed. If an array whether that type is allowed
-or not, returning the type if it is NOT allowed.
-
-| Param | Type | Default |
-| --- | --- | --- |
-| item | Item/Object
| |
-| [itemTypeFilters] | array/boolean
| false
|
-
+### rerenderTokenHud() ⇒ Promise
+Causes every user's token HUD to rerender
diff --git a/languages/de.json b/languages/de.json
index 9f656bf7..5c9cb743 100644
--- a/languages/de.json
+++ b/languages/de.json
@@ -5,9 +5,9 @@
"Title": "Untersuche Gegenstandstapel",
"AsActor": "Du untersuchst diesen Stapel als {actorName}",
"NoActor": "Du untersuchst den Inhalt dieses Stapels ohne ein Token zu kontrollieren. Dies bedeutet du kannst keine Gegenstände vom Stapel nehmen.",
- "TakeAll": "Alles nehmen",
"Empty": "Dieser Stapel ist leer.",
"Destroyed": "Dieser Stapel existiert nicht mehr und liegt brach.",
+ "TakeAll": "Alles nehmen",
"Take": "Nehmen",
"Close": "Kiste schliessen",
"Leave": "Verlassen"
@@ -51,54 +51,76 @@
"Title": "Dynamischer Attribute Editor",
"Explanation": "Hier kannst du festlegen, welche Attribute von Charakteren von Gegenstandsstapeln abgeholt werden können, z.B. Währungen. In D&D5e gibt es Währungen für Akteure mit dem Attributspfad \"actor.data.data.currency.gp\", also fügst du deine eigene mit dem Namen \"Goldmünzen\" und dem Attributspfad \"data.currency.gp\" hinzu.",
"Name": "Attributsname",
- "AttributePath": "Attributspfad",
"Icon": "Attribut Icon",
"AddNew": "Neues Attribut zufügen",
"Submit": "Attribut übermitteln"
},
+ "FilterEditor": {
+ "Title": "Item Filters Editor",
+ "Explanation": "Here you can define multiple types of filters that will exclude certain types of items. Based on the attribute path given, the item pile could find the \"type\" of an item and based on the filters, it hides those items in the item pile inventory UI.",
+ "Filters": "Filters",
+ "AddNew": "Add new filter",
+ "Submit": "Submit Filters"
+ },
+
+ "AttributePath": "Attributspfad",
+
"Defaults": {
"Title": "Gegenstandsstapel Konfiguration",
"Configure": "Gegenstandsstapel",
- "MainSettings": "Hauptmenü",
- "SingleItemSettings": "Einstellungen einzelner Gegenstand",
- "ContainerSettings": "Einstellungen Container",
"Update": "Gegenstandsstapel aktualisieren",
- "EnabledPile": "Aktiviert",
- "EnabledPileExplanation": "Bestimmt ob sich dies als Gegenstandsstapel verhalten soll.",
- "InspectItems": "Gegenstände prüfbar aktivieren",
- "InspectItemsExplanation": "Durch Klick auf den Namen des Gegenständes wird das Gegenstandsfenster geöffnet.",
- "Distance": "Interaktionsreichweite",
- "GridUnits": "Gittereinheiten (leer lassen für unbegrenzt)",
- "ItemTypeFilter": "Gegenstandstyp Filter",
- "ItemTypeFilterExplanation": "Artikel dieser Typen werden in keiner Artikelstapel-Benutzeroberfläche angezeigt, wobei jeder Typ durch ein Komma getrennt wird. Leer lassen, um die Standardwerte des Moduls zu verwenden.",
- "Macro": "Macro bei Interaktion",
- "MacroExplanation": "Name des Makros, das ausgeführt werden soll, wenn mit diesem Stapel interagiert wird.",
- "MacroPlaceholder": "Macro Name einfügen",
- "OverrideAttributes": "Dynamische Attribute außer Kraft setzen",
- "OverrideAttributesExplanation": "Legen Sie fest, ob dieser Stapel andere Attribute als die Standardattribute übertragen können soll.",
- "ConfigureOverrideAttributes": "Konfiguriere: Dynamische Attribute außer Kraft setzen",
- "DeleteWhenEmpty": "Löschen wenn leer",
- "DeleteWhenEmptyExplanation": "Bewirkt, dass sich der Gegenstandsstapel selbst löscht, sobald er leer ist.",
- "DeleteWhenEmptyDefault": "Standardeinstellung des Moduls",
- "DeleteWhenEmptyYes": "Ja, löschen, wenn leer",
- "DeleteWhenEmptyNo": "Nein, nicht löschen wenn leer",
- "DisplayOne": "Einzelnes Artikelbild anzeigen",
- "DisplayOneExplanation": "Besteht der Stapel aus einem einzigen Gegenstand, wird das Bild des Stapels auf das Bild des Gegenstandes gesetzt.",
- "OverrideSingleItemScale": "Einzelne Gegenstands-Token-Skalierung außer Kraft setzen",
- "SingleItemScale": "Gegenstands-Token-Skalierung",
- "DisplayOneContainerWarning": "Achtung! Du hast sowohl die Einstellung \"Einzelnes Artikelbild anzeigen\" als auch \"Ist Container\" aktiviert. In diesem Fall werden Bilder für den Container bevorzugt verwendet.",
- "IsContainer": "Ist Container",
- "Locked": "Ist verschlossen",
- "Closed": "Ist geschlossen",
- "ClosedImagePath": "Pfad Bild Geschlossener Container",
- "EmptyImagePath": "Pfad Bild Leerer Container",
- "OpenedImagePath": "Pfad Bild Geöffneter Container",
- "LockedImagePath": "Pfad Bild Verschlossener Container",
- "CloseSoundPath": "Pfad Geräusch Schliessen",
- "OpenSoundPath": "Pfad Geräusch Öffnen",
- "LockedSoundPath": "Pfad Geräusch Verschlossen"
+
+ "Main": {
+ "Title": "Hauptmenü",
+ "EnabledPile": "Aktiviert",
+ "EnabledPileExplanation": "Bestimmt ob sich dies als Gegenstandsstapel verhalten soll.",
+ "InspectItems": "Gegenstände prüfbar aktivieren",
+ "InspectItemsExplanation": "Durch Klick auf den Namen des Gegenständes wird das Gegenstandsfenster geöffnet.",
+ "Distance": "Interaktionsreichweite",
+ "GridUnits": "Gittereinheiten (leer lassen für unbegrenzt)",
+ "Macro": "Macro bei Interaktion",
+ "MacroExplanation": "Name des Makros, das ausgeführt werden soll, wenn mit diesem Stapel interagiert wird.",
+ "MacroPlaceholder": "Macro Name einfügen",
+ "DeleteWhenEmpty": "Löschen wenn leer",
+ "DeleteWhenEmptyExplanation": "Bewirkt, dass sich der Gegenstandsstapel selbst löscht, sobald er leer ist.",
+ "DeleteWhenEmptyDefault": "Standardeinstellung des Moduls",
+ "DeleteWhenEmptyYes": "Ja, löschen, wenn leer",
+ "DeleteWhenEmptyNo": "Nein, nicht löschen wenn leer",
+ "OverrideAttributes": "Dynamische Attribute außer Kraft setzen",
+ "OverrideAttributesExplanation": "Legen Sie fest, ob dieser Stapel andere Attribute als die Standardattribute übertragen können soll.",
+ "ConfigureOverrideAttributes": "Konfiguriere: Dynamische Attribute außer Kraft setzen",
+ "OverrideItemFilters": "Override Item Filters",
+ "OverrideItemFiltersExplanation": "Configure if this pile should be able to transfer other types items than the default.",
+ "ConfigureOverrideItemFilters": "Configure Override Item Filters"
+ },
+
+ "SingleItem": {
+ "Title": "Einstellungen einzelner Gegenstand",
+ "DisplayOneContainerWarning": "Achtung! Du hast sowohl die Einstellung \"Einzelnes Artikelbild anzeigen\" als auch \"Ist Container\" aktiviert. In diesem Fall werden Bilder für den Container bevorzugt verwendet.",
+ "DisplayOne": "Einzelnes Artikelbild anzeigen",
+ "DisplayOneExplanation": "Besteht der Stapel aus einem einzigen Gegenstand, wird das Bild des Stapels auf das Bild des Gegenstandes gesetzt.",
+ "OverrideScale": "Einzelne Gegenstands-Token-Skalierung außer Kraft setzen",
+ "Scale": "Gegenstands-Token-Skalierung",
+ "ItemName": "Use Item Name",
+ "ItemNameExplanation": "Causes the item pile to be named after the single item it contains."
+ },
+
+ "Container": {
+ "Title": "Einstellungen Container",
+ "IsContainer": "Ist Container",
+ "Locked": "Ist verschlossen",
+ "Closed": "Ist geschlossen",
+ "ClosedImagePath": "Pfad Bild Geschlossener Container",
+ "EmptyImagePath": "Pfad Bild Leerer Container",
+ "OpenedImagePath": "Pfad Bild Geöffneter Container",
+ "LockedImagePath": "Pfad Bild Verschlossener Container",
+ "CloseSoundPath": "Pfad Geräusch Schliessen",
+ "OpenSoundPath": "Pfad Geräusch Öffnen",
+ "LockedSoundPath": "Pfad Geräusch Verschlossen"
+ }
},
+
"HUD": {
"ToggleLocked": "Setze verschlossen",
"ToggleClosed": "Setze geschlossen",
@@ -140,13 +162,10 @@
"Label": "Attribute konfigurieren",
"Hint": "Mit dieser Einstellung werden die Attribute festgelegt, die für die Abholung in Artikelpfaden in Frage kommen, z. B. Währungen oder Stärken, bei denen es sich nicht um tatsächliche Artikel handeln muss."
},
- "ItemType": {
- "Title": "Gegenstand Attribut Artikeltyp",
- "Label": "Diese Einstellung legt den Attributspfad fest, der bestimmt, wo sich die Gegenstandstypen befinden. In D&D5e heißt dieser einfach \"type\", weil der Typ direkt in \"item.data.type\" definiert ist, da jeder Gegenstand seinen Typ mit diesem Attribut kennzeichnet."
- },
- "ItemTypeFilters": {
- "Title": "Gegenstand Typ Filter",
- "Label": "Hier kannst du konfigurieren, welche Gegenstandstypen ignoriert und nicht in den Gegenstandsstapeldialogen aufgeführt werden sollen. Zum Beispiel willst du in D&D5e wahrscheinlich keine Zauber, Feats und Klassen anzeigen, also würdest du \"spell, feat, class\" eintragen."
+ "ItemFilters": {
+ "Title": "Item filters",
+ "Label": "Configure Item Filters",
+ "Hint": "Here you can configure what items are ignored and not listed in the item pile dialogs."
},
"OutputToChat": {
"Title": "Ausgabe im Chat",
diff --git a/languages/en.json b/languages/en.json
index 3e829ba3..74efc153 100644
--- a/languages/en.json
+++ b/languages/en.json
@@ -5,9 +5,9 @@
"Title": "Inspecting Pile Contents",
"AsActor": "You're inspecting this pile as {actorName}",
"NoActor": "You are inspecting the contents of this pile without controlling a token, which means you can't take items from it.",
- "TakeAll": "Take All Items",
"Empty": "This pile is empty.",
"Destroyed": "This pile no longer exists and lies barren.",
+ "TakeAll": "Take All Items",
"Take": "Take",
"Close": "Close Lid",
"Leave": "Leave"
@@ -51,53 +51,75 @@
"Title": "Dynamic Attributes Editor",
"Explanation": "Here you can define which attributes on characters that can be picked up from item piles, such as currencies. In D&D5e, currencies exist on actors on the attribute path \"actor.data.data.currency.gp\", so you'd add your own with the name \"Gold Coins\" and attribute path \"data.currency.gp\".",
"Name": "Attribute name",
- "AttributePath": "Attribute path",
"Icon": "Attribute icon",
"AddNew": "Add new attribute",
"Submit": "Submit Attributes"
},
+ "FilterEditor": {
+ "Title": "Item Filters Editor",
+ "Explanation": "Here you can define multiple types of filters that will exclude certain types of items. Based on the attribute path given, the item pile could find the \"type\" of an item and based on the filters, it hides those items in the item pile inventory UI.",
+ "Filters": "Filters",
+ "AddNew": "Add new filter",
+ "Submit": "Submit Filters"
+ },
+
+ "AttributePath": "Attribute path",
+
"Defaults": {
"Title": "Item Pile Configuration",
"Configure": "Item Pile",
- "MainSettings": "Main Settings",
- "SingleItemSettings": "Single Item Settings",
- "ContainerSettings": "Container Settings",
"Update": "Update Item Pile",
- "EnabledPile": "Enabled",
- "EnabledPileExplanation": "Whether this should act as an item pile.",
- "InspectItems": "Enable Item Inspect",
- "InspectItemsExplanation": "Clicking item names will open the item's sheet.",
- "Distance": "Interaction Distance",
- "GridUnits": "Grid Units (leave empty for infinite)",
- "ItemTypeFilter": "Item Type Filter",
- "ItemTypeFilterExplanation": "Items of these types will not be shown in any item pile UI, each type separated by a comma. Leave blank to use module defaults.",
- "Macro": "On Interact Macro",
- "MacroExplanation": "Name of macro to execute when this pile is interacted with.",
- "MacroPlaceholder": "Insert macro name",
- "OverrideAttributes": "Override Dynamic Attributes",
- "OverrideAttributesExplanation": "Configure if this pile should be able to transfer other attributes than the default.",
- "ConfigureOverrideAttributes": "Configure Override Dynamic Attributes",
- "DeleteWhenEmpty": "Delete when empty",
- "DeleteWhenEmptyExplanation": "Causes the item pile to auto-delete itself once it's empty.",
- "DeleteWhenEmptyDefault": "Default module setting",
- "DeleteWhenEmptyYes": "Yes, delete when empty",
- "DeleteWhenEmptyNo": "No, don't delete when empty",
- "DisplayOne": "Display Single Item Image",
- "DisplayOneExplanation": "If the pile is made up of a single item, this sets the pile token's image to be the image of the item.",
- "OverrideSingleItemScale": "Override single item token scale",
- "SingleItemScale": "Single item token scale",
- "DisplayOneContainerWarning": "Warning! You have both \"Display Single Item Image\" and \"Is Container\" enabled. In this case, the container images takes priority.",
- "IsContainer": "Is Container",
- "Locked": "Is Locked",
- "Closed": "Is Closed",
- "ClosedImagePath": "Closed Image Path",
- "EmptyImagePath": "Empty Image Path",
- "OpenedImagePath": "Opened Image Path",
- "LockedImagePath": "Locked Image Path",
- "CloseSoundPath": "Closing Sound Path",
- "OpenSoundPath": "Opening Sound Path",
- "LockedSoundPath": "Locked Sound Path"
+
+ "Main": {
+ "Title": "Main",
+ "EnabledPile": "Enabled",
+ "EnabledPileExplanation": "Whether this should act as an item pile.",
+ "InspectItems": "Enable Item Inspect",
+ "InspectItemsExplanation": "Clicking item names will open the item's sheet.",
+ "Distance": "Interaction Distance",
+ "GridUnits": "Grid Units (leave empty for infinite)",
+ "Macro": "On Interact Macro",
+ "MacroExplanation": "Name of macro to execute when this pile is interacted with.",
+ "MacroPlaceholder": "Insert macro name",
+ "DeleteWhenEmpty": "Delete when empty",
+ "DeleteWhenEmptyExplanation": "Causes the item pile to auto-delete itself once it's empty.",
+ "DeleteWhenEmptyDefault": "Default module setting",
+ "DeleteWhenEmptyYes": "Yes, delete when empty",
+ "DeleteWhenEmptyNo": "No, don't delete when empty",
+ "OverrideAttributes": "Override Dynamic Attributes",
+ "OverrideAttributesExplanation": "Configure if this pile should be able to transfer other attributes than the default.",
+ "ConfigureOverrideAttributes": "Configure Override Dynamic Attributes",
+ "OverrideItemFilters": "Override Item Filters",
+ "OverrideItemFiltersExplanation": "Configure if this pile should be able to transfer other types items than the default.",
+ "ConfigureOverrideItemFilters": "Configure Override Item Filters"
+ },
+
+ "SingleItem": {
+ "Title": "Single Item",
+ "DisplayOneContainerWarning": "Warning! You have both \"Display Single Item Image\" and \"Is Container\" enabled. In this case, the container images takes priority.",
+ "DisplayOne": "Display Single Item Image",
+ "DisplayOneExplanation": "If the pile is made up of a single item, this sets the pile token's image to be the image of the item.",
+ "OverrideScale": "Override single item token scale",
+ "Scale": "Single item token scale",
+ "ItemName": "Use Item Name",
+ "ItemNameExplanation": "Causes the item pile to be named after the single item it contains."
+ },
+
+ "Container": {
+ "Title": "Container Settings",
+ "IsContainer": "Is Container",
+ "Locked": "Is Locked",
+ "Closed": "Is Closed",
+ "ClosedImagePath": "Closed Image Path",
+ "EmptyImagePath": "Empty Image Path",
+ "OpenedImagePath": "Opened Image Path",
+ "LockedImagePath": "Locked Image Path",
+ "CloseSoundPath": "Closing Sound Path",
+ "OpenSoundPath": "Opening Sound Path",
+ "LockedSoundPath": "Locked Sound Path"
+ }
+
},
"HUD": {
@@ -141,13 +163,10 @@
"Label": "Configure Attributes",
"Hint": "This setting define the attributes that are eligible for pickup in item paths, such as currencies or power, which may not be actual items."
},
- "ItemType": {
- "Title": "Item type attribute",
- "Label": "This setting defines the attribute path for determining where the item types live. In D&D5e, it's just \"type\" because the type is defined directly in \"item.data.type\", because each item distinguishes its type with that attribute."
- },
- "ItemTypeFilters": {
- "Title": "Item type filters",
- "Label": "Here you can configure what item types are ignored and not listed in the item pile dialogs. For example, in D&D5e we probably don't want to show spells, feats, and classes, so you'd put \"spell, feat, class\"."
+ "ItemFilters": {
+ "Title": "Item filters",
+ "Label": "Configure Item Filters",
+ "Hint": "Here you can configure what items are ignored and not listed in the item pile dialogs."
},
"OutputToChat": {
"Title": "Output to chat",
diff --git a/languages/fr.json b/languages/fr.json
index 5e64e094..15cba2db 100644
--- a/languages/fr.json
+++ b/languages/fr.json
@@ -5,9 +5,9 @@
"Title": "Inspecter le contenu des piles",
"AsActor": "Vous inspectez cette pile en tant que {actorName}",
"NoActor": "Vous inspectez le contenu de cette pile sans contrôler un token, ce qui signifie que vous ne pouvez pas y prendre d'objets.",
- "TakeAll": "Prendre tous les articles",
"Empty": "Cette pile est vide.",
"Destroyed": "Cette pile n'existe plus.",
+ "TakeAll": "Prendre tous les articles",
"Take": "Prendre",
"Close": "Fermer",
"Leave": "Partir"
@@ -51,53 +51,74 @@
"Title": "Éditeur d'attributs dynamiques",
"Explanation": "Ici, vous pouvez définir les attributs des personnages qui peuvent être récupérés dans les piles d'objets, comme les devises. Dans D&D5e, les monnaies existent sur les acteurs dans le chemin d'attribut \"actor.data.data.currency.gp\", donc vous ajouteriez la vôtre avec le nom \"Gold Coins\" et le chemin d'attribut \"data.currency.gp\".",
"Name": "Nom de l'attribut",
- "AttributePath": "Chemin de l'attribut",
"Icon": "Icône de l'attribut",
"AddNew": "Ajouter un nouvel attribut",
"Submit": "Soumettre les attributs"
},
+ "FilterEditor": {
+ "Title": "Item Filters Editor",
+ "Explanation": "Here you can define multiple types of filters that will exclude certain types of items. Based on the attribute path given, the item pile could find the \"type\" of an item and based on the filters, it hides those items in the item pile inventory UI.",
+ "Filters": "Filters",
+ "AddNew": "Add new filter",
+ "Submit": "Submit Filters"
+ },
+
+ "AttributePath": "Chemin de l'attribut",
+
"Defaults": {
- "Title": "Configuration de la pile d'article",
- "Configure": "Pile d'articles",
- "MainSettings": "Paramètres principaux",
- "SingleItemSettings": "Paramètres objet unique",
- "ContainerSettings": "Paramètres du conteneur",
- "Update": "Mise à jour de la pile d'articles",
- "EnabledPile": "Activé",
- "EnabledPileExplanation": "Si cela doit agir comme une pile d'articles.",
- "InspectItems": "Activer l'inspection des éléments",
- "InspectItemsExplanation": "En cliquant sur les noms des éléments, vous ouvrirez la fiche en question.",
- "Distance": "Distance d'interaction",
- "GridUnits": "Unités de grille (laissez vide pour l'infini)",
- "ItemTypeFilter": "Filtre du type d'article",
- "ItemTypeFilterExplanation": "Les éléments de ces types ne seront pas affichés dans l'interface de la pile d'éléments, chaque type étant séparé par une virgule. Laissez vide pour utiliser les valeurs par défaut du module.",
- "Macro": "Macro à l'interaction",
- "MacroExplanation": "Nom de la macro à exécuter lors de l'interaction avec cette pile.",
- "MacroPlaceholder": "Insérer le nom de la macro",
- "OverrideAttributes": "Remplacer les attributs dynamiques",
- "OverrideAttributesExplanation": "Configurez si cette pile doit être capable d'utiliser d'autres attributs que ceux par défaut.",
- "ConfigureOverrideAttributes": "Configurer les attributs dynamiques de remplacement",
- "DeleteWhenEmpty": "Supprimer lorsque vide",
- "DeleteWhenEmptyExplanation": "Permet à la pile d'objets de s'effacer automatiquement lorsqu'elle est vide.",
- "DeleteWhenEmptyDefault": "Réglage par défaut du module",
- "DeleteWhenEmptyYes": "Oui, supprimer quand c'est vide",
- "DeleteWhenEmptyNo": "Non, ne pas supprimer quand c'est vide",
- "DisplayOne": "Afficher l'image d'un seul élément",
- "DisplayOneExplanation": "Si la pile est composée d'un seul objet, l'image du token de la pile sera l'image de l'objet.",
- "OverrideSingleItemScale": "Remplacer l'échelle du Token objet unique",
- "SingleItemScale": "Échelle du Token",
- "DisplayOneContainerWarning": "Attention ! Vous avez activé à la fois les options \"Afficher l'image d'un seul élément\" et \"Est un conteneur\". Dans ce cas, l'images du conteneur est prioritaires.",
- "IsContainer": "Est un conteneur",
- "Locked": "est verrouillé",
- "Closed": "Est fermé",
- "ClosedImagePath": "Chemin de l'image quand fermé",
- "EmptyImagePath": "Chemin de l'image quand vide",
- "OpenedImagePath": "Chemin de l'image quand ouvert",
- "LockedImagePath": "Chemin de l'image quand verrouillé",
- "CloseSoundPath": "Chemin du son quand fermé",
- "OpenSoundPath": "Chemin du son quand ouvert",
- "LockedSoundPath": "Chemin du son quand verrouillé"
+ "Title": "Configuration de la pile d'article",
+ "Configure": "Pile d'articles",
+ "Update": "Mise à jour de la pile d'articles",
+
+ "Main": {
+ "Title": "Paramètres principaux",
+ "EnabledPile": "Activé",
+ "EnabledPileExplanation": "Si cela doit agir comme une pile d'articles.",
+ "InspectItems": "Activer l'inspection des éléments",
+ "InspectItemsExplanation": "En cliquant sur les noms des éléments, vous ouvrirez la fiche en question.",
+ "Distance": "Distance d'interaction",
+ "GridUnits": "Unités de grille (laissez vide pour l'infini)",
+ "Macro": "Macro à l'interaction",
+ "MacroExplanation": "Nom de la macro à exécuter lors de l'interaction avec cette pile.",
+ "MacroPlaceholder": "Insérer le nom de la macro",
+ "DeleteWhenEmpty": "Supprimer lorsque vide",
+ "DeleteWhenEmptyExplanation": "Permet à la pile d'objets de s'effacer automatiquement lorsqu'elle est vide.",
+ "DeleteWhenEmptyDefault": "Réglage par défaut du module",
+ "DeleteWhenEmptyYes": "Oui, supprimer quand c'est vide",
+ "DeleteWhenEmptyNo": "Non, ne pas supprimer quand c'est vide",
+ "OverrideAttributes": "Remplacer les attributs dynamiques",
+ "OverrideAttributesExplanation": "Configurez si cette pile doit être capable d'utiliser d'autres attributs que ceux par défaut.",
+ "ConfigureOverrideAttributes": "Configurer les attributs dynamiques de remplacement",
+ "OverrideItemFilters": "Override Item Filters",
+ "OverrideItemFiltersExplanation": "Configure if this pile should be able to transfer other types items than the default.",
+ "ConfigureOverrideItemFilters": "Configure Override Item Filters"
+ },
+
+ "SingleItem": {
+ "Title": "Paramètres objet unique",
+ "DisplayOneContainerWarning": "Attention ! Vous avez activé à la fois les options \"Afficher l'image d'un seul élément\" et \"Est un conteneur\". Dans ce cas, l'images du conteneur est prioritaires.",
+ "DisplayOne": "Afficher l'image d'un seul élément",
+ "DisplayOneExplanation": "Si la pile est composée d'un seul objet, l'image du token de la pile sera l'image de l'objet.",
+ "OverrideScale": "Remplacer l'échelle du Token objet unique",
+ "Scale": "Échelle du Token",
+ "ItemName": "Use Item Name",
+ "ItemNameExplanation": "Causes the item pile to be named after the single item it contains."
+ },
+
+ "Container": {
+ "Title": "Paramètres objet unique",
+ "IsContainer": "Est un conteneur",
+ "Locked": "est verrouillé",
+ "Closed": "Est fermé",
+ "ClosedImagePath": "Chemin de l'image quand fermé",
+ "EmptyImagePath": "Chemin de l'image quand vide",
+ "OpenedImagePath": "Chemin de l'image quand ouvert",
+ "LockedImagePath": "Chemin de l'image quand verrouillé",
+ "CloseSoundPath": "Chemin du son quand fermé",
+ "OpenSoundPath": "Chemin du son quand ouvert",
+ "LockedSoundPath": "Chemin du son quand verrouillé"
+ }
},
"HUD": {
@@ -141,14 +162,11 @@
"Label": "Configurer les attributs",
"Hint": "Ce paramètre définit les attributs qui peuvent être ramassés dans les chemins d'accès aux articles, tels que les devises ou les pouvoirs, qui peuvent ne pas être des articles réels."
},
- "ItemType": {
- "Title": "Attribut Type d'article",
- "Label": "Ce paramètre définit le chemin de l'attribut pour déterminer où se trouvent les types d'objets. Dans D&D5e, c'est juste \"type\" parce que le type est défini directement dans \"item.data.type\", parce que chaque objet distingue son type avec cet attribut."
- },
- "ItemTypeFilters": {
- "Title": "Filtres de type d'article",
- "Label": "Ici, vous pouvez configurer quels types d'objets sont ignorés et ne sont pas listés dans les dialogues de pile d'objets. Par exemple, dans D&D5e, nous ne voulons probablement pas montrer les sorts, les dons et les classes, donc vous mettrez \"sort, dons, classe\"."
- },
+ "ItemFilters": {
+ "Title": "Item filters",
+ "Label": "Configure Item Filters",
+ "Hint": "Here you can configure what items are ignored and not listed in the item pile dialogs."
+ },
"OutputToChat": {
"Title": "Afficher dans le chat",
"Label": "Chaque fois qu'un joueur ramasse des articles d'une pile d'objets, ceci enverra un message indiquant ce qui a été ramassé",
@@ -175,4 +193,4 @@
}
}
}
-}
+}
\ No newline at end of file
diff --git a/languages/ja.json b/languages/ja.json
index af14648d..0ff01ded 100644
--- a/languages/ja.json
+++ b/languages/ja.json
@@ -5,9 +5,9 @@
"Title": "お宝の中身",
"AsActor": "{actorName}としてお宝を確認中",
"NoActor": "選択中のコマが居ない状態で中身を確認しています。アイテムを取得する先が存在ませんのでアイテムの取得ができません。",
- "TakeAll": "すべて取得",
"Empty": "このお宝は空です",
"Destroyed": "このお宝はもはや存在せず……",
+ "TakeAll": "すべて取得",
"Take": "取得",
"Close": "閉じる",
"Leave": "離れる"
@@ -51,54 +51,76 @@
"Title": "参照データ設定",
"Explanation": "お宝として指定されたコマから取得可能なリソースや内部データをここで定義できます。例えばD&D5版の場合、所持しているGPの数は\"actor.data.data.currency.gp\"に保存されています。\"金貨\"という名前とともに\"data.currency.gp\"のデータパスを設定してあげればお宝からGPを取得可能になります。",
"Name": "データ名",
- "AttributePath": "データパス",
"Icon": "データアイコン",
"AddNew": "新規データ追加",
"Submit": "データ追加"
},
+ "FilterEditor": {
+ "Title": "アイテムフィルター設定",
+ "Explanation": "ここではお宝の中に表示されないアイテムの種別を設定できます。設定したパスからアイテムの「種別」が定められ、UI上に非表示になります。",
+ "Filters": "フィルター",
+ "AddNew": "新規フィルター追加",
+ "Submit": "フィルター確定"
+ },
+
+ "AttributePath": "データパス",
+
"Defaults": {
"Title": "Item Pile(お宝)設定",
"Configure": "お宝",
- "MainSettings": "全体設定",
- "SingleItemSettings": "単体設定",
- "ContainerSettings": "コンテナ設定",
"Update": "お宝更新",
- "EnabledPile": "有効化",
- "EnabledPileExplanation": "このキャラクターがお宝として振る舞うかどうかを設定します。",
- "InspectItems": "アイテム詳細表示",
- "InspectItemsExplanation": "アイテム名をクリックすると、そのアイテムの詳細が表示されます。",
- "Distance": "操作可能範囲",
- "GridUnits": "グリッド単位(空で無限)",
- "ItemTypeFilter": "アイテム種別フィルタ",
- "ItemTypeFilterExplanation": "この種別のアイテムは",
- "Macro": "操作時のマクロ",
- "MacroExplanation": "このお宝を誰かが操作したときにマクロを実行します(効果音やその他の挙動を自分で追加したい時)",
- "MacroPlaceholder": "マクロ名",
- "OverrideAttributes": "参照データ上書き",
- "OverrideAttributesExplanation": "ここを設定すればデフォルト以外のデータを参照し、中身を取得できるようになります。",
- "ConfigureOverrideAttributes": "参照データ設定",
- "DeleteWhenEmpty": "空のお宝を自動削除",
- "DeleteWhenEmptyExplanation": "中身が空になったら、お宝のコマがシーン上から消滅します。",
- "DeleteWhenEmptyDefault": "デフォルト設定",
- "DeleteWhenEmptyYes": "はい、空になったら削除してください",
- "DeleteWhenEmptyNo": "いいえ、空になっても削除しないでください",
- "DisplayOne": "単体時、アイテム画像を表示",
- "DisplayOneExplanation": "お宝の中身が単体のアイテムの場合、そのアイテムの画像がお宝の画像そのものになります。",
- "OverrideSingleItemScale": "単体アイテムのコマサイズ調整",
- "SingleItemScale": "単体アイテムコマサイズ",
- "DisplayOneContainerWarning": "警告:\"単体時、アイテム画像を表示\"と\"コンテナである\"の両方の設定が有効化されています。この場合、コンテナ画像のほうが優先されますのでご注意ください。",
- "IsContainer": "コンテナである",
- "Locked": "ロックされている",
- "Closed": "閉まっている",
- "ClosedImagePath": "閉まっている時の画像",
- "EmptyImagePath": "空の時の画像",
- "OpenedImagePath": "開いている時の画像",
- "LockedImagePath": "ロック中の画像",
- "CloseSoundPath": "閉めた時の効果音",
- "OpenSoundPath": "開いた時の効果音",
- "LockedSoundPath": "ロック中の効果音"
+
+ "Main": {
+ "Title": "全体設定",
+ "EnabledPile": "有効化",
+ "EnabledPileExplanation": "このキャラクターがお宝として振る舞うかどうかを設定します。",
+ "InspectItems": "アイテム詳細表示",
+ "InspectItemsExplanation": "アイテム名をクリックすると、そのアイテムの詳細が表示されます。",
+ "Distance": "操作可能範囲",
+ "GridUnits": "グリッド単位(空で無限)",
+ "Macro": "操作時のマクロ",
+ "MacroExplanation": "このお宝を誰かが操作したときにマクロを実行します(効果音やその他の挙動を自分で追加したい時)",
+ "MacroPlaceholder": "マクロ名",
+ "DeleteWhenEmpty": "空のお宝を自動削除",
+ "DeleteWhenEmptyExplanation": "中身が空になったら、お宝のコマがシーン上から消滅します。",
+ "DeleteWhenEmptyDefault": "デフォルト設定",
+ "DeleteWhenEmptyYes": "はい、空になったら削除してください",
+ "DeleteWhenEmptyNo": "いいえ、空になっても削除しないでください",
+ "OverrideAttributes": "参照データ上書き",
+ "OverrideAttributesExplanation": "ここを設定すればデフォルト以外のデータを参照し、中身を取得できるようになります。",
+ "ConfigureOverrideAttributes": "参照データ設定",
+ "OverrideItemFilters": "アイテムフィルター上書き",
+ "OverrideItemFiltersExplanation": "設定を上書きし、デフォルトのアイテム種別以外を受け取れるようになります。",
+ "ConfigureOverrideItemFilters": "アイテムフィルター上書き設定"
+ },
+
+ "SingleItem": {
+ "Title": "単体設定",
+ "DisplayOneContainerWarning": "警告:\"単体時、アイテム画像を表示\"と\"コンテナである\"の両方の設定が有効化されています。この場合、コンテナ画像のほうが優先されますのでご注意ください。",
+ "DisplayOne": "単体時、アイテム画像を表示",
+ "DisplayOneExplanation": "お宝の中身が単体のアイテムの場合、そのアイテムの画像がお宝の画像そのものになります。",
+ "OverrideScale": "単体アイテムのコマサイズ調整",
+ "Scale": "単体アイテムコマサイズ",
+ "ItemName": "アイテム名使用",
+ "ItemNameExplanation": "お宝の中身が単体アイテムの場合はそのアイテムの名前を使用します。"
+ },
+
+ "Container": {
+ "Title": "コンテナ設定",
+ "IsContainer": "コンテナである",
+ "Locked": "ロックされている",
+ "Closed": "閉まっている",
+ "ClosedImagePath": "閉まっている時の画像",
+ "EmptyImagePath": "空の時の画像",
+ "OpenedImagePath": "開いている時の画像",
+ "LockedImagePath": "ロック中の画像",
+ "CloseSoundPath": "閉めた時の効果音",
+ "OpenSoundPath": "開いた時の効果音",
+ "LockedSoundPath": "ロック中の効果音"
+ }
},
+
"HUD": {
"ToggleLocked": "ロック切替",
"ToggleClosed": "開閉",
@@ -140,13 +162,10 @@
"Label": "データ設定",
"Hint": "(上級設定)ここでは所持金や能力の使用回数など、必ずしもアイテムではないものを設定し中から取得できるようにします。"
},
- "ItemType": {
- "Title": "アイテム種別設定",
- "Label": "(上級設定)ここではデータ上アイテムとなるものがどんなパスを持つのかを設定します。D&D5版の場合、\"item.data.type\"という形で定義されているので、ここには\"type\"とだけ記入します。"
- },
- "ItemTypeFilters": {
- "Title": "アイテム種別フィルタ",
- "Label": "お宝として取得不可能なアイテムの種別をここで定義します。それらのアイテムは中に存在しても、ダイアログの中には出現しなくなります。D&D5版では、呪文、特徴、クラスをアイテムとして置きたくないかもしれないので\"spell, feat, class\"を記入します(英語名であることに注意)。"
+ "ItemFilters": {
+ "Title": "アイテムフィルター",
+ "Label": "アイテムフィルター設定",
+ "Hint": "ここではお宝の中に表示されないアイテムの種別を設定できます。"
},
"OutputToChat": {
"Title": "チャット表示",
diff --git a/scripts/api.js b/scripts/api.js
index 1a62a971..2063a3da 100644
--- a/scripts/api.js
+++ b/scripts/api.js
@@ -35,22 +35,13 @@ export default class API {
return game.settings.get(CONSTANTS.MODULE_NAME, "itemQuantityAttribute");
}
- /**
- * The attribute used to track the item type in this system
- *
- * @returns {string}
- */
- static get ITEM_TYPE_ATTRIBUTE() {
- return game.settings.get(CONSTANTS.MODULE_NAME, "itemTypeAttribute");
- }
-
/**
* The filters for item types eligible for interaction within this system
*
* @returns {Array}
*/
- static get ITEM_TYPE_FILTERS() {
- return game.settings.get(CONSTANTS.MODULE_NAME, "itemTypeFilters").split(',').map(str => str.trim().toLowerCase());
+ static get ITEM_FILTERS() {
+ return lib.cleanItemFilters(game.settings.get(CONSTANTS.MODULE_NAME, "itemFilters"));
}
/**
@@ -107,38 +98,24 @@ export default class API {
}
/**
- * Sets the attribute used to track the item type in this system
+ * Sets the items filters for interaction within this system
*
- * @param {string} inAttribute
- * @returns {string}
- */
- static async setItemTypeAttribute(inAttribute) {
- if (typeof inAttribute !== "string") {
- throw lib.custom_error("setItemTypeAttribute | inAttribute must be of type string");
- }
- return game.settings.set(CONSTANTS.MODULE_NAME, "itemTypeAttribute", inAttribute);
- }
-
- /**
- * Sets the filters for item types eligible for interaction within this system
- *
- * @param {string/array} inFilters
+ * @param {array} inFilters
* @returns {Promise}
*/
- static async setItemTypeFilters(inFilters) {
+ static async setItemFilters(inFilters) {
if (!Array.isArray(inFilters)) {
- if (typeof inFilters !== "string") {
- throw lib.custom_error("setItemTypeFilters | inFilters must be of type string or array");
- }
- inFilters = inFilters.split(',')
- } else {
- inFilters.forEach(filter => {
- if (typeof filter !== "string") {
- throw lib.custom_error("setItemTypeFilters | each entry in inFilters must be of type string");
- }
- })
+ throw lib.custom_error("setItemFilters | inFilters must be of type string or array");
}
- return game.settings.set(CONSTANTS.MODULE_NAME, "itemTypeFilters", inFilters.join(','));
+ inFilters.forEach(filter => {
+ if (typeof filter?.path !== "string") {
+ throw lib.custom_error("setItemFilters | each entry in inFilters must have a \"path\" property with a value that is of type string");
+ }
+ if (typeof filter?.filters !== "string") {
+ throw lib.custom_error("setItemFilters | each entry in inFilters must have a \"filters\" property with a value that is of type string");
+ }
+ });
+ return game.settings.set(CONSTANTS.MODULE_NAME, "itemFilters", inFilters);
}
/**
@@ -222,6 +199,7 @@ export default class API {
tokenSettings = foundry.utils.mergeObject(tokenSettings, {
"img": lib.getItemPileTokenImage(target, pileSettings),
"scale": lib.getItemPileTokenScale(target, pileSettings),
+ "name": lib.getItemPileName(target, pileSettings)
});
const sceneId = targetUuid.split('.')[1];
@@ -234,8 +212,8 @@ export default class API {
tokenUpdateGroups[sceneId].push({
"_id": tokenId,
...tokenSettings,
- [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: pileSettings,
- [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: pileSettings
+ [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings,
+ [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings
});
}
@@ -304,8 +282,8 @@ export default class API {
tokenUpdateGroups[sceneId].push({
"_id": tokenId,
...tokenSettings,
- [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: pileSettings,
- [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.FLAG_NAME}`]: pileSettings
+ [`flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings,
+ [`actorData.flags.${CONSTANTS.MODULE_NAME}.${CONSTANTS.PILE_DATA}`]: pileSettings
});
}
@@ -575,7 +553,7 @@ export default class API {
await lib.wait(15);
- await lib.updateItemPile(target, data, tokenSettings);
+ await lib.updateItemPileData(target, data, tokenSettings);
if (data.enabled && data.isContainer) {
if (diff?.closed === true) {
@@ -671,10 +649,10 @@ export default class API {
/**
* Remotely opens an item pile's inventory, if you have permission to edit the item pile. Passing a user ID, or a list of user IDs, will cause those users to open the item pile.
*
- * @param {Token/TokenDocument/Actor} target The item pile actor or token whose inventory to open
- * @param {array