Skip to content

Commit

Permalink
feat: remove itemacro dependency
Browse files Browse the repository at this point in the history
With DAE absorbing itemacro's functionality, this is no longer required.
  • Loading branch information
TheGiddyLimit committed Jul 17, 2024
1 parent 176e59d commit 6d8c545
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 33 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ The `module/data/` directory is laid out as follows:

### Macros

Many facets of automation must be handled with macros. These are attached using [Item Macro](https://foundryvtt.com/packages/itemacro/), which appear as an escaped string in data. To add some human-readability, macros are handled separately and merged during the module build.
Many facets of automation must be handled with macros. These are attached using [DAE](https://foundryvtt.com/packages/dae)'s "DIME", and appear as an escaped string in data. To add some human-readability, macros are handled separately and merged during the module build.

In the [`macro-item/`](./macro-item) directory is a directory for each datatype. Save your (well-formatted, commented) macro code as a Javascript file in one of these directories, structured as an async function named `macro`, with filename `<sourceJson>_<item-name-lowercase-hyphenated>.js` (e.g. `XGE_toll-the-dead.js`). **Note that the first and last lines of the file**—the ones that turn the macro into an async function—**are stripped on compilation into the module's data**.

Expand Down
11 changes: 1 addition & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@

While the module is activated in your world, each time Plutonium would import a document, it will check if any automation data is available for that document. If so, it will import the document with the additional automation data included. If not, it will import the document as if *Plutonium Addon: Automation* were not enabled (although sometimes slightly and non-destructively tweaked for better compatibility with the modules below).

Some automations don't use effects directly, but rather call item macros. If you, as the GM, wish to allow players to view/edit macros on items they own, install [Item Macro](https://foundryvtt.com/packages/itemacro) and configure it to allow the _Player access_ option.

> [!TIP]
> **There's no need to import everything prematurely**, 'just in case'. As with Plutonium, all data is included in the module itself, and, if you use any [module integrations](#optional-integrations), you'll be missing out on updates from them.
> **There's no need to import everything prematurely**, 'just in case'. As with Plutonium, all data is included in the module itself, and, if you use any [module integrations](#optional-integrations), you'll be missing out on updates from them.
## Installation

Expand All @@ -47,7 +45,6 @@ Besides *Plutonium* itself, *Plutonium Addon: Automation* **requires**:
Some specific automations require one or more additional modules:
- [Active-Auras](https://foundryvtt.com/packages/ActiveAuras)
- [Active Token Effects](https://foundryvtt.com/packages/ATL)
- [Item Macro](https://foundryvtt.com/packages/itemacro)
- [Warp Gate](https://foundryvtt.com/packages/warpgate)

If you import a document which requires one of these modules, you will be prompted to install/activate it. The automation is highly unlikely to function as intended if you use it before activating the module.
Expand All @@ -62,12 +59,6 @@ You **must** configure some modules in a specific way, or the automations won't
- _**DFreds Convenient Effects** > Modify Status Effects_ — select either `Replace` (preferred) or `Add`.
- _**Midi QoL** > Midi QoL config > Workflow > Apply Convenient Effects_ — select `Apply Item effects, if absent apply CE`.

If you have [Item Macro](https://foundryvtt.com/packages/itemacro) activated, you also need to configure it as follows:

- _**Item Macro** > Override default macro execution_ — uncheck this.
- _**Item Macro** > Character Sheet Hook_ — uncheck this.
- (If installed) _**[Token Action HUD](https://foundryvtt.com/packages/token-action-hud)** > Item-Macro: item macro, original item, or both_ — select `Show the original item`. (Note this is a user setting, so either ensure that each user configures this or use a module such as [Force Client Settings](https://foundryvtt.com/packages/force-client-settings) to guarantee it. Also note that this is _not_ required if you use the system-specific [Token Action HUD Core](https://foundryvtt.com/packages/token-action-hud-core) and [Token Action HUD D&D 5e](https://foundryvtt.com/packages/token-action-hud-dnd5e) modules.)

### Optional integrations

*Plutonium Addon: Automation* can make use of data provided by other modules to provide better automations for more documents. An integration is available for:
Expand Down
5 changes: 1 addition & 4 deletions module/data/classFeature/__core.json
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,7 @@
}
],
"itemMacro": {
"file": "PHB_rage.js",
"requires": {
"itemacro": true
}
"file": "PHB_rage.js"
},
"ignoreSrdEffects": true
},
Expand Down
13 changes: 0 additions & 13 deletions module/js/SettingsManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class SettingsManager extends StartupHookMixin(class {}) {

static _MODULE_ID__DFREDS_CONVENIENT_EFFECTS = "dfreds-convenient-effects";
static _MODULE_ID__MIDI_QOL = "midi-qol";
static _MODULE_ID__ITEM_MACRO = "itemacro";
static _MODULE_ID__TOKEN_ACTION_HUD = "token-action-hud";
static _MODULE_ID__CHRIS_PREMADES = "chris-premades";

Expand All @@ -46,18 +45,6 @@ export class SettingsManager extends StartupHookMixin(class {}) {
expectedValue: "itempri",
displaySettingName: "midi-qol.AutoCEEffects.Name",
},
{
moduleId: this._MODULE_ID__ITEM_MACRO,
settingKey: "defaultmacro",
isGmOnly: true,
expectedValue: false,
},
{
moduleId: this._MODULE_ID__ITEM_MACRO,
settingKey: "charsheet",
isGmOnly: true,
expectedValue: false,
},
{
moduleId: this._MODULE_ID__TOKEN_ACTION_HUD,
settingKey: "itemMacroReplace",
Expand Down
5 changes: 0 additions & 5 deletions script/build-task.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ export const buildTask = async (
type: "module",
reason: "Enables additional automations",
},
{
id: "itemacro",
type: "module",
reason: "Enables additional automations; allows editing of some automations",
},
// endregion

// region Optional integrations
Expand Down

0 comments on commit 6d8c545

Please sign in to comment.