-
Notifications
You must be signed in to change notification settings - Fork 8
/
ItemConfigApi.ts
31 lines (30 loc) · 951 Bytes
/
ItemConfigApi.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import type { EquipmentTypeGroup } from 'src/api/api.types';
import { ItemSheetRuntime } from 'src/runtime/item/ItemSheetRuntime';
/**
* APIs related to the configuration of items.
*/
export class ItemConfigApi {
/**
* Registers a custom group of equipment types, to be rendered on the item sheet as their own section of options within the Equipment Type input.
*
* @param group the group to add
*
* @example Registering custom helmets
* ```js
* Hooks.once('tidy5e-sheet.ready', (api) => {
* api.config.item.registerCustomEquipmentTypeGroup({
* label: 'Helmet',
* types: {
* clothhat: 'Clothings Helmet',
* lighthat: 'Light Helmet',
* mediumhat: 'Medium Helmet',
* heavyhat: 'Heavy Helmet',
* },
* });
* });
* ```
*/
registerCustomEquipmentTypeGroup(group: EquipmentTypeGroup) {
ItemSheetRuntime.registerCustomEquipmentTypeGroup(group);
}
}