@@ -11,25 +11,37 @@ Clicking this button opens an overview where you can edit that item's scripts.
1111
1212A script receives the following arguments (very similar to a normal Foundry macro!) when run:
1313
14- - ` this ` is a copy of the Script itself
15- - ` item ` the item containing the script
16- - ` speaker ` speaker data of the item's actor or the currently selected token or user's character
17- - ` actor ` actor from the speaker data, usually the item's owner
18- - ` token ` token from the speaker data
19- - ` character ` the current user's character or null
20- - ` trigger ` the trigger of the script, such as a button press or on item use.
14+ - ` this ` - is a copy of the Script itself
15+ - ` item ` - the item containing the script
16+ - ` speaker ` - speaker data of the item's Actor or the currently selected token or user's character
17+ - ` actor ` - actor from the speaker data, usually the item's owner
18+ - ` token ` - token from the speaker data
19+ - ` character ` - the current user's character or null
20+ - ` trigger ` - the trigger of the script, such as a button press or on item use.
2121 Is equal to ` debug ` when ran from the script's config sheet.
22- - ` message ` the chat message which triggered the script (only ` trigger === "button" ` )
22+ - ` optional ` - an object containing additional, optional arguments
23+ - ` optional.message ` - The chat message containing the clicked button (if ` trigger === "button" ` is true)
2324
2425Available triggers are currently:
2526
26- - When using the item (` dnd5e.preUseItem ` )
27+ - ` preUseItem ` - When using the item (Hook is ` dnd5e.preUseItem ` )
2728 - If you want to also have normal item usage, you can return ` true ` from the script
2829 - If you want to use ` item.use() ` inside the script, you can use ` item.use({}, {skipScripts: true}) `
29- - A button in the item's chat card
30+ - ` button ` A button in the item's chat card that triggers the script when clicked
31+ - ` addToActor ` When the item is added to an actor
32+ - ` removeFromActor ` When the item is removed from an actor
3033
3134## Changelog
3235
36+ ### 0.2.0
37+
38+ - Improved README
39+ - Improved localization
40+ - Refactored optional script arguments into an object
41+ - Added script triggers ` addToActor ` and ` removeFromActor ` which will execute the given script when the item is added
42+ or removed from an actor
43+ - Added a module setting to toggle the visibility of the header button label
44+
3345### 0.1.2
3446
3547- Added a module setting to show the header button only to users with the specified minimum role
0 commit comments