Compare commits

..

No commits in common. "d0c29ede56b9834c4a71ac58656524b1996b724f" and "c8d0df87c8a59c3261a49742cd533e719c49fcad" have entirely different histories.

8 changed files with 40 additions and 69 deletions

View file

@ -446,33 +446,3 @@ Hooks.on('canvasTearDown', canvas => {
Hooks.on('canvasReady', canas => { Hooks.on('canvasReady', canas => {
game.system.registeredTriggers.registerSceneTriggers(canvas.scene); game.system.registeredTriggers.registerSceneTriggers(canvas.scene);
}); });
/** Make the user to select a document type, instead of having a default doc type for them to accidentally keep */
Hooks.on('renderDialogV2', (_dialog, html) => {
if (!html.classList.contains('dialog')) return;
const cls = html.classList.contains('item-create')
? documents.DHItem.implementation
: html.classList.contains('actor-create')
? documents.DhpActor.implementation
: null;
if (!cls) return;
const form = html.querySelector('form');
const submit = html.querySelector('button[type=submit]');
const select = html.querySelector('select[name=type]');
const nameInput = html.querySelector('input[name=name]');
if (!form || !select || !submit || !nameInput) return;
nameInput.placeholder = cls.defaultName({});
const emptyOption = document.createElement('option');
emptyOption.value = '';
emptyOption.selected = true;
select.required = true;
select.prepend(emptyOption);
submit.addEventListener('click', event => {
if (!form.reportValidity()) {
event.preventDefault();
event.stopPropagation();
}
});
});

View file

@ -47,6 +47,11 @@ export default class Party extends DHBaseActorSheet {
template: 'systems/daggerheart/templates/sheets/actors/party/party-members.hbs', template: 'systems/daggerheart/templates/sheets/actors/party/party-members.hbs',
scrollable: [''] scrollable: ['']
}, },
/* NOT YET IMPLEMENTED */
// projects: {
// template: 'systems/daggerheart/templates/sheets/actors/party/projects.hbs',
// scrollable: ['']
// },
inventory: { inventory: {
template: 'systems/daggerheart/templates/sheets/actors/party/inventory.hbs', template: 'systems/daggerheart/templates/sheets/actors/party/inventory.hbs',
scrollable: ['.tab.inventory .items-section'] scrollable: ['.tab.inventory .items-section']
@ -57,13 +62,19 @@ export default class Party extends DHBaseActorSheet {
/** @inheritdoc */ /** @inheritdoc */
static TABS = { static TABS = {
primary: { primary: {
tabs: [{ id: 'partyMembers' }, { id: 'inventory' }, { id: 'notes' }], tabs: [
{ id: 'partyMembers' },
/* NOT YET IMPLEMENTED */
// { id: 'projects' },
{ id: 'inventory' },
{ id: 'notes' }
],
initial: 'partyMembers', initial: 'partyMembers',
labelPrefix: 'DAGGERHEART.GENERAL.Tabs' labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
} }
}; };
static ALLOWED_ACTOR_TYPES = ['character', 'companion', 'adversary', 'npc']; static ALLOWED_ACTOR_TYPES = ['character', 'companion', 'adversary'];
static DICE_ROLL_ACTOR_TYPES = ['character']; static DICE_ROLL_ACTOR_TYPES = ['character'];
async _onRender(context, options) { async _onRender(context, options) {

View file

@ -133,7 +133,7 @@ export default class DhCombatTracker extends foundry.applications.sidebar.tabs.C
canPing: combatant.sceneId === canvas.scene?.id && game.user.hasPermission('PING_CANVAS'), canPing: combatant.sceneId === canvas.scene?.id && game.user.hasPermission('PING_CANVAS'),
type: combatant.actor?.system?.type, type: combatant.actor?.system?.type,
img: await this._getCombatantThumbnail(combatant), img: await this._getCombatantThumbnail(combatant),
disposition: combatant.token?.disposition disposition: combatant.token.disposition
}; };
turn.css = [turn.active ? 'active' : null, hidden ? 'hide' : null, isDefeated ? 'defeated' : null].filterJoin( turn.css = [turn.active ? 'active' : null, hidden ? 'hide' : null, isDefeated ? 'defeated' : null].filterJoin(

View file

@ -65,11 +65,6 @@ export default class DhpActor extends Actor {
}; };
} }
static createDialog(data, createOptions, options, renderOptions) {
options.classes = [options.classes ?? [], 'actor-create'].flat(); // handled in hook
return super.createDialog(data, createOptions, options, renderOptions);
}
/* -------------------------------------------- */ /* -------------------------------------------- */
/** @inheritDoc */ /** @inheritDoc */

View file

@ -82,7 +82,6 @@ export default class DHItem extends foundry.documents.Item {
/** @inheritdoc */ /** @inheritdoc */
static async createDialog(data = {}, createOptions = {}, options = {}) { static async createDialog(data = {}, createOptions = {}, options = {}) {
const { folders, types, template, context = {}, ...dialogOptions } = options; const { folders, types, template, context = {}, ...dialogOptions } = options;
dialogOptions.classes = [options.classes ?? [], 'item-create'].flat(); // handled in hook
if (types?.length === 0) { if (types?.length === 0) {
throw new Error('The array of sub-types to restrict to must not be empty.'); throw new Error('The array of sub-types to restrict to must not be empty.');

View file

@ -5,7 +5,7 @@
.portrait { .portrait {
cursor: pointer; cursor: pointer;
max-width: 275px; width: 275px;
img { img {
height: 275px; height: 275px;

View file

@ -31,12 +31,10 @@
<span class="description"> <span class="description">
<i>{{{description}}}</i> <i>{{{description}}}</i>
</span> </span>
{{#if source.system.motives}}
<div class="motives-and-tactics"> <div class="motives-and-tactics">
<b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motives.label'}}: </b> <b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motives.label'}}: </b>
{{source.system.motives}} {{source.system.motives}}
</div> </div>
{{/if}}
</div> </div>
</div> </div>
</header> </header>

View file

@ -42,7 +42,7 @@
{{#if member.difficulty includeZero=true}} {{#if member.difficulty includeZero=true}}
<div class="evasion" data-tooltip="DAGGERHEART.GENERAL.difficulty">{{member.difficulty}}</div> <div class="evasion" data-tooltip="DAGGERHEART.GENERAL.difficulty">{{member.difficulty}}</div>
{{/if}} {{/if}}
{{#unless (or (eq member.type 'companion') (eq member.type 'npc'))}} {{#unless (eq member.type 'companion')}}
<div class="threshold-section"> <div class="threshold-section">
<h4 class="threshold-label">{{localize "DAGGERHEART.ACTORS.Party.Thresholds.minor"}}</h4> <h4 class="threshold-label">{{localize "DAGGERHEART.ACTORS.Party.Thresholds.minor"}}</h4>
<h4 class="threshold-value">{{member.damageThresholds.major}}</h4> <h4 class="threshold-value">{{member.damageThresholds.major}}</h4>
@ -58,7 +58,7 @@
<a class="delete-icon" data-action="deletePartyMember" data-uuid="{{member.uuid}}"><i class="fa-regular fa-times" inert></i></a> <a class="delete-icon" data-action="deletePartyMember" data-uuid="{{member.uuid}}"><i class="fa-regular fa-times" inert></i></a>
</h2> </h2>
<div> <div>
{{#unless (or (eq member.type 'companion') (eq member.type 'adversary') (eq member.type 'npc')) }} {{#unless (or (eq member.type 'companion') (eq member.type 'adversary')) }}
<div class="hope-section"> <div class="hope-section">
<h4>{{localize "DAGGERHEART.GENERAL.hope"}}</h4> <h4>{{localize "DAGGERHEART.GENERAL.hope"}}</h4>
{{#times member.resources.hope.max}} {{#times member.resources.hope.max}}
@ -79,7 +79,7 @@
</header> </header>
<section class="body"> <section class="body">
<section class="resources"> <section class="resources">
{{#unless (or (eq member.type 'companion') (eq member.type 'npc')) }} {{#unless (eq member.type 'companion') }}
<div class="slot-section"> <div class="slot-section">
<div class="slot-label" data-tooltip="DAGGERHEART.GENERAL.HitPoints.plural"> <div class="slot-label" data-tooltip="DAGGERHEART.GENERAL.HitPoints.plural">
<span class="label"> <span class="label">
@ -101,7 +101,6 @@
</div> </div>
{{/unless}} {{/unless}}
{{#unless (eq member.type 'npc')}}
<div class="slot-section"> <div class="slot-section">
<div class="slot-label" data-tooltip="DAGGERHEART.GENERAL.stress"> <div class="slot-label" data-tooltip="DAGGERHEART.GENERAL.stress">
<span class="label"> <span class="label">
@ -121,7 +120,6 @@
{{/times}} {{/times}}
</div> </div>
</div> </div>
{{/unless}}
{{#if member.armorScore.max}} {{#if member.armorScore.max}}
<div class="slot-section"> <div class="slot-section">