mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Compare commits
No commits in common. "d0c29ede56b9834c4a71ac58656524b1996b724f" and "c8d0df87c8a59c3261a49742cd533e719c49fcad" have entirely different histories.
d0c29ede56
...
c8d0df87c8
8 changed files with 40 additions and 69 deletions
|
|
@ -446,33 +446,3 @@ Hooks.on('canvasTearDown', canvas => {
|
|||
Hooks.on('canvasReady', canas => {
|
||||
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();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -47,6 +47,11 @@ export default class Party extends DHBaseActorSheet {
|
|||
template: 'systems/daggerheart/templates/sheets/actors/party/party-members.hbs',
|
||||
scrollable: ['']
|
||||
},
|
||||
/* NOT YET IMPLEMENTED */
|
||||
// projects: {
|
||||
// template: 'systems/daggerheart/templates/sheets/actors/party/projects.hbs',
|
||||
// scrollable: ['']
|
||||
// },
|
||||
inventory: {
|
||||
template: 'systems/daggerheart/templates/sheets/actors/party/inventory.hbs',
|
||||
scrollable: ['.tab.inventory .items-section']
|
||||
|
|
@ -57,13 +62,19 @@ export default class Party extends DHBaseActorSheet {
|
|||
/** @inheritdoc */
|
||||
static TABS = {
|
||||
primary: {
|
||||
tabs: [{ id: 'partyMembers' }, { id: 'inventory' }, { id: 'notes' }],
|
||||
tabs: [
|
||||
{ id: 'partyMembers' },
|
||||
/* NOT YET IMPLEMENTED */
|
||||
// { id: 'projects' },
|
||||
{ id: 'inventory' },
|
||||
{ id: 'notes' }
|
||||
],
|
||||
initial: 'partyMembers',
|
||||
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'];
|
||||
|
||||
async _onRender(context, options) {
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
type: combatant.actor?.system?.type,
|
||||
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(
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -82,7 +82,6 @@ export default class DHItem extends foundry.documents.Item {
|
|||
/** @inheritdoc */
|
||||
static async createDialog(data = {}, createOptions = {}, options = {}) {
|
||||
const { folders, types, template, context = {}, ...dialogOptions } = options;
|
||||
dialogOptions.classes = [options.classes ?? [], 'item-create'].flat(); // handled in hook
|
||||
|
||||
if (types?.length === 0) {
|
||||
throw new Error('The array of sub-types to restrict to must not be empty.');
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
.portrait {
|
||||
cursor: pointer;
|
||||
max-width: 275px;
|
||||
width: 275px;
|
||||
|
||||
img {
|
||||
height: 275px;
|
||||
|
|
|
|||
|
|
@ -31,12 +31,10 @@
|
|||
<span class="description">
|
||||
<i>{{{description}}}</i>
|
||||
</span>
|
||||
{{#if source.system.motives}}
|
||||
<div class="motives-and-tactics">
|
||||
<b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motives.label'}}: </b>
|
||||
{{source.system.motives}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -42,7 +42,7 @@
|
|||
{{#if member.difficulty includeZero=true}}
|
||||
<div class="evasion" data-tooltip="DAGGERHEART.GENERAL.difficulty">{{member.difficulty}}</div>
|
||||
{{/if}}
|
||||
{{#unless (or (eq member.type 'companion') (eq member.type 'npc'))}}
|
||||
{{#unless (eq member.type 'companion')}}
|
||||
<div class="threshold-section">
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.ACTORS.Party.Thresholds.minor"}}</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>
|
||||
</h2>
|
||||
<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">
|
||||
<h4>{{localize "DAGGERHEART.GENERAL.hope"}}</h4>
|
||||
{{#times member.resources.hope.max}}
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
</header>
|
||||
<section class="body">
|
||||
<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-label" data-tooltip="DAGGERHEART.GENERAL.HitPoints.plural">
|
||||
<span class="label">
|
||||
|
|
@ -101,7 +101,6 @@
|
|||
</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#unless (eq member.type 'npc')}}
|
||||
<div class="slot-section">
|
||||
<div class="slot-label" data-tooltip="DAGGERHEART.GENERAL.stress">
|
||||
<span class="label">
|
||||
|
|
@ -121,7 +120,6 @@
|
|||
{{/times}}
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
{{#if member.armorScore.max}}
|
||||
<div class="slot-section">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue