mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-05 20:34:15 +02:00
Compare commits
2 commits
d3141059ac
...
53f15a7fde
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
53f15a7fde | ||
|
|
c23ac61ee5 |
33 changed files with 551 additions and 36 deletions
1
assets/icons/documents/actors/drama-masks.svg
Normal file
1
assets/icons/documents/actors/drama-masks.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 512px; width: 512px;"><path d="M0 0h512v512H0z" fill="#000" fill-opacity="1"></path><g class="" transform="translate(0,0)" style=""><path d="M418.813 30.625c-21.178 26.27-49.712 50.982-84.125 70.844-36.778 21.225-75.064 33.62-110.313 38.06a310.317 310.317 0 0 0 6.813 18.25c16.01.277 29.366-.434 36.406-1.5l9.47-1.53 8.436-1.28.22 10.186a307.48 307.48 0 0 1-1.095 18.72l56.625 8.843c.86-.095 1.713-.15 2.563-.157 11.188-.114 21.44 7.29 24.468 18.593.657 2.448.922 4.903.845 7.313 5.972-2.075 11.753-4.305 17.28-6.72l9.595-4.188 2.313 10.22a340.211 340.211 0 0 1 7.375 48.062C438.29 247.836 468.438 225.71 493 197.5c-3.22-36.73-16.154-78.04-39.125-117.813a290.509 290.509 0 0 0-2.22-3.78l-27.56 71.374c5.154.762 10.123 3.158 14.092 7.126 9.81 9.807 9.813 25.69 0 35.5-9.812 9.81-25.722 9.807-35.53 0-8.86-8.858-9.69-22.68-2.532-32.5l38.938-100.844a322.02 322.02 0 0 0-20.25-25.937zM51.842 118.72c-8.46 17.373-15.76 36.198-21.187 56.436-14.108 52.617-13.96 103.682-2.812 143.438 13.3-2.605 26.442-3.96 39.312-4.03 1.855-.012 3.688.02 5.53.06 20.857.48 40.98 4.332 59.97 11.5a355.064 355.064 0 0 1-1.656-34.218c0-27.8 3.135-54.377 9-78.937l2.47-10.407 9.655 4.562c29.467 13.98 66.194 23.424 106.28 25.22 5.136-20.05 8.19-39.78 9.408-58.75-35.198 4.83-75.387 2.766-116.407-8.22-38.363-10.272-72.314-26.78-99.562-46.656zm230.594 82.218c-1.535 10.452-3.615 21.03-6.218 31.687a312.754 312.754 0 0 0 46-3.97 24.98 24.98 0 0 1-1.532-21.748l-38.25-5.97zM105 201.375l4.156 18.22-21.594 4.905c8.75 5.174 13.353 15.703 10.594 26-3.32 12.394-16.045 19.758-28.437 16.438-12.394-3.32-19.76-16.075-16.44-28.47a23.235 23.235 0 0 1 3.126-6.874l-21.062 4.78-4.125-18.218 73.78-16.78zm388.594 22.813c-25.53 25.46-55.306 45.445-86.906 60.5.05 2.397.093 4.8.093 7.218 0 9.188-.354 18.232-1.03 27.125 16.635 1.33 32.045-1.7 45.344-9.374 25.925-14.962 40.608-45.694 42.5-85.47zm-338.844 3c-4.03 19.993-6.33 41.31-6.406 63.593l.125-.342c30.568 10.174 62.622 17.572 95.25 21.375l7.5.875.718 7.5 5.687 60.125-18.625 1.75-2.53-26.75a23.117 23.117 0 0 1-14.845.968c-12.393-3.32-19.76-16.042-16.438-28.436.285-1.06.647-2.08 1.063-3.063a496.627 496.627 0 0 1-57.406-14.53c2.69 49.62 16.154 94.04 36.094 126.656 22.366 36.588 52.13 57.78 83.968 57.78 31.838.003 61.602-21.19 83.97-57.78 19.536-31.96 32.846-75.244 35.905-123.656a499.132 499.132 0 0 1-48.25 11.656c1.914 4.57 2.415 9.78 1.033 14.938-3.322 12.394-16.045 19.758-28.438 16.437a23.01 23.01 0 0 1-2.125-.686l-2.5 26.47-18.594-1.752 5.688-60.125.72-7.5 7.498-.875c29.245-3.407 57.995-9.717 85.657-18.312v-1.594c0-21.573-2.27-42.23-6.064-61.75C351.132 242.653 313.092 250 272.312 250c-43.59 0-83.986-8.658-117.562-22.813zm-87.5 105.968c-10.87.102-21.995 1.22-33.375 3.313 12.695 31.62 33.117 53.07 59 60 16.9 4.523 34.896 2.536 52.813-5.25-4.382-13.89-7.874-28.606-10.344-43.97-21.115-9.623-43.934-14.32-68.094-14.094zm137.5 80.22h130.813c-40.082 44.594-92.623 42.844-130.813 0z" fill="#fff" fill-opacity="1"></path></g></svg>
|
||||
|
After Width: | Height: | Size: 3 KiB |
|
|
@ -196,6 +196,11 @@ Hooks.once('init', () => {
|
|||
makeDefault: true,
|
||||
label: sheetLabel('TYPES.Actor.environment')
|
||||
});
|
||||
Actors.registerSheet(SYSTEM.id, applications.sheets.actors.NPC, {
|
||||
types: ['npc'],
|
||||
makeDefault: true,
|
||||
label: sheetLabel('TYPES.Actor.npc')
|
||||
});
|
||||
Actors.registerSheet(SYSTEM.id, applications.sheets.actors.Party, {
|
||||
types: ['party'],
|
||||
makeDefault: true,
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
"companion": "Companion",
|
||||
"adversary": "Adversary",
|
||||
"environment": "Environment",
|
||||
"npc": "NPC",
|
||||
"party": "Party"
|
||||
}
|
||||
},
|
||||
|
|
@ -333,6 +334,11 @@
|
|||
},
|
||||
"newAdversary": "New Adversary"
|
||||
},
|
||||
"NPC": {
|
||||
"FIELDS": {
|
||||
"motives": { "label": "Motives" }
|
||||
}
|
||||
},
|
||||
"Party": {
|
||||
"Subtitle": {
|
||||
"character": "{community} {ancestry} | {subclass} {class}",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ export { default as ActionConfig } from './action-config.mjs';
|
|||
export { default as ActionSettingsConfig } from './action-settings-config.mjs';
|
||||
export { default as CharacterSettings } from './character-settings.mjs';
|
||||
export { default as AdversarySettings } from './adversary-settings.mjs';
|
||||
export { default as NPCSettings } from './npc-settings.mjs';
|
||||
export { default as CompanionSettings } from './companion-settings.mjs';
|
||||
export { default as SettingFeatureConfig } from './setting-feature-config.mjs';
|
||||
export { default as EnvironmentSettings } from './environment-settings.mjs';
|
||||
|
|
|
|||
85
module/applications/sheets-configs/npc-settings.mjs
Normal file
85
module/applications/sheets-configs/npc-settings.mjs
Normal file
|
|
@ -0,0 +1,85 @@
|
|||
import DHBaseActorSettings from '../sheets/api/actor-setting.mjs';
|
||||
|
||||
/**@typedef {import('@client/applications/_types.mjs').ApplicationClickAction} ApplicationClickAction */
|
||||
|
||||
export default class DHNPCSettings extends DHBaseActorSettings {
|
||||
/**@inheritdoc */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['npc-settings'],
|
||||
position: { width: 455, height: 'auto' },
|
||||
actions: {},
|
||||
dragDrop: [
|
||||
{ dragSelector: null, dropSelector: '.tab.features' },
|
||||
{ dragSelector: '.feature-item', dropSelector: null }
|
||||
]
|
||||
};
|
||||
|
||||
/**@override */
|
||||
static PARTS = {
|
||||
header: {
|
||||
id: 'header',
|
||||
template: 'systems/daggerheart/templates/sheets-settings/npc-settings/header.hbs'
|
||||
},
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||
details: {
|
||||
id: 'details',
|
||||
template: 'systems/daggerheart/templates/sheets-settings/npc-settings/details.hbs'
|
||||
},
|
||||
features: {
|
||||
id: 'features',
|
||||
template: 'systems/daggerheart/templates/sheets-settings/npc-settings/features.hbs'
|
||||
}
|
||||
};
|
||||
|
||||
/** @override */
|
||||
static TABS = {
|
||||
primary: {
|
||||
tabs: [{ id: 'details' }, { id: 'features' }],
|
||||
initial: 'details',
|
||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
};
|
||||
|
||||
async _prepareContext(options) {
|
||||
const context = await super._prepareContext(options);
|
||||
|
||||
const featureForms = ['passive', 'action', 'reaction'];
|
||||
context.features = context.document.system.features.sort((a, b) =>
|
||||
a.system.featureForm !== b.system.featureForm
|
||||
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
|
||||
: a.sort - b.sort
|
||||
);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
async _onDragStart(event) {
|
||||
const featureItem = event.currentTarget.closest('.feature-item');
|
||||
|
||||
if (featureItem) {
|
||||
const feature = this.actor.items.get(featureItem.id);
|
||||
const featureData = { type: 'Item', uuid: feature.uuid, fromInternal: true };
|
||||
event.dataTransfer.setData('text/plain', JSON.stringify(featureData));
|
||||
event.dataTransfer.setDragImage(featureItem.querySelector('img'), 60, 0);
|
||||
}
|
||||
}
|
||||
|
||||
async _onDrop(event) {
|
||||
event.stopPropagation();
|
||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||
|
||||
const item = await fromUuid(data.uuid);
|
||||
if (item?.type === 'feature') {
|
||||
if (data.fromInternal && item.parent?.uuid === this.actor.uuid) {
|
||||
return;
|
||||
}
|
||||
|
||||
const itemData = item.toObject();
|
||||
delete itemData._id;
|
||||
|
||||
await this.actor.createEmbeddedDocuments('Item', [itemData]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2,4 +2,5 @@ export { default as Adversary } from './adversary.mjs';
|
|||
export { default as Character } from './character.mjs';
|
||||
export { default as Companion } from './companion.mjs';
|
||||
export { default as Environment } from './environment.mjs';
|
||||
export { default as NPC } from './npc.mjs';
|
||||
export { default as Party } from './party.mjs';
|
||||
|
|
|
|||
136
module/applications/sheets/actors/npc.mjs
Normal file
136
module/applications/sheets/actors/npc.mjs
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
import DHBaseActorSheet from '../api/base-actor.mjs';
|
||||
|
||||
export default class NPCSheet extends DHBaseActorSheet {
|
||||
/** @inheritDoc */
|
||||
static DEFAULT_OPTIONS = {
|
||||
classes: ['npc'],
|
||||
position: { width: 660, height: 600 },
|
||||
window: { resizable: true },
|
||||
actions: {},
|
||||
window: {
|
||||
resizable: true,
|
||||
controls: [
|
||||
{
|
||||
icon: 'fa-solid fa-signature',
|
||||
label: 'DAGGERHEART.UI.Tooltip.configureAttribution',
|
||||
action: 'editAttribution'
|
||||
}
|
||||
]
|
||||
},
|
||||
dragDrop: [
|
||||
{
|
||||
dragSelector: '[data-item-id][draggable="true"], [data-item-id] [draggable="true"]',
|
||||
dropSelector: null
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
static PARTS = {
|
||||
header: { template: 'systems/daggerheart/templates/sheets/actors/npc/header.hbs' },
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/actors/npc/navigation.hbs' },
|
||||
features: {
|
||||
template: 'systems/daggerheart/templates/sheets/actors/npc/features.hbs',
|
||||
scrollable: ['.feature-section']
|
||||
},
|
||||
notes: {
|
||||
template: 'systems/daggerheart/templates/sheets/actors/npc/notes.hbs'
|
||||
}
|
||||
};
|
||||
|
||||
/** @inheritdoc */
|
||||
static TABS = {
|
||||
primary: {
|
||||
tabs: [{ id: 'notes' }, { id: 'features' }],
|
||||
initial: 'notes',
|
||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
};
|
||||
|
||||
/** @inheritdoc */
|
||||
_prepareTabs(group) {
|
||||
const result = super._prepareTabs(group);
|
||||
if (group === 'primary') {
|
||||
result.features.empty = this.document.system.features.length === 0;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
async _preparePartContext(partId, context, options) {
|
||||
context = await super._preparePartContext(partId, context, options);
|
||||
switch (partId) {
|
||||
case 'header':
|
||||
await this._prepareHeaderContext(context, options);
|
||||
break;
|
||||
case 'features':
|
||||
await this._prepareFeaturesContext(context, options);
|
||||
break;
|
||||
case 'notes':
|
||||
await this._prepareNotesContext(context, options);
|
||||
break;
|
||||
}
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare render context for the Header part.
|
||||
* @param {ApplicationRenderContext} context
|
||||
* @param {ApplicationRenderOptions} options
|
||||
* @returns {Promise<void>}
|
||||
* @protected
|
||||
*/
|
||||
async _prepareHeaderContext(context, _options) {
|
||||
const { system } = this.document;
|
||||
const { TextEditor } = foundry.applications.ux;
|
||||
|
||||
context.description = await TextEditor.implementation.enrichHTML(system.description, {
|
||||
secrets: this.document.isOwner,
|
||||
relativeTo: this.document
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare render context for the Features part.
|
||||
* @param {ApplicationRenderContext} context
|
||||
* @param {ApplicationRenderOptions} options
|
||||
* @returns {Promise<void>}
|
||||
* @protected
|
||||
*/
|
||||
async _prepareFeaturesContext(context, _options) {
|
||||
const featureForms = ['passive', 'action', 'reaction'];
|
||||
context.features = this.document.system.features.sort((a, b) =>
|
||||
a.system.featureForm !== b.system.featureForm
|
||||
? featureForms.indexOf(a.system.featureForm) - featureForms.indexOf(b.system.featureForm)
|
||||
: a.sort - b.sort
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepare render context for the Biography part.
|
||||
* @param {ApplicationRenderContext} context
|
||||
* @param {ApplicationRenderOptions} options
|
||||
* @returns {Promise<void>}
|
||||
* @protected
|
||||
*/
|
||||
async _prepareNotesContext(context, _options) {
|
||||
const { system } = this.document;
|
||||
const { TextEditor } = foundry.applications.ux;
|
||||
|
||||
const paths = {
|
||||
notes: 'notes'
|
||||
};
|
||||
|
||||
for (const [key, path] of Object.entries(paths)) {
|
||||
const value = foundry.utils.getProperty(system, path);
|
||||
context[key] = {
|
||||
field: system.schema.getField(path),
|
||||
value,
|
||||
enriched: await TextEditor.implementation.enrichHTML(value, {
|
||||
secrets: this.document.isOwner,
|
||||
relativeTo: this.document
|
||||
})
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +1,17 @@
|
|||
import DhCharacter from './character.mjs';
|
||||
import DhCompanion from './companion.mjs';
|
||||
import DhAdversary from './adversary.mjs';
|
||||
import DhNPC from './npc.mjs';
|
||||
import DhEnvironment from './environment.mjs';
|
||||
import DhParty from './party.mjs';
|
||||
|
||||
export { DhCharacter, DhCompanion, DhAdversary, DhEnvironment, DhParty };
|
||||
export { DhCharacter, DhCompanion, DhAdversary, DhNPC, DhEnvironment, DhParty };
|
||||
|
||||
export const config = {
|
||||
character: DhCharacter,
|
||||
companion: DhCompanion,
|
||||
adversary: DhAdversary,
|
||||
npc: DhNPC,
|
||||
environment: DhEnvironment,
|
||||
party: DhParty
|
||||
};
|
||||
|
|
|
|||
43
module/data/actor/npc.mjs
Normal file
43
module/data/actor/npc.mjs
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import DHNPCSettings from '../../applications/sheets-configs/npc-settings.mjs';
|
||||
import BaseDataActor from './base.mjs';
|
||||
|
||||
export default class DhpNPC extends BaseDataActor {
|
||||
static LOCALIZATION_PREFIXES = ['DAGGERHEART.ACTORS.NPC'];
|
||||
|
||||
static get metadata() {
|
||||
return foundry.utils.mergeObject(super.metadata, {
|
||||
label: 'TYPES.Actor.npc',
|
||||
type: 'npc',
|
||||
settingSheet: DHNPCSettings,
|
||||
hasResistances: false,
|
||||
hasAttribution: true
|
||||
});
|
||||
}
|
||||
|
||||
static defineSchema() {
|
||||
const fields = foundry.data.fields;
|
||||
return {
|
||||
...super.defineSchema(),
|
||||
difficulty: new fields.NumberField({
|
||||
nullable: true,
|
||||
initial: null,
|
||||
integer: true,
|
||||
label: 'DAGGERHEART.GENERAL.difficulty'
|
||||
}),
|
||||
description: new fields.HTMLField({ label: 'DAGGERHEART.GENERAL.description' }),
|
||||
motives: new fields.StringField(),
|
||||
notes: new fields.HTMLField()
|
||||
};
|
||||
}
|
||||
|
||||
/**@inheritdoc */
|
||||
static DEFAULT_ICON = 'systems/daggerheart/assets/icons/documents/actors/drama-masks.svg';
|
||||
|
||||
get features() {
|
||||
return this.parent.items.filter(x => x.type === 'feature');
|
||||
}
|
||||
|
||||
isItemValid(source) {
|
||||
return super.isItemValid(source) || source.type === 'feature';
|
||||
}
|
||||
}
|
||||
|
|
@ -109,6 +109,14 @@ export default class DhpActor extends Actor {
|
|||
});
|
||||
}
|
||||
|
||||
if (this.type === 'npc') {
|
||||
Object.assign(update, {
|
||||
prototypeToken: {
|
||||
disposition: CONST.TOKEN_DISPOSITIONS.FRIENDLY
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
this.updateSource(update);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,7 @@
|
|||
|
||||
.daggerheart.dh-style {
|
||||
.tab-navigation {
|
||||
margin: 5px 0;
|
||||
height: 40px;
|
||||
margin: 5px 0 10px 0;
|
||||
width: 100%;
|
||||
|
||||
.navigation-container {
|
||||
|
|
@ -21,6 +20,10 @@
|
|||
|
||||
a {
|
||||
color: @color-text-emphatic;
|
||||
|
||||
&.empty:not(.active) {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
.tags {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding-bottom: 16px;
|
||||
padding-bottom: 8px;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
|
|
@ -67,11 +67,5 @@
|
|||
gap: 12px;
|
||||
padding: 16px 0;
|
||||
}
|
||||
|
||||
.adversary-navigation {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -148,10 +148,8 @@
|
|||
}
|
||||
|
||||
.companion-navigation {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
align-items: baseline;
|
||||
width: 100%;
|
||||
padding: 0 10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -138,10 +138,8 @@
|
|||
}
|
||||
|
||||
.environment-navigation {
|
||||
display: flex;
|
||||
gap: 20px;
|
||||
align-items: baseline;
|
||||
padding: 0 20px;
|
||||
|
||||
.tab-navigation {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
|
|
|||
18
styles/less/sheets/actors/npc/features.less
Normal file
18
styles/less/sheets/actors/npc/features.less
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
.application.sheet.daggerheart.actor.dh-style.npc {
|
||||
.tab.features {
|
||||
&.active {
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.feature-section {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 10px;
|
||||
overflow-y: auto;
|
||||
mask-image: linear-gradient(0deg, transparent 0%, black 5%);
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
83
styles/less/sheets/actors/npc/header.less
Normal file
83
styles/less/sheets/actors/npc/header.less
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
.application.sheet.daggerheart.actor.dh-style.npc {
|
||||
.npc-header-sheet {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
|
||||
.portrait {
|
||||
cursor: pointer;
|
||||
width: 275px;
|
||||
|
||||
img {
|
||||
height: 275px;
|
||||
}
|
||||
}
|
||||
|
||||
.tags {
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
padding-bottom: 8px;
|
||||
|
||||
.tag {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 4px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
padding: 3px 5px;
|
||||
font-size: var(--font-size-12);
|
||||
font: @font-body;
|
||||
|
||||
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: var(--font-size-12);
|
||||
}
|
||||
}
|
||||
|
||||
.info-section {
|
||||
flex: 1;
|
||||
padding: 0 15px;
|
||||
padding-top: var(--header-height);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.name-row {
|
||||
display: flex;
|
||||
gap: 5px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 8px 0;
|
||||
|
||||
h1 {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
padding: 6px 0 0 0;
|
||||
font-size: var(--font-size-32);
|
||||
text-align: start;
|
||||
border: 1px solid transparent;
|
||||
outline: 2px solid transparent;
|
||||
transition: all 0.3s ease;
|
||||
word-break: break-word;
|
||||
|
||||
&:hover {
|
||||
outline: 2px solid light-dark(@dark, @golden);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.npc-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 16px 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
styles/less/sheets/actors/npc/index.less
Normal file
3
styles/less/sheets/actors/npc/index.less
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
@import './sheet.less';
|
||||
@import './header.less';
|
||||
@import './features.less';
|
||||
10
styles/less/sheets/actors/npc/sheet.less
Normal file
10
styles/less/sheets/actors/npc/sheet.less
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
.application.sheet.daggerheart.actor.dh-style.npc {
|
||||
.window-content {
|
||||
display: grid;
|
||||
grid-template-rows: auto auto 1fr;
|
||||
}
|
||||
|
||||
.npc-navigation {
|
||||
padding: 0 15px;
|
||||
}
|
||||
}
|
||||
|
|
@ -6,6 +6,7 @@
|
|||
@import './actors/character/index.less';
|
||||
@import './actors/companion/index.less';
|
||||
@import './actors/environment/index.less';
|
||||
@import './actors/npc/index.less';
|
||||
@import './actors/party/index.less';
|
||||
|
||||
@import './items/beastform.less';
|
||||
|
|
|
|||
|
|
@ -244,11 +244,14 @@
|
|||
"adversary": {
|
||||
"htmlFields": ["notes", "description"]
|
||||
},
|
||||
"npc": {
|
||||
"htmlFields": ["notes"]
|
||||
},
|
||||
"environment": {
|
||||
"htmlFields": ["notes", "description"]
|
||||
},
|
||||
"party": {
|
||||
"htmlFields": ["notes"]
|
||||
"htmlFields": ["notes", "description"]
|
||||
}
|
||||
},
|
||||
"Item": {
|
||||
|
|
|
|||
13
templates/sheets-settings/npc-settings/details.hbs
Normal file
13
templates/sheets-settings/npc-settings/details.hbs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
<section
|
||||
class='tab {{tabs.details.cssClass}} {{tabs.details.id}}'
|
||||
data-tab='{{tabs.details.id}}'
|
||||
data-group='{{tabs.details.group}}'
|
||||
>
|
||||
<fieldset>
|
||||
<legend>{{localize "DAGGERHEART.GENERAL.description"}}</legend>
|
||||
{{formInput systemFields.description value=document._source.system.description}}
|
||||
</fieldset>
|
||||
|
||||
{{formGroup systemFields.motives value=document._source.system.motives}}
|
||||
{{formGroup systemFields.difficulty value=document._source.system.difficulty localize=true}}
|
||||
</section>
|
||||
29
templates/sheets-settings/npc-settings/features.hbs
Normal file
29
templates/sheets-settings/npc-settings/features.hbs
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<section
|
||||
class='tab {{tabs.features.cssClass}} {{tabs.features.id}}'
|
||||
data-tab='{{tabs.features.id}}'
|
||||
data-group='{{tabs.features.group}}'
|
||||
>
|
||||
<button type="button" class="add-feature-btn" data-action="createDoc" data-document-class="Item" data-type="feature">
|
||||
{{localize "DOCUMENT.New" type=(localize "TYPES.Item.feature")}}
|
||||
</button>
|
||||
<fieldset>
|
||||
<legend>{{localize tabs.features.label}}</legend>
|
||||
<ul class="feature-list">
|
||||
{{#each @root.features as |feature|}}
|
||||
<li class="feature-item" id="{{feature.id}}" draggable="true">
|
||||
<img src="{{feature.img}}" alt="">
|
||||
<div class="label">
|
||||
<span>{{feature.name}}</span>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<a data-action="editDoc" data-item-uuid="{{feature.uuid}}" data-tooltip="{{localize 'CONTROLS.CommonEdit'}}"><i class="fa-solid fa-pen-to-square"></i></a>
|
||||
<a data-action="deleteDoc" data-item-uuid="{{feature.uuid}}" data-tooltip="{{localize 'CONTROLS.CommonDelete'}}"><i class="fa-solid fa-trash"></i></a>
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
</ul>
|
||||
<div class="features-dragger">
|
||||
<span>{{localize "DAGGERHEART.GENERAL.dropFeaturesHere"}}</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</section>
|
||||
3
templates/sheets-settings/npc-settings/header.hbs
Normal file
3
templates/sheets-settings/npc-settings/header.hbs
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
<header class="dialog-header">
|
||||
<h1>{{document.name}}</h1>
|
||||
</header>
|
||||
|
|
@ -44,10 +44,9 @@
|
|||
</span>
|
||||
</div>
|
||||
|
||||
<div class="adversary-navigation">
|
||||
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
</div>
|
||||
{{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
</header>
|
||||
|
|
@ -50,9 +50,10 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="companion-navigation">
|
||||
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
{{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
</div>
|
||||
</header>
|
||||
|
|
@ -44,9 +44,10 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="environment-navigation">
|
||||
{{> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
{{/ 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
</div>
|
||||
</header>
|
||||
14
templates/sheets/actors/npc/features.hbs
Normal file
14
templates/sheets/actors/npc/features.hbs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
<section class='tab {{tabs.features.cssClass}} {{tabs.features.id}}' data-tab='{{tabs.features.id}}'
|
||||
data-group='{{tabs.features.group}}'>
|
||||
<div class="feature-section">
|
||||
{{> 'daggerheart.inventory-items'
|
||||
title=tabs.features.label
|
||||
type='feature'
|
||||
collection=@root.features
|
||||
hideContextMenu=true
|
||||
hideModifyControls=true
|
||||
canCreate=@root.editable
|
||||
showActions=@root.editable
|
||||
}}
|
||||
</div>
|
||||
</section>
|
||||
40
templates/sheets/actors/npc/header.hbs
Normal file
40
templates/sheets/actors/npc/header.hbs
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
<header class='npc-header-sheet'>
|
||||
<div class="portrait">
|
||||
<img src="{{source.img}}" alt="{{source.name}}" data-action='editImage' data-edit="img">
|
||||
</div>
|
||||
<div class="info-section">
|
||||
<line-div></line-div>
|
||||
|
||||
<div class="name-row">
|
||||
<h1
|
||||
class="input actor-name"
|
||||
contenteditable="plaintext-only"
|
||||
data-property="name"
|
||||
placeholder="{{localize "DAGGERHEART.GENERAL.actorName"}}"
|
||||
autocomplete="off"
|
||||
spellcheck="false"
|
||||
>{{source.name}}</h1>
|
||||
</div>
|
||||
|
||||
{{#if source.system.difficulty}}
|
||||
<div class="tags">
|
||||
<div class="tag">
|
||||
<span>{{localize "DAGGERHEART.GENERAL.difficulty"}}</span>
|
||||
<span>{{source.system.difficulty}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
|
||||
<line-div></line-div>
|
||||
|
||||
<div class="npc-info">
|
||||
<span class="description">
|
||||
<i>{{{description}}}</i>
|
||||
</span>
|
||||
<div class="motives-and-tactics">
|
||||
<b>{{localize 'DAGGERHEART.ACTORS.NPC.FIELDS.motives.label'}}: </b>
|
||||
{{source.system.motives}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
7
templates/sheets/actors/npc/navigation.hbs
Normal file
7
templates/sheets/actors/npc/navigation.hbs
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
<div class="npc-navigation">
|
||||
{{#> 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
<button type="button" data-action="openSettings" data-tooltip-text="{{localize "DAGGERHEART.UI.Tooltip.openSheetSettings"}}">
|
||||
<i class="fa-solid fa-wrench"></i>
|
||||
</button>
|
||||
{{/'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs'}}
|
||||
</div>
|
||||
11
templates/sheets/actors/npc/notes.hbs
Normal file
11
templates/sheets/actors/npc/notes.hbs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<section
|
||||
class='tab {{tabs.notes.cssClass}} {{tabs.notes.id}}'
|
||||
data-tab='{{tabs.notes.id}}'
|
||||
data-group='{{tabs.notes.group}}'
|
||||
>
|
||||
{{formInput notes.field value=notes.value enriched=notes.enriched toggled=true}}
|
||||
|
||||
{{#if (and showAttribution document.system.attribution.artist)}}
|
||||
<label class="artist-attribution">{{localize "DAGGERHEART.GENERAL.artistAttribution" artist=document.system.attribution.artist}}</label>
|
||||
{{/if}}
|
||||
</section>
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
<line-div></line-div>
|
||||
<nav class='feature-tab sheet-tabs tabs' data-group='primary'>
|
||||
{{#each tabs as |tab|}}
|
||||
<a class='{{tab.id}} {{tab.cssClass}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
||||
<a class='{{tab.id}} {{tab.cssClass}} {{#if tab.empty}}empty{{/if}}' data-action='tab' data-group='{{tab.group}}' data-tab='{{tab.id}}'>
|
||||
<span>{{localize tab.label}}</span>
|
||||
</a>
|
||||
{{/each}}
|
||||
|
|
|
|||
|
|
@ -12,13 +12,9 @@
|
|||
{{/if}}
|
||||
</span>
|
||||
</div>
|
||||
{{#if roll.difficulty}}
|
||||
<span class="roll-difficulty{{#unless roll.success}} is-miss{{/unless}}">
|
||||
{{!-- {{#if canViewSecret}} --}}
|
||||
difficulty {{roll.difficulty}}
|
||||
{{!-- {{else}}
|
||||
{{localize (ifThen roll.success "DAGGERHEART.GENERAL.success" "DAGGERHEART.GENERAL.failure")}}
|
||||
{{/if}} --}}
|
||||
{{#if roll.options.roll.difficulty}}
|
||||
<span class="roll-difficulty{{#unless roll.options.roll.success}} is-miss{{/unless}}">
|
||||
{{localize "DAGGERHEART.GENERAL.difficulty"}} {{roll.options.roll.difficulty}}
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
<span>{{name}}</span>
|
||||
{{#if (or (eq type "adversary") (eq type "environment"))}}
|
||||
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.tier" tier=system.tier type=(@root.getTypeLabel this)}}</span>
|
||||
{{else if (eq type "npc")}}
|
||||
<span class="entry-subtitle">{{localize "TYPES.Actor.npc"}}</span>
|
||||
{{else if (eq type "character")}}
|
||||
<span class="entry-subtitle">{{localize "DAGGERHEART.UI.Sidebar.actorDirectory.character" level=system.levelData.level.current}}</span>
|
||||
{{else if (eq type "companion")}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue