Removed action fields on Adversary/Environment in favor of using Feature Items

This commit is contained in:
WBHarry 2025-07-05 02:49:14 +02:00
parent 9d76405221
commit c3b8def6b1
23 changed files with 274 additions and 433 deletions

View file

@ -213,6 +213,7 @@
"Features": "Features",
"proficiency": "Proficiency",
"unarmored": "Unarmored",
"newFeature": "New Feature",
"Experience": {
"Single": "Experience",
"plural": "Experiences"

View file

@ -1,7 +1,3 @@
import DHActionConfig from './action-config.mjs';
import DHBaseItemSheet from '../sheets/api/base-item.mjs';
import { actionsTypes } from '../../data/action/_module.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export default class DHAdversarySettings extends HandlebarsApplicationMixin(ApplicationV2) {
@ -26,9 +22,9 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
actions: {
addExperience: this.#addExperience,
removeExperience: this.#removeExperience,
addAction: this.#addAction,
editAction: this.#editAction,
removeAction: this.#removeAction
addFeature: this.#addFeature,
editFeature: this.#editFeature,
removeFeature: this.#removeFeature
},
form: {
handler: this.updateForm,
@ -55,9 +51,9 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
id: 'experiences',
template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/experiences.hbs'
},
actions: {
id: 'actions',
template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/actions.hbs'
features: {
id: 'features',
template: 'systems/daggerheart/templates/sheets-settings/adversary-settings/features.hbs'
}
};
@ -86,13 +82,13 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
icon: null,
label: 'DAGGERHEART.General.tabs.experiences'
},
actions: {
features: {
active: false,
cssClass: '',
group: 'primary',
id: 'actions',
id: 'features',
icon: null,
label: 'DAGGERHEART.General.tabs.actions'
label: 'DAGGERHEART.General.tabs.features'
}
};
@ -130,46 +126,25 @@ export default class DHAdversarySettings extends HandlebarsApplicationMixin(Appl
this.render();
}
static async #addAction(_event, _button) {
const actionType = await DHBaseItemSheet.selectActionType();
if (!actionType) return;
try {
const cls = actionsTypes[actionType] ?? actionsTypes.attack,
action = new cls(
{
_id: foundry.utils.randomID(),
type: actionType,
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name),
...cls.getSourceConfig(this.actor)
},
{
parent: this.actor
}
);
await this.actor.update({ 'system.actions': [...this.actor.system.actions, action] });
await new DHActionConfig(this.actor.system.actions[this.actor.system.actions.length - 1]).render({
force: true
});
this.render();
} catch (error) {
console.log(error);
}
static async #addFeature(_, _button) {
await this.actor.createEmbeddedDocuments('Item', [
{
type: 'feature',
name: game.i18n.localize('DAGGERHEART.General.newFeature'),
img: 'icons/skills/melee/weapons-crossed-swords-black.webp'
}
]);
this.render();
}
static async #editAction(event, target) {
static async #editFeature(event, target) {
event.stopPropagation();
const actionIndex = target.dataset.index;
await new DHActionConfig(this.actor.system.actions[actionIndex]).render({
force: true
});
this.actor.items.get(target.id).sheet.render(true);
}
static async #removeAction(event, target) {
static async #removeFeature(event, target) {
event.stopPropagation();
const actionIndex = target.dataset.index;
await this.actor.update({
'system.actions': this.actor.system.actions.filter((_, index) => index !== Number.parseInt(actionIndex))
});
await this.actor.deleteEmbeddedDocuments('Item', [target.id]);
this.render();
}

View file

@ -1,7 +1,3 @@
import DHActionConfig from './action-config.mjs';
import DHBaseItemSheet from '../sheets/api/base-item.mjs';
import { actionsTypes } from '../../data/action/_module.mjs';
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(ApplicationV2) {
@ -25,9 +21,9 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap
},
position: { width: 455, height: 'auto' },
actions: {
addAction: this.#addAction,
editAction: this.#editAction,
removeAction: this.#removeAction,
addFeature: this.#addFeature,
editFeature: this.#editFeature,
removeFeature: this.#removeFeature,
addCategory: this.#addCategory,
deleteProperty: this.#deleteProperty,
viewAdversary: this.#viewAdversary,
@ -51,9 +47,9 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap
id: 'details',
template: 'systems/daggerheart/templates/sheets-settings/environment-settings/details.hbs'
},
actions: {
id: 'actions',
template: 'systems/daggerheart/templates/sheets-settings/environment-settings/actions.hbs'
features: {
id: 'features',
template: 'systems/daggerheart/templates/sheets-settings/environment-settings/features.hbs'
},
adversaries: {
id: 'adversaries',
@ -70,13 +66,13 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap
icon: null,
label: 'DAGGERHEART.General.tabs.details'
},
actions: {
features: {
active: false,
cssClass: '',
group: 'primary',
id: 'actions',
id: 'features',
icon: null,
label: 'DAGGERHEART.General.tabs.actions'
label: 'DAGGERHEART.General.tabs.features'
},
adversaries: {
active: false,
@ -122,46 +118,23 @@ export default class DHEnvironmentSettings extends HandlebarsApplicationMixin(Ap
return tabs;
}
static async #addAction(_event, _button) {
const actionType = await DHBaseItemSheet.selectActionType();
if (!actionType) return;
try {
const cls = actionsTypes[actionType] ?? actionsTypes.attack,
action = new cls(
{
_id: foundry.utils.randomID(),
type: actionType,
name: game.i18n.localize(CONFIG.DH.ACTIONS.actionTypes[actionType].name),
...cls.getSourceConfig(this.actor)
},
{
parent: this.actor
}
);
await this.actor.update({ 'system.actions': [...this.actor.system.actions, action] });
await new DHActionConfig(this.actor.system.actions[this.actor.system.actions.length - 1]).render({
force: true
});
this.render();
} catch (error) {
console.log(error);
}
static async #addFeature(_, _button) {
await this.actor.createEmbeddedDocuments('Item', [
{
type: 'feature',
name: game.i18n.localize('DAGGERHEART.General.newFeature'),
img: 'icons/magic/perception/orb-crystal-ball-scrying-blue.webp'
}
]);
this.render();
}
static async #editAction(event, target) {
event.stopPropagation();
const actionIndex = target.dataset.index;
await new DHActionConfig(this.actor.system.actions[actionIndex]).render({
force: true
});
static async #editFeature(_, target) {
this.actor.items.get(target.id).sheet.render(true);
}
static async #removeAction(event, target) {
event.stopPropagation();
const actionIndex = target.dataset.index;
await this.actor.update({
'system.actions': this.actor.system.actions.filter((_, index) => index !== Number.parseInt(actionIndex))
});
static async #removeFeature(_, target) {
await this.actor.deleteEmbeddedDocuments('Item', [target.id]);
this.render();
}

View file

@ -29,19 +29,19 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
static PARTS = {
sidebar: { template: 'systems/daggerheart/templates/sheets/actors/adversary/sidebar.hbs' },
header: { template: 'systems/daggerheart/templates/sheets/actors/adversary/header.hbs' },
actions: { template: 'systems/daggerheart/templates/sheets/actors/adversary/actions.hbs' },
features: { template: 'systems/daggerheart/templates/sheets/actors/adversary/features.hbs' },
notes: { template: 'systems/daggerheart/templates/sheets/actors/adversary/notes.hbs' },
effects: { template: 'systems/daggerheart/templates/sheets/actors/adversary/effects.hbs' }
};
static TABS = {
actions: {
features: {
active: true,
cssClass: '',
group: 'primary',
id: 'actions',
id: 'features',
icon: null,
label: 'DAGGERHEART.General.tabs.actions'
label: 'DAGGERHEART.General.tabs.features'
},
notes: {
active: false,
@ -71,9 +71,9 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
return context;
}
getAction(element) {
getItem(element) {
const itemId = (element.target ?? element).closest('[data-item-id]').dataset.itemId,
item = this.document.system.actions.find(x => x.id === itemId);
item = this.document.items.get(itemId);
return item;
}
@ -108,7 +108,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
}
static async useItem(event) {
const action = this.getAction(event) ?? this.actor.system.attack;
const action = this.getItem(event) ?? this.actor.system.attack;
action.use(event);
}
@ -134,7 +134,7 @@ export default class AdversarySheet extends DaggerheartSheet(ActorSheetV2) {
cls.create(msg.toObject());
} else {
const item = this.getAction(event) ?? this.document.system.attack;
const item = this.getItem(event) ?? this.document.system.attack;
item.toChat(this.document.id);
}
}

View file

@ -26,7 +26,7 @@ export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
static PARTS = {
header: { template: 'systems/daggerheart/templates/sheets/actors/environment/header.hbs' },
actions: { template: 'systems/daggerheart/templates/sheets/actors/environment/actions.hbs' },
features: { template: 'systems/daggerheart/templates/sheets/actors/environment/features.hbs' },
potentialAdversaries: {
template: 'systems/daggerheart/templates/sheets/actors/environment/potentialAdversaries.hbs'
},
@ -34,13 +34,13 @@ export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
};
static TABS = {
actions: {
features: {
active: true,
cssClass: '',
group: 'primary',
id: 'actions',
id: 'features',
icon: null,
label: 'DAGGERHEART.General.tabs.actions'
label: 'DAGGERHEART.General.tabs.features'
},
potentialAdversaries: {
active: false,
@ -69,9 +69,9 @@ export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
return context;
}
getAction(element) {
getItem(element) {
const itemId = (element.target ?? element).closest('[data-item-id]').dataset.itemId,
item = this.document.system.actions.find(x => x.id === itemId);
item = this.document.items.get(itemId);
return item;
}
@ -114,7 +114,7 @@ export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
}
static async useItem(event, button) {
const action = this.getAction(event);
const action = this.getItem(event);
if (!action) {
await this.viewAdversary(event, button);
} else {
@ -123,7 +123,7 @@ export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
}
static async toChat(event) {
const item = this.getAction(event);
const item = this.getItem(event);
item.toChat(this.document.id);
}

View file

@ -43,7 +43,6 @@ export default class DhpAdversary extends BaseDataActor {
hitPoints: resourceField(),
stress: resourceField()
}),
actions: new fields.ArrayField(new ActionField()),
attack: new ActionField({
initial: {
name: 'Attack',
@ -86,4 +85,8 @@ export default class DhpAdversary extends BaseDataActor {
get attackBonus() {
return this.attack.roll.bonus;
}
get features() {
return this.parent.items.filter(x => x.type === 'feature');
}
}

View file

@ -97,7 +97,6 @@ export default class DhCharacter extends BaseDataActor {
value: new ForeignDocumentUUIDField({ type: 'Item', nullable: true }),
subclass: new ForeignDocumentUUIDField({ type: 'Item', nullable: true })
}),
actions: new fields.ArrayField(new ActionField()),
levelData: new fields.EmbeddedDataField(DhLevelData),
bonuses: new fields.SchemaField({
armorScore: new fields.NumberField({ integer: true, initial: 0 }),

View file

@ -30,8 +30,11 @@ export default class DhEnvironment extends BaseDataActor {
adversaries: new ForeignDocumentUUIDArrayField({ type: 'Actor' })
})
),
actions: new fields.ArrayField(new ActionField()),
notes: new fields.HTMLField()
};
}
get features() {
return this.parent.items.filter(x => x.type === 'feature');
}
}

View file

@ -143,7 +143,6 @@ export default class D20Roll extends DHRoll {
: config.roll.advantage == this.ADV_MODE.DISADVANTAGE
? false
: null;
setDiceSoNiceForDualityRoll(roll, advantageState);
this.postEvaluate(roll, config);
}

View file

@ -4884,122 +4884,78 @@ body.theme-light.application.environment {
.application.daggerheart.dh-style.dialog .tab.experiences .experience-list .experience-item a {
text-align: center;
}
.application.daggerheart.dh-style.dialog .tab.actions {
.application.daggerheart.dh-style.dialog .tab.features {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(#18162e, #f3c267) transparent;
}
.application.daggerheart.dh-style.dialog .tab.actions .add-action-btn {
.application.daggerheart.dh-style.dialog .tab.features .add-feature-btn {
width: 100%;
margin-bottom: 12px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list {
.application.daggerheart.dh-style.dialog .tab.features .feature-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item {
.application.daggerheart.dh-style.dialog .tab.features .feature-list .feature-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
border-radius: 3px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item img {
.application.daggerheart.dh-style.dialog .tab.features .feature-list .feature-item img {
height: 40px;
width: 40px;
object-fit: cover;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label {
.application.daggerheart.dh-style.dialog .tab.features .feature-list .feature-item .label {
font-family: 'Montserrat', sans-serif;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags {
display: flex;
gap: 10px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags .tag {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 3px 5px;
font-size: 12px;
background: light-dark(#22222215, #efe6d815);
border: 1px solid light-dark(#222, #efe6d8);
border-radius: 3px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .label .tags .label {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 12px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .controls {
.application.daggerheart.dh-style.dialog .tab.features .feature-list .feature-item .controls {
display: flex;
gap: 5px;
}
.application.daggerheart.dh-style.dialog .tab.actions .action-list .action-item .controls a {
.application.daggerheart.dh-style.dialog .tab.features .feature-list .feature-item .controls a {
text-align: center;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(#18162e, #f3c267) transparent;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .add-action-btn {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .add-feature-btn {
width: 100%;
margin-bottom: 12px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list {
display: flex;
flex-direction: column;
gap: 10px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list .feature-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item img {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list .feature-item img {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 3px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list .feature-item .label {
font-family: 'Montserrat', sans-serif;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags {
display: flex;
gap: 10px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags .tag {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 3px 5px;
font-size: 12px;
background: light-dark(#22222215, #efe6d815);
border: 1px solid light-dark(#222, #efe6d8);
border-radius: 3px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .label .tags .label {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 12px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .controls {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list .feature-item .controls {
display: flex;
gap: 5px;
}
.application.daggerheart.dh-style.dialog.environment-settings .tab.actions .action-list .action-item .controls a {
.application.daggerheart.dh-style.dialog.environment-settings .tab.features .feature-list .feature-item .controls a {
text-align: center;
}
.application.daggerheart.dh-style.dialog .tab.adversaries {

View file

@ -35,9 +35,9 @@
@import './less/applications/header.less';
@import './less/applications/adversary-settings/sheet.less';
@import './less/applications/adversary-settings/experiences.less';
@import './less/applications/adversary-settings/actions.less';
@import './less/applications/adversary-settings/features.less';
@import './less/applications/environment-settings/actions.less';
@import './less/applications/environment-settings/features.less';
@import './less/applications/environment-settings/adversaries.less';
@import './less/applications//beastform.less';

View file

@ -2,8 +2,8 @@
@import '../../utils/fonts.less';
.application.sheet.daggerheart.actor.dh-style.adversary {
.tab.actions {
.action-section {
.tab.features {
.feature-section {
display: flex;
flex-direction: column;
gap: 10px;

View file

@ -1,74 +0,0 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.daggerheart.dh-style.dialog {
.tab.actions {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
.add-action-btn {
width: 100%;
margin-bottom: 12px;
}
.action-list {
display: flex;
flex-direction: column;
gap: 10px;
.action-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
border-radius: 3px;
img {
height: 40px;
width: 40px;
object-fit: cover;
}
.label {
font-family: @font-body;
.tags {
display: flex;
gap: 10px;
.tag {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 3px 5px;
font-size: 12px;
background: light-dark(@dark-15, @beige-15);
border: 1px solid light-dark(@dark, @beige);
border-radius: 3px;
}
.label {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 12px;
}
}
}
.controls {
display: flex;
gap: 5px;
a {
text-align: center;
}
}
}
}
}
}

View file

@ -0,0 +1,48 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.daggerheart.dh-style.dialog {
.tab.features {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
.add-feature-btn {
width: 100%;
margin-bottom: 12px;
}
.feature-list {
display: flex;
flex-direction: column;
gap: 10px;
.feature-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
border-radius: 3px;
img {
height: 40px;
width: 40px;
object-fit: cover;
}
.label {
font-family: @font-body;
}
.controls {
display: flex;
gap: 5px;
a {
text-align: center;
}
}
}
}
}
}

View file

@ -1,74 +0,0 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.daggerheart.dh-style.dialog.environment-settings {
.tab.actions {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
.add-action-btn {
width: 100%;
margin-bottom: 12px;
}
.action-list {
display: flex;
flex-direction: column;
gap: 10px;
.action-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
img {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 3px;
}
.label {
font-family: @font-body;
.tags {
display: flex;
gap: 10px;
.tag {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 3px 5px;
font-size: 12px;
background: light-dark(@dark-15, @beige-15);
border: 1px solid light-dark(@dark, @beige);
border-radius: 3px;
}
.label {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
font-size: 12px;
}
}
}
.controls {
display: flex;
gap: 5px;
a {
text-align: center;
}
}
}
}
}
}

View file

@ -0,0 +1,48 @@
@import '../../utils/colors.less';
@import '../../utils/fonts.less';
.application.daggerheart.dh-style.dialog.environment-settings {
.tab.features {
max-height: 450px;
overflow-y: auto;
scrollbar-width: thin;
scrollbar-color: light-dark(@dark-blue, @golden) transparent;
.add-feature-btn {
width: 100%;
margin-bottom: 12px;
}
.feature-list {
display: flex;
flex-direction: column;
gap: 10px;
.feature-item {
display: grid;
grid-template-columns: 40px 1fr auto;
align-items: center;
gap: 5px;
img {
height: 40px;
width: 40px;
object-fit: cover;
border-radius: 3px;
}
.label {
font-family: @font-body;
}
.controls {
display: flex;
gap: 5px;
a {
text-align: center;
}
}
}
}
}
}

View file

@ -1,34 +0,0 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<button class="add-action-btn" data-action="addAction">
New Action
</button>
<fieldset>
<legend>{{localize tabs.actions.label}}</legend>
<ul class="action-list">
{{#each document.system.actions as |action index|}}
<li class="action-item">
<img src="{{action.img}}" alt="">
<div class="label">
<span>{{action.name}}</span>
<div class="tags">
<div class="tag">
{{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}}
</div>
</div>
</div>
<div class="controls">
<a data-action="editAction" data-index="{{index}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="removeAction" data-index="{{index}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.delete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</fieldset>
</section>

View file

@ -0,0 +1,26 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<button class="add-feature-btn" data-action="addFeature">
{{localize "DAGGERHEART.General.newFeature"}}
</button>
<fieldset>
<legend>{{localize tabs.features.label}}</legend>
<ul class="feature-list">
{{#each document.system.features as |feature|}}
<li class="feature-item">
<img src="{{feature.img}}" alt="">
<div class="label">
<span>{{feature.name}}</span>
</div>
<div class="controls">
<a data-action="editFeature" id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="removeFeature" id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.delete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</fieldset>
</section>

View file

@ -1,34 +0,0 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<button class="add-action-btn" data-action="addAction">
New Action
</button>
<fieldset>
<legend>{{localize tabs.actions.label}}</legend>
<ul class="action-list">
{{#each document.system.actions as |action index|}}
<li class="action-item">
<img src="{{action.img}}" alt="">
<div class="label">
<span>{{action.name}}</span>
<div class="tags">
<div class="tag">
{{localize (concat 'DAGGERHEART.Actions.Types.' action.type '.name')}}
</div>
<div class="tag">
{{localize (concat 'DAGGERHEART.ActionType.' action.actionType)}}
</div>
</div>
</div>
<div class="controls">
<a data-action="editAction" data-index="{{index}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="removeAction" data-index="{{index}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.delete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</fieldset>
</section>

View file

@ -0,0 +1,26 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<button class="add-feature-btn" data-action="addFeature">
{{localize "DAGGERHEART.General.newFeature"}}
</button>
<fieldset>
<legend>{{localize tabs.features.label}}</legend>
<ul class="feature-list">
{{#each document.system.features as |feature|}}
<li class="feature-item">
<img src="{{feature.img}}" alt="">
<div class="label">
<span>{{feature.name}}</span>
</div>
<div class="controls">
<a data-action="editFeature" id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.edit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
<a data-action="removeFeature" id="{{feature.id}}" data-tooltip="{{localize 'DAGGERHEART.Tooltip.delete'}}"><i class="fa-solid fa-trash"></i></a>
</div>
</li>
{{/each}}
</ul>
</fieldset>
</section>

View file

@ -1,11 +0,0 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
>
<div class="action-section">
{{#if document.system.actions}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.actions.label) type='action'}}
{{/if}}
</div>
</section>

View file

@ -0,0 +1,11 @@
<section
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<div class="feature-section">
{{#if document.system.features}}
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.features.label) type='feature'}}
{{/if}}
</div>
</section>

View file

@ -1,9 +1,9 @@
<section
class='tab {{tabs.actions.cssClass}} {{tabs.actions.id}}'
data-tab='{{tabs.actions.id}}'
data-group='{{tabs.actions.group}}'
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
data-tab='{{tabs.features.id}}'
data-group='{{tabs.features.group}}'
>
<div class="action-section">
<div class="feature-section">
{{> 'systems/daggerheart/templates/sheets/global/partials/inventory-fieldset-items.hbs' title=(localize tabs.actions.label) type='action'}}
</div>
</section>