foundry-ironsworn
foundry-ironsworn copied to clipboard
Refactor + enhance oracle importers for v11
Depends on #715
The idea here is that dataforged imports should be able to happen without Dataforged living in memory at all times. This implements a method that takes a compendium pack ID and pops a JSON file import dialog. If it can parse that JSON as oracle data, it then proceeds to build the tables (with folders to represent oracle categories) and fill the compendium pack with them.
Note that this PR still loads Dataforged because other stuff (like the oracle tree) relies on it.
- extends
RollTables
withOracles
, mainly to serve as a container for a bunch of static methods:-
Oracles#find
: locates an OracleTable with an ID, UUID, or DFID -
Oracles#importFromDataforgedDialog
: described above - numerous methods used to apply data transforms and handle other import-related tasks
-
- add several new utility functions for manipulating packs (clearing their contents, purging empty folders, etc)
- enhances oracle data transforms so we can use more info from dataforged
- use icons where provided
- uses more verbose titles for e.g. folders
- when rendering an oracle path string for e.g. oracle roll messages, uses actual folder names instead of relying on the DFID string
- this makes oracle categories localizable via Babele compendium overrides