mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
Fixed up data model and a basic placeholder template (#117)
This commit is contained in:
parent
746e0f239a
commit
ad0acd62cd
15 changed files with 300 additions and 145 deletions
56
lang/en.json
56
lang/en.json
|
|
@ -261,6 +261,12 @@
|
||||||
"Description": "When an effect makes a creature Restrained, it means they cannot move until this condition is cleared.\nThey can still take actions from their current position."
|
"Description": "When an effect makes a creature Restrained, it means they cannot move until this condition is cleared.\nThey can still take actions from their current position."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Tiers": {
|
||||||
|
"tier1": "Tier 1",
|
||||||
|
"tier2": "Tier 2",
|
||||||
|
"tier3": "Tier 3",
|
||||||
|
"tier4": "Tier 4"
|
||||||
|
},
|
||||||
"Adversary": {
|
"Adversary": {
|
||||||
"Bruiser": {
|
"Bruiser": {
|
||||||
"Name": "Bruiser",
|
"Name": "Bruiser",
|
||||||
|
|
@ -320,6 +326,26 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"Environment": {
|
||||||
|
"Type": {
|
||||||
|
"Exploration": {
|
||||||
|
"label": "Exploration",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"Social": {
|
||||||
|
"label": "Social",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"Traversal": {
|
||||||
|
"label": "Traversal",
|
||||||
|
"description": ""
|
||||||
|
},
|
||||||
|
"Event": {
|
||||||
|
"label": "Event",
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"Domains": {
|
"Domains": {
|
||||||
"Arcana": {
|
"Arcana": {
|
||||||
"Description": "This is the domain of the innate or instinctual use of magic. Those who walk this path tap into the raw, enigmatic forces of the realms to manipulate both the elements and their own energy. Arcana offers wielders a volatile power, but it is incredibly potent when correctly channeled."
|
"Description": "This is the domain of the innate or instinctual use of magic. Those who walk this path tap into the raw, enigmatic forces of the realms to manipulate both the elements and their own energy. Arcana offers wielders a volatile power, but it is incredibly potent when correctly channeled."
|
||||||
|
|
@ -1030,9 +1056,33 @@
|
||||||
"NewFeature": "New Feature"
|
"NewFeature": "New Feature"
|
||||||
},
|
},
|
||||||
"Environment": {
|
"Environment": {
|
||||||
"ToneAndFeel": "Tone And feel",
|
"FIELDS": {
|
||||||
"PotentialAdversaries": "Potential Adversaries",
|
"tier": {
|
||||||
"NewFeature": "New Feature"
|
"label": "Tier"
|
||||||
|
},
|
||||||
|
"type": {
|
||||||
|
"label": "Type"
|
||||||
|
},
|
||||||
|
"difficulty": {
|
||||||
|
"label": "Difficulty"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"Tabs": {
|
||||||
|
"Main": "Data",
|
||||||
|
"Information": "Information"
|
||||||
|
},
|
||||||
|
"general": "General",
|
||||||
|
"newAdversary": "New Adversary",
|
||||||
|
"newFeature": "New feature",
|
||||||
|
"description": "Description",
|
||||||
|
"impulses": "Impulses",
|
||||||
|
"potentialAdversaries": {
|
||||||
|
"label": "Potential Adversaries",
|
||||||
|
"placeholder": "Optionally drag and drop adversaries here"
|
||||||
|
},
|
||||||
|
"features": {
|
||||||
|
"label": "Features"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Armor": {
|
"Armor": {
|
||||||
"baseScore": "Base Score",
|
"baseScore": "Base Score",
|
||||||
|
|
|
||||||
|
|
@ -1,78 +1,60 @@
|
||||||
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
import DaggerheartSheet from './daggerheart-sheet.mjs';
|
||||||
|
|
||||||
const { DocumentSheetV2 } = foundry.applications.api;
|
const { ActorSheetV2 } = foundry.applications.sheets;
|
||||||
export default class DhpEnvironment extends DaggerheartSheet(DocumentSheetV2) {
|
export default class DhpEnvironment extends DaggerheartSheet(ActorSheetV2) {
|
||||||
constructor(options) {
|
|
||||||
super(options);
|
|
||||||
|
|
||||||
this.editMode = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
tag: 'form',
|
tag: 'form',
|
||||||
classes: ['daggerheart', 'sheet', 'adversary', 'environment'],
|
classes: ['daggerheart', 'sheet', 'actor', 'dh-style', 'environment'],
|
||||||
position: {
|
position: {
|
||||||
width: 600,
|
width: 450,
|
||||||
height: 'auto'
|
height: 1000
|
||||||
},
|
},
|
||||||
actions: {
|
actions: {
|
||||||
toggleSlider: this.toggleSlider,
|
addAdversary: this.addAdversary,
|
||||||
viewFeature: this.viewFeature,
|
|
||||||
addFeature: this.addFeature,
|
addFeature: this.addFeature,
|
||||||
removeFeature: this.removeFeature,
|
deleteProperty: this.deleteProperty,
|
||||||
addTone: this.addTone,
|
viewAdversary: this.viewAdversary
|
||||||
removeTone: this.removeTone,
|
|
||||||
useFeature: this.useFeature
|
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
handler: this._updateForm,
|
handler: this._updateForm,
|
||||||
closeOnSubmit: false,
|
submitOnChange: true,
|
||||||
submitOnChange: true
|
closeOnSubmit: false
|
||||||
}
|
},
|
||||||
|
dragDrop: [{ dragSelector: null, dropSelector: '.adversary-container' }]
|
||||||
};
|
};
|
||||||
|
|
||||||
/** @override */
|
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
form: {
|
header: { template: 'systems/daggerheart/templates/sheets/actors/environment/header.hbs' },
|
||||||
id: 'form',
|
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||||
template: 'systems/daggerheart/templates/sheets/environment.hbs'
|
main: { template: 'systems/daggerheart/templates/sheets/actors/environment/main.hbs' },
|
||||||
}
|
information: { template: 'systems/daggerheart/templates/sheets/actors/environment/information.hbs' }
|
||||||
};
|
};
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
static TABS = {
|
||||||
|
main: {
|
||||||
/** @inheritDoc */
|
active: true,
|
||||||
get title() {
|
cssClass: '',
|
||||||
return `${game.i18n.localize('Environment')} - ${this.document.name}`;
|
group: 'primary',
|
||||||
}
|
id: 'main',
|
||||||
|
icon: null,
|
||||||
|
label: 'DAGGERHEART.Sheets.Environment.Tabs.Main'
|
||||||
|
},
|
||||||
|
information: {
|
||||||
|
active: false,
|
||||||
|
cssClass: '',
|
||||||
|
group: 'primary',
|
||||||
|
id: 'information',
|
||||||
|
icon: null,
|
||||||
|
label: 'DAGGERHEART.Sheets.Environment.Tabs.Information'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
async _prepareContext(_options) {
|
async _prepareContext(_options) {
|
||||||
return {
|
const context = await super._prepareContext(_options);
|
||||||
title: `${this.document.name} - ${game.i18n.localize(SYSTEM.ACTOR.adversaryTypes[this.document.system.type].name)}`,
|
context.document = this.document;
|
||||||
user: this.document,
|
context.tabs = super._getTabs(this.constructor.TABS);
|
||||||
source: this.document.toObject(),
|
|
||||||
fields: this.document.schema.fields,
|
|
||||||
data: {
|
|
||||||
type: game.i18n.localize(SYSTEM.ACTOR.adversaryTypes[this.document.system.type].name),
|
|
||||||
features: this.document.items.reduce((acc, x) => {
|
|
||||||
if (x.type === 'feature') {
|
|
||||||
const feature = x.toObject();
|
|
||||||
acc.push({
|
|
||||||
...feature,
|
|
||||||
system: {
|
|
||||||
...feature.system,
|
|
||||||
actionType: game.i18n.localize(SYSTEM.ITEM.actionTypes[feature.system.actionType].name)
|
|
||||||
},
|
|
||||||
uuid: x.uuid
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
return context;
|
||||||
}, [])
|
|
||||||
},
|
|
||||||
editMode: this.editMode,
|
|
||||||
config: SYSTEM
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async _updateForm(event, _, formData) {
|
static async _updateForm(event, _, formData) {
|
||||||
|
|
@ -80,60 +62,41 @@ export default class DhpEnvironment extends DaggerheartSheet(DocumentSheetV2) {
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static toggleSlider() {
|
static async addAdversary() {
|
||||||
this.editMode = !this.editMode;
|
await this.document.update({
|
||||||
|
[`system.potentialAdversaries.${foundry.utils.randomID()}.label`]: game.i18n.localize(
|
||||||
|
'DAGGERHEART.Sheets.Environment.newAdversary'
|
||||||
|
)
|
||||||
|
});
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async viewFeature(_, button) {
|
|
||||||
const move = await fromUuid(button.dataset.feature);
|
|
||||||
move.sheet.render(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static async addFeature() {
|
static async addFeature() {
|
||||||
const result = await this.document.createEmbeddedDocuments('Item', [
|
ui.notifications.error('Not Implemented yet. Awaiting datamodel rework');
|
||||||
{
|
|
||||||
name: game.i18n.localize('DAGGERHEART.Sheets.Environment.NewFeature'),
|
|
||||||
type: 'feature'
|
|
||||||
}
|
|
||||||
]);
|
|
||||||
|
|
||||||
await result[0].sheet.render(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static async removeFeature(_, button) {
|
static async deleteProperty(_, target) {
|
||||||
await this.document.items.find(x => x.uuid === button.dataset.feature).delete();
|
await this.document.update({ [`${target.dataset.path}.-=${target.id}`]: null });
|
||||||
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async addTone() {
|
static async viewAdversary(_, button) {
|
||||||
await this.document.update({ 'system.toneAndFeel': [...this.document.system.toneAndFeel, ''] });
|
const adversary = foundry.utils.getProperty(
|
||||||
|
this.document.system.potentialAdversaries,
|
||||||
|
`${button.dataset.potentialAdversary}.adversaries.${button.dataset.adversary}`
|
||||||
|
);
|
||||||
|
adversary.sheet.render(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
static async removeTone(button) {
|
async _onDrop(event) {
|
||||||
await this.document.update({
|
const data = TextEditor.getDragEventData(event);
|
||||||
'system.toneAndFeel': this.document.system.toneAndFeel.filter(
|
const item = await fromUuid(data.uuid);
|
||||||
(_, index) => index !== Number.parseInt(button.dataset.tone)
|
if (item.type === 'adversary') {
|
||||||
)
|
const target = event.target.closest('.adversary-container');
|
||||||
});
|
const path = `system.potentialAdversaries.${target.dataset.potentialAdversary}.adversaries.${item.id}`;
|
||||||
}
|
await this.document.update({
|
||||||
|
[path]: item.uuid
|
||||||
static async useFeature(_, button) {
|
});
|
||||||
const item = this.document.items.find(x => x.uuid === button.dataset.feature);
|
}
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
|
||||||
const msg = new cls({
|
|
||||||
user: game.user.id,
|
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
|
||||||
'systems/daggerheart/templates/chat/ability-use.hbs',
|
|
||||||
{
|
|
||||||
title: game.i18n.format('DAGGERHEART.Chat.EnvironmentTitle', {
|
|
||||||
actionType: button.dataset.actionType
|
|
||||||
}),
|
|
||||||
card: { name: item.name, img: item.img, description: item.system.description }
|
|
||||||
}
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
cls.create(msg.toObject());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -123,6 +123,25 @@ export const adversaryTypes = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const environmentTypes = {
|
||||||
|
exploration: {
|
||||||
|
label: 'DAGGERHEART.Environment.Type.Exploration.label',
|
||||||
|
description: 'DAGGERHEART.Environment.Type.Exploration.description'
|
||||||
|
},
|
||||||
|
social: {
|
||||||
|
label: 'DAGGERHEART.Environment.Type.Social.label',
|
||||||
|
description: 'DAGGERHEART.Environment.Type.Social.description'
|
||||||
|
},
|
||||||
|
traversal: {
|
||||||
|
label: 'DAGGERHEART.Environment.Type.Traversal.label',
|
||||||
|
description: 'DAGGERHEART.Environment.Type.Traversal.description'
|
||||||
|
},
|
||||||
|
event: {
|
||||||
|
label: 'DAGGERHEART.Environment.Type.Event.label',
|
||||||
|
description: 'DAGGERHEART.Environment.Type.Event.description'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const adversaryTraits = {
|
export const adversaryTraits = {
|
||||||
relentless: {
|
relentless: {
|
||||||
name: 'DAGGERHEART.Adversary.Trait..Name',
|
name: 'DAGGERHEART.Adversary.Trait..Name',
|
||||||
|
|
|
||||||
|
|
@ -175,25 +175,21 @@ export const deathMoves = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const tiers = {
|
export const tiers = {
|
||||||
0: {
|
tier1: {
|
||||||
key: 0,
|
|
||||||
id: 'tier0',
|
|
||||||
name: 'DAGGERHEART.General.Tier.0'
|
|
||||||
},
|
|
||||||
1: {
|
|
||||||
key: 1,
|
|
||||||
id: 'tier1',
|
id: 'tier1',
|
||||||
name: 'DAGGERHEART.General.Tier.1'
|
label: 'DAGGERHEART.Tiers.tier1'
|
||||||
},
|
},
|
||||||
2: {
|
tier2: {
|
||||||
key: 2,
|
|
||||||
id: 'tier2',
|
id: 'tier2',
|
||||||
name: 'DAGGERHEART.General.Tier.2'
|
label: 'DAGGERHEART.Tiers.tier2'
|
||||||
},
|
},
|
||||||
3: {
|
tier3: {
|
||||||
key: 3,
|
|
||||||
id: 'tier3',
|
id: 'tier3',
|
||||||
name: 'DAGGERHEART.General.Tier.3'
|
label: 'DAGGERHEART.Tiers.tier3'
|
||||||
|
},
|
||||||
|
tier4: {
|
||||||
|
id: 'tier4',
|
||||||
|
label: 'DAGGERHEART.Tiers.tier4'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,10 @@ export default class DhpAdversary extends foundry.abstract.TypeDataModel {
|
||||||
max: new fields.NumberField({ initial: 0, integer: true })
|
max: new fields.NumberField({ initial: 0, integer: true })
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
tier: new fields.StringField({ choices: Object.keys(SYSTEM.GENERAL.tiers), integer: false }),
|
tier: new fields.StringField({
|
||||||
|
choices: Object.keys(SYSTEM.GENERAL.tiers),
|
||||||
|
initial: SYSTEM.GENERAL.tiers.tier1.id
|
||||||
|
}),
|
||||||
type: new fields.StringField({
|
type: new fields.StringField({
|
||||||
choices: Object.keys(SYSTEM.ACTOR.adversaryTypes),
|
choices: Object.keys(SYSTEM.ACTOR.adversaryTypes),
|
||||||
integer: false,
|
integer: false,
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,28 @@
|
||||||
export default class DhpEnvironment extends foundry.abstract.TypeDataModel {
|
import { environmentTypes } from '../config/actorConfig.mjs';
|
||||||
|
import ForeignDocumentUUIDField from './fields/foreignDocumentUUIDField.mjs';
|
||||||
|
|
||||||
|
export default class DhEnvironment extends foundry.abstract.TypeDataModel {
|
||||||
|
static LOCALIZATION_PREFIXES = ['DAGGERHEART.Sheets.Environment'];
|
||||||
|
|
||||||
static defineSchema() {
|
static defineSchema() {
|
||||||
const fields = foundry.data.fields;
|
const fields = foundry.data.fields;
|
||||||
return {
|
return {
|
||||||
resources: new fields.SchemaField({}),
|
tier: new fields.StringField({
|
||||||
tier: new fields.StringField({ choices: Object.keys(SYSTEM.GENERAL.tiers), integer: false }),
|
required: true,
|
||||||
type: new fields.StringField({
|
choices: SYSTEM.GENERAL.tiers,
|
||||||
choices: Object.keys(SYSTEM.ACTOR.adversaryTypes),
|
initial: SYSTEM.GENERAL.tiers.tier1.id
|
||||||
integer: false,
|
|
||||||
initial: Object.keys(SYSTEM.ACTOR.adversaryTypes).find(x => x === 'standard')
|
|
||||||
}),
|
}),
|
||||||
description: new fields.StringField({}),
|
type: new fields.StringField({ choices: environmentTypes }),
|
||||||
toneAndFeel: new fields.StringField({}),
|
description: new fields.HTMLField(),
|
||||||
difficulty: new fields.NumberField({ initial: 1, integer: true }),
|
impulses: new fields.HTMLField(),
|
||||||
potentialAdversaries: new fields.StringField({})
|
difficulty: new fields.NumberField({ required: true, initial: 11, integer: true }),
|
||||||
|
potentialAdversaries: new fields.TypedObjectField(
|
||||||
|
new fields.SchemaField({
|
||||||
|
label: new fields.StringField(),
|
||||||
|
adversaries: new fields.TypedObjectField(new ForeignDocumentUUIDField({ type: 'Actor' }))
|
||||||
|
})
|
||||||
|
)
|
||||||
|
/* Features pending datamodel rework */
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
get features() {
|
|
||||||
return this.parent.items.filter(x => x.type === 'feature');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ export default class RegisterHandlebarsHelpers {
|
||||||
includes: this.includes,
|
includes: this.includes,
|
||||||
debug: this.debug,
|
debug: this.debug,
|
||||||
signedNumber: this.signedNumber,
|
signedNumber: this.signedNumber,
|
||||||
|
length: this.length,
|
||||||
switch: this.switch,
|
switch: this.switch,
|
||||||
case: this.case
|
case: this.case
|
||||||
});
|
});
|
||||||
|
|
@ -82,6 +83,10 @@ export default class RegisterHandlebarsHelpers {
|
||||||
return number >= 0 ? `+${number}` : number;
|
return number >= 0 ? `+${number}` : number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static length(obj) {
|
||||||
|
return Object.keys(obj).length;
|
||||||
|
}
|
||||||
|
|
||||||
static switch(value, options) {
|
static switch(value, options) {
|
||||||
this.switch_value = value;
|
this.switch_value = value;
|
||||||
this.switch_break = false;
|
this.switch_break = false;
|
||||||
|
|
|
||||||
|
|
@ -2593,6 +2593,28 @@ div.daggerheart.views.multiclass {
|
||||||
width: 40px;
|
width: 40px;
|
||||||
background: white;
|
background: white;
|
||||||
}
|
}
|
||||||
|
.daggerheart.sheet.actor.environment .potential-adversary-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
}
|
||||||
|
.daggerheart.sheet.actor.environment .potential-adversary-container .adversary-placeholder {
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
.daggerheart.sheet.actor.environment .potential-adversary-container .adversaries-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.daggerheart.sheet.actor.environment .potential-adversary-container .adversaries-container .adversary-container {
|
||||||
|
border: 1px solid var(--color-dark-5);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0 2px;
|
||||||
|
font-weight: bold;
|
||||||
|
cursor: pointer;
|
||||||
|
background-image: url(../assets/parchments/dh-parchment-dark.png);
|
||||||
|
color: var(--color-light-3);
|
||||||
|
}
|
||||||
.daggerheart.sheet .title-container {
|
.daggerheart.sheet .title-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
|
|
@ -3354,6 +3376,9 @@ div.daggerheart.views.multiclass {
|
||||||
grid-template-columns: 1fr 2fr;
|
grid-template-columns: 1fr 2fr;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
}
|
}
|
||||||
|
.application.sheet.dh-style fieldset.two-columns.even {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
.application.sheet.dh-style fieldset legend {
|
.application.sheet.dh-style fieldset legend {
|
||||||
font-family: 'Montserrat', sans-serif;
|
font-family: 'Montserrat', sans-serif;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,10 @@
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 2fr;
|
grid-template-columns: 1fr 2fr;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
|
&.even {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
legend {
|
legend {
|
||||||
|
|
|
||||||
27
styles/sheets/environment.less
Normal file
27
styles/sheets/environment.less
Normal file
|
|
@ -0,0 +1,27 @@
|
||||||
|
.daggerheart.sheet.actor.environment {
|
||||||
|
.potential-adversary-container {
|
||||||
|
width: 100%;
|
||||||
|
height: 50px;
|
||||||
|
|
||||||
|
.adversary-placeholder {
|
||||||
|
font-style: italic;
|
||||||
|
text-align: center;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.adversaries-container {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
.adversary-container {
|
||||||
|
border: 1px solid var(--color-dark-5);
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 0 2px;
|
||||||
|
font-weight: bold;
|
||||||
|
cursor: pointer;
|
||||||
|
background-image: url(../assets/parchments/dh-parchment-dark.png);
|
||||||
|
color: var(--color-light-3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
@import './heritage.less';
|
@import './heritage.less';
|
||||||
@import './class.less';
|
@import './class.less';
|
||||||
@import './adversary.less';
|
@import './adversary.less';
|
||||||
|
@import './environment.less';
|
||||||
|
|
||||||
.daggerheart.sheet {
|
.daggerheart.sheet {
|
||||||
.title-container {
|
.title-container {
|
||||||
|
|
|
||||||
16
system.json
16
system.json
|
|
@ -163,10 +163,7 @@
|
||||||
"name": "Daggerheart",
|
"name": "Daggerheart",
|
||||||
"sorting": "m",
|
"sorting": "m",
|
||||||
"color": "#08718c",
|
"color": "#08718c",
|
||||||
"packs": [
|
"packs": ["adversaries", "environments"],
|
||||||
"adversaries",
|
|
||||||
"environments"
|
|
||||||
],
|
|
||||||
"folders": [
|
"folders": [
|
||||||
{
|
{
|
||||||
"name": "Character Options",
|
"name": "Character Options",
|
||||||
|
|
@ -186,12 +183,7 @@
|
||||||
"name": "Items",
|
"name": "Items",
|
||||||
"sorting": "m",
|
"sorting": "m",
|
||||||
"color": "#000000",
|
"color": "#000000",
|
||||||
"packs": [
|
"packs": ["weapons", "armors", "consumables", "general-items"]
|
||||||
"weapons",
|
|
||||||
"armors",
|
|
||||||
"consumables",
|
|
||||||
"general-items"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
@ -213,7 +205,9 @@
|
||||||
"Actor": {
|
"Actor": {
|
||||||
"pc": {},
|
"pc": {},
|
||||||
"adversary": {},
|
"adversary": {},
|
||||||
"environment": {}
|
"environment": {
|
||||||
|
"htmlFields": ["description", "impulses"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"Item": {
|
"Item": {
|
||||||
"ancestry": {
|
"ancestry": {
|
||||||
|
|
|
||||||
9
templates/sheets/actors/environment/header.hbs
Normal file
9
templates/sheets/actors/environment/header.hbs
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<header class='item-card-header'>
|
||||||
|
<img class='profile' src='{{source.img}}' data-action='editImage' data-edit='img' />
|
||||||
|
<div class='item-info'>
|
||||||
|
<h1 class='item-name'><input type='text' name='name' value='{{source.name}}' /></h1>
|
||||||
|
<div class='item-description'>
|
||||||
|
<h3>{{localize 'TYPES.Actor.environment'}}</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
16
templates/sheets/actors/environment/information.hbs
Normal file
16
templates/sheets/actors/environment/information.hbs
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
<section
|
||||||
|
class='tab {{tabs.information.cssClass}} {{tabs.information.id}}'
|
||||||
|
data-tab='{{tabs.information.id}}'
|
||||||
|
data-group='{{tabs.information.group}}'
|
||||||
|
>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "DAGGERHEART.Sheets.Environment.description"}}</legend>
|
||||||
|
|
||||||
|
{{formInput systemFields.description value=source.system.description }}
|
||||||
|
</fieldset>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "DAGGERHEART.Sheets.Environment.impulses"}}</legend>
|
||||||
|
|
||||||
|
{{formInput systemFields.impulses value=source.system.impulses }}
|
||||||
|
</fieldset>
|
||||||
|
</section>
|
||||||
37
templates/sheets/actors/environment/main.hbs
Normal file
37
templates/sheets/actors/environment/main.hbs
Normal file
|
|
@ -0,0 +1,37 @@
|
||||||
|
<section
|
||||||
|
class='tab {{tabs.main.cssClass}} {{tabs.main.id}}'
|
||||||
|
data-tab='{{tabs.main.id}}'
|
||||||
|
data-group='{{tabs.main.group}}'
|
||||||
|
>
|
||||||
|
<fieldset class="two-columns even">
|
||||||
|
<legend>{{localize "DAGGERHEART.Sheets.Environment.general"}}</legend>
|
||||||
|
|
||||||
|
{{formGroup systemFields.tier value=source.system.tier localize=true }}
|
||||||
|
{{formGroup systemFields.type value=source.system.type localize=true }}
|
||||||
|
{{formGroup systemFields.difficulty value=source.system.difficulty localize=true }}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="one-column">
|
||||||
|
<legend>{{localize "DAGGERHEART.Sheets.Environment.potentialAdversaries.label"}}<a><i class="fa-solid fa-plus icon-button" data-action="addAdversary"></i></a></legend>
|
||||||
|
|
||||||
|
{{#each source.system.potentialAdversaries}}
|
||||||
|
<fieldset class="potential-adversary-container" data-potential-adversary="{{@key}}">
|
||||||
|
<legend><input name="{{concat "system.potentialAdversaries." id ".label" }}" value="{{this.label}}" /><i class="fa-solid fa-trash" data-action="deleteProperty" data-path="system.potentialAdversaries" id={{@key}}></i></legend>
|
||||||
|
{{#if (eq (length this.adversaries) 0)}}
|
||||||
|
<div class="adversary-placeholder">{{localize "DAGGERHEART.Sheets.Environment.potentialAdversaries.placeholder"}}</div>
|
||||||
|
{{else}}
|
||||||
|
<div class="adversaries-container">
|
||||||
|
{{#each this.adversaries as |adversary id|}}
|
||||||
|
<div class="adversary-container" data-action="viewAdversary" data-potential-adversary="{{@../key}}" data-adversary="{{id}}">{{adversary.name}}</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
{{/if}}
|
||||||
|
</fieldset>
|
||||||
|
{{/each}}
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset class="one-column">
|
||||||
|
<legend>{{localize "DAGGERHEART.Sheets.Environment.features.label"}}<a><i class="fa-solid fa-plus icon-button" data-action="addFeature"></i></a></legend>
|
||||||
|
|
||||||
|
</fieldset>
|
||||||
|
</section>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue