mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Changed miscellaneous to loot
This commit is contained in:
parent
e168cdfd11
commit
ac228dc6de
10 changed files with 20 additions and 21 deletions
|
|
@ -80,8 +80,8 @@ Hooks.once('init', () => {
|
|||
Items.registerSheet(SYSTEM.id, applications.sheets.items.Subclass, { types: ['subclass'], makeDefault: true });
|
||||
Items.registerSheet(SYSTEM.id, applications.sheets.items.Feature, { types: ['feature'], makeDefault: true });
|
||||
Items.registerSheet(SYSTEM.id, applications.sheets.items.DomainCard, { types: ['domainCard'], makeDefault: true });
|
||||
Items.registerSheet(SYSTEM.id, applications.sheets.items.Miscellaneous, {
|
||||
types: ['miscellaneous'],
|
||||
Items.registerSheet(SYSTEM.id, applications.sheets.items.Loot, {
|
||||
types: ['loot'],
|
||||
makeDefault: true
|
||||
});
|
||||
Items.registerSheet(SYSTEM.id, applications.sheets.items.Consumable, { types: ['consumable'], makeDefault: true });
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
},
|
||||
{
|
||||
handler: CharacterSheet.#getItemContextOptions,
|
||||
selector: '[data-item-uuid][data-type="consumable"], [data-item-uuid][data-type="miscellaneous"]',
|
||||
selector: '[data-item-uuid][data-type="consumable"], [data-item-uuid][data-type="loot"]',
|
||||
options: {
|
||||
parentClassHooks: false,
|
||||
fixed: true
|
||||
|
|
@ -325,7 +325,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the set of ContextMenu options for Consumable and Miscellaneous.
|
||||
* Get the set of ContextMenu options for Consumable and Loot.
|
||||
* @returns {import('@client/applications/ux/context-menu.mjs').ContextMenuEntry[]} - The Array of context options passed to the ContextMenu instance
|
||||
* @this {CharacterSheet}
|
||||
* @protected
|
||||
|
|
|
|||
|
|
@ -6,6 +6,6 @@ export { default as Community } from './community.mjs';
|
|||
export { default as Consumable } from './consumable.mjs';
|
||||
export { default as DomainCard } from './domainCard.mjs';
|
||||
export { default as Feature } from './feature.mjs';
|
||||
export { default as Miscellaneous } from './miscellaneous.mjs';
|
||||
export { default as Loot } from './loot.mjs';
|
||||
export { default as Subclass } from './subclass.mjs';
|
||||
export { default as Weapon } from './weapon.mjs';
|
||||
|
|
|
|||
|
|
@ -132,14 +132,14 @@ export default class ClassSheet extends DHBaseItemSheet {
|
|||
});
|
||||
}
|
||||
} else if (target.classList.contains('choice-a-section')) {
|
||||
if (item.type === 'miscellaneous' || item.type === 'consumable') {
|
||||
if (item.type === 'loot' || item.type === 'consumable') {
|
||||
const filteredChoiceA = this.document.system.inventory.choiceA;
|
||||
if (filteredChoiceA.length < 2)
|
||||
await this.document.update({
|
||||
'system.inventory.choiceA': [...filteredChoiceA.map(x => x.uuid), item.uuid]
|
||||
});
|
||||
}
|
||||
} else if (item.type === 'miscellaneous') {
|
||||
} else if (item.type === 'loot') {
|
||||
if (target.classList.contains('take-section')) {
|
||||
const filteredTake = this.document.system.inventory.take.filter(x => x);
|
||||
if (filteredTake.length < 3)
|
||||
|
|
|
|||
|
|
@ -1,15 +1,15 @@
|
|||
import DHBaseItemSheet from '../api/base-item.mjs';
|
||||
|
||||
export default class MiscellaneousSheet extends DHBaseItemSheet {
|
||||
export default class LootSheet extends DHBaseItemSheet {
|
||||
/**@inheritdoc */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['miscellaneous'],
|
||||
classes: ['loot'],
|
||||
position: { width: 550 }
|
||||
};
|
||||
|
||||
/**@override */
|
||||
static PARTS = {
|
||||
header: { template: 'systems/daggerheart/templates/sheets/items/miscellaneous/header.hbs' },
|
||||
header: { template: 'systems/daggerheart/templates/sheets/items/loot/header.hbs' },
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
|
||||
actions: {
|
||||
|
|
@ -17,7 +17,7 @@ export default class MiscellaneousSheet extends DHBaseItemSheet {
|
|||
scrollable: ['.actions']
|
||||
},
|
||||
settings: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/miscellaneous/settings.hbs',
|
||||
template: 'systems/daggerheart/templates/sheets/items/loot/settings.hbs',
|
||||
scrollable: ['.settings']
|
||||
},
|
||||
effects: {
|
||||
|
|
@ -1301,9 +1301,9 @@ export const featureTypes = {
|
|||
id: 'consumable',
|
||||
label: 'TYPES.Item.consumable'
|
||||
},
|
||||
miscellaneous: {
|
||||
id: 'miscellaneous',
|
||||
label: 'TYPES.Item.miscellaneous'
|
||||
loot: {
|
||||
id: 'loot',
|
||||
label: 'TYPES.Item.loot'
|
||||
},
|
||||
beastform: {
|
||||
if: 'beastform',
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import DHCommunity from './community.mjs';
|
|||
import DHConsumable from './consumable.mjs';
|
||||
import DHDomainCard from './domainCard.mjs';
|
||||
import DHFeature from './feature.mjs';
|
||||
import DHMiscellaneous from './miscellaneous.mjs';
|
||||
import DHLoot from './loot.mjs';
|
||||
import DHSubclass from './subclass.mjs';
|
||||
import DHWeapon from './weapon.mjs';
|
||||
import DHBeastform from './beastform.mjs';
|
||||
|
|
@ -20,7 +20,7 @@ export {
|
|||
DHConsumable,
|
||||
DHDomainCard,
|
||||
DHFeature,
|
||||
DHMiscellaneous,
|
||||
DHLoot,
|
||||
DHSubclass,
|
||||
DHWeapon,
|
||||
DHBeastform
|
||||
|
|
@ -35,7 +35,7 @@ export const config = {
|
|||
consumable: DHConsumable,
|
||||
domainCard: DHDomainCard,
|
||||
feature: DHFeature,
|
||||
miscellaneous: DHMiscellaneous,
|
||||
loot: DHLoot,
|
||||
subclass: DHSubclass,
|
||||
weapon: DHWeapon,
|
||||
beastform: DHBeastform
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import BaseDataItem from './base.mjs';
|
||||
import { ActionField } from '../fields/actionField.mjs';
|
||||
|
||||
export default class DHLoot extends BaseDataItem {
|
||||
/** @inheritDoc */
|
||||
|
|
|
|||
|
|
@ -61,9 +61,9 @@
|
|||
canCreate=true
|
||||
}}
|
||||
{{> 'daggerheart.inventory-items'
|
||||
title='TYPES.Item.miscellaneous'
|
||||
type='miscellaneous'
|
||||
collection=document.itemTypes.miscellaneous
|
||||
title='TYPES.Item.loot'
|
||||
type='loot'
|
||||
collection=document.itemTypes.loot
|
||||
isGlassy=true
|
||||
canCreate=true
|
||||
}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue