mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
Merged with main
This commit is contained in:
commit
b6f78c5102
19 changed files with 764 additions and 125 deletions
|
|
@ -304,6 +304,7 @@ const preloadHandlebarsTemplates = async function () {
|
||||||
'systems/daggerheart/templates/views/actionTypes/roll.hbs',
|
'systems/daggerheart/templates/views/actionTypes/roll.hbs',
|
||||||
'systems/daggerheart/templates/views/actionTypes/cost.hbs',
|
'systems/daggerheart/templates/views/actionTypes/cost.hbs',
|
||||||
'systems/daggerheart/templates/views/actionTypes/range-target.hbs',
|
'systems/daggerheart/templates/views/actionTypes/range-target.hbs',
|
||||||
'systems/daggerheart/templates/views/actionTypes/effect.hbs'
|
'systems/daggerheart/templates/views/actionTypes/effect.hbs',
|
||||||
|
'systems/daggerheart/templates/settings/components/settings-item-line.hbs'
|
||||||
]);
|
]);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
69
lang/en.json
69
lang/en.json
|
|
@ -87,6 +87,11 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Homebrew": {
|
"Homebrew": {
|
||||||
|
"NewDowntimeMove": "Downtime Move",
|
||||||
|
"DowntimeMoves": "Downtime Moves",
|
||||||
|
"NrChoices": "# Moves Per Rest",
|
||||||
|
"ResetMovesTitle": "Reset {type} Downtime Moves",
|
||||||
|
"ResetMovesText": "Are you sure you want to reset?",
|
||||||
"FIELDS": {
|
"FIELDS": {
|
||||||
"maxFear": { "label": "Max Fear" },
|
"maxFear": { "label": "Max Fear" },
|
||||||
"traitArray": { "label": "Initial Trait Modifiers" }
|
"traitArray": { "label": "Initial Trait Modifiers" }
|
||||||
|
|
@ -499,29 +504,51 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Downtime": {
|
"Downtime": {
|
||||||
"TendToWounds": {
|
"DowntimeHeader": "Downtime Moves ({current}/{max})",
|
||||||
"Name": "Tend to Wounds",
|
"ShortRest": {
|
||||||
"Description": "Describe how you patch yourself up and remove all marked Hit Points. You may also do this on an ally instead."
|
"title": "Short Rest",
|
||||||
|
"TendToWounds": {
|
||||||
|
"Name": "Tend to Wounds",
|
||||||
|
"Description": "Describe how you hastily patch yourself up, then clear a number of Hit Points equal to 1d4 + your tier. You can do this to an ally instead."
|
||||||
|
},
|
||||||
|
"ClearStress": {
|
||||||
|
"Name": "Clear Stress",
|
||||||
|
"Description": "Describe how you blow off steam or pull yourself together, then clear a number of Stress equal to 1d4 + your tier."
|
||||||
|
},
|
||||||
|
"RepairArmor": {
|
||||||
|
"Name": "Repair Armor",
|
||||||
|
"Description": "Describe how you quickly repair your armor, then clear a number of Armor Slots equal to 1d4 + your tier. You can do this to an ally's armor instead."
|
||||||
|
},
|
||||||
|
"Prepare": {
|
||||||
|
"Name": "Prepare",
|
||||||
|
"Description": "Describe how you prepare yourself for the path ahead, then gain a Hope. If you choose to Prepare with one or more members of your party, you each gain 2 Hope."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"ClearStress": {
|
"LongRest": {
|
||||||
"Name": "Clear Stress",
|
"title": "Long Rest",
|
||||||
"Description": "Describe how you blow off steam or pull yourself together, and clear all marked Stress."
|
"TendToWounds": {
|
||||||
|
"Name": "Tend to Wounds",
|
||||||
|
"Description": "Describe how you patch yourself up and remove all marked Hit Points. You may also do this on an ally instead."
|
||||||
|
},
|
||||||
|
"ClearStress": {
|
||||||
|
"Name": "Clear Stress",
|
||||||
|
"Description": "Describe how you blow off steam or pull yourself together, and clear all marked Stress."
|
||||||
|
},
|
||||||
|
"RepairArmor": {
|
||||||
|
"Name": "Repair Armor",
|
||||||
|
"Description": "Describe how you spend time repairing your armor and clear all of its Armor Slots. You may also do this to an ally's armor instead."
|
||||||
|
},
|
||||||
|
"Prepare": {
|
||||||
|
"Name": "Prepare",
|
||||||
|
"Description": "Describe how you are preparing for the next day's adventure, then gain a Hope. If you choose to Prepare with one or more members of your party, you may each take two Hope."
|
||||||
|
},
|
||||||
|
"WorkOnAProject": {
|
||||||
|
"Name": "Work on a Project",
|
||||||
|
"Description": "Establish or continue work on a project."
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"RepairArmor": {
|
"Notifications": {
|
||||||
"Name": "Repair Armor",
|
"NoMoreMoves": "You cannot select any more downtime moves"
|
||||||
"Description": "Describe how you spend time repairing your armor and clear all of its Armor Slots. You may also do this to an ally’s armor instead."
|
|
||||||
},
|
|
||||||
"Prepare": {
|
|
||||||
"Name": "Prepare",
|
|
||||||
"Description": "Describe how you are preparing for the next day’s adventure, then gain a Hope. If you choose to Prepare with one or more members of your party, you may each take two Hope."
|
|
||||||
},
|
|
||||||
"WorkOnAProject": {
|
|
||||||
"Name": "Work on a Project",
|
|
||||||
"Description": "Establish or continue work on a project. The GM might ask for a roll to determine how much to tick down on the completion track."
|
|
||||||
},
|
|
||||||
"Custom": {
|
|
||||||
"NamePlaceholder": "Custom Activity...",
|
|
||||||
"Placeholder": "A custom downtime activity description..."
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"DeathMoves": {
|
"DeathMoves": {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { actionsTypes } from '../data/_module.mjs';
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV2) {
|
export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
|
@ -5,25 +7,25 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
||||||
super({});
|
super({});
|
||||||
|
|
||||||
this.actor = actor;
|
this.actor = actor;
|
||||||
this.selectedActivity = null;
|
|
||||||
this.shortrest = shortrest;
|
this.shortrest = shortrest;
|
||||||
|
|
||||||
this.customActivity = SYSTEM.GENERAL.downtime.custom;
|
const options = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).restMoves;
|
||||||
|
this.moveData = shortrest ? options.shortRest : options.longRest;
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
return `${this.actor.name} - ${this.shortrest ? 'Short Rest' : 'Long Rest'}`;
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
static DEFAULT_OPTIONS = {
|
static DEFAULT_OPTIONS = {
|
||||||
tag: 'form',
|
tag: 'form',
|
||||||
classes: ['daggerheart', 'views', 'downtime'],
|
classes: ['daggerheart', 'views', 'downtime'],
|
||||||
position: { width: 800, height: 'auto' },
|
position: { width: 680, height: 'auto' },
|
||||||
actions: {
|
actions: {
|
||||||
selectActivity: this.selectActivity,
|
selectMove: this.selectMove,
|
||||||
takeDowntime: this.takeDowntime
|
takeDowntime: this.takeDowntime
|
||||||
},
|
},
|
||||||
form: { handler: this.updateData, submitOnChange: true }
|
form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false }
|
||||||
};
|
};
|
||||||
|
|
||||||
static PARTS = {
|
static PARTS = {
|
||||||
|
|
@ -33,51 +35,63 @@ export default class DhpDowntime extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_attachPartListeners(partId, htmlElement, options) {
|
||||||
|
super._attachPartListeners(partId, htmlElement, options);
|
||||||
|
|
||||||
|
htmlElement
|
||||||
|
.querySelectorAll('.activity-image')
|
||||||
|
.forEach(element => element.addEventListener('contextmenu', this.deselectMove.bind(this)));
|
||||||
|
}
|
||||||
|
|
||||||
async _prepareContext(_options) {
|
async _prepareContext(_options) {
|
||||||
const context = await super._prepareContext(_options);
|
const context = await super._prepareContext(_options);
|
||||||
context.selectedActivity = this.selectedActivity;
|
context.selectedActivity = this.selectedActivity;
|
||||||
context.options = this.shortrest ? SYSTEM.GENERAL.downtime.shortRest : SYSTEM.GENERAL.downtime.longRest;
|
context.moveData = this.moveData;
|
||||||
context.customActivity = this.customActivity;
|
context.nrCurrentChoices = Object.values(this.moveData.moves).reduce((acc, x) => acc + (x.selected ?? 0), 0);
|
||||||
|
context.disabledDowntime = context.nrCurrentChoices < context.moveData.nrChoices;
|
||||||
context.disabledDowntime =
|
|
||||||
!this.selectedActivity ||
|
|
||||||
(this.selectedActivity.id === this.customActivity.id &&
|
|
||||||
(!this.customActivity.name || !this.customActivity.description));
|
|
||||||
|
|
||||||
return context;
|
return context;
|
||||||
}
|
}
|
||||||
|
|
||||||
static selectActivity(_, button) {
|
static selectMove(_, button) {
|
||||||
const activity = button.dataset.activity;
|
const nrSelected = Object.values(this.moveData.moves).reduce((acc, x) => acc + (x.selected ?? 0), 0);
|
||||||
this.selectedActivity =
|
if (nrSelected === this.moveData.nrChoices) {
|
||||||
activity === this.customActivity.id
|
ui.notifications.error(game.i18n.localize('DAGGERHEART.Downtime.Notifications.NoMoreMoves'));
|
||||||
? this.customActivity
|
return;
|
||||||
: this.shortrest
|
}
|
||||||
? SYSTEM.GENERAL.downtime.shortRest[activity]
|
|
||||||
: SYSTEM.GENERAL.downtime.longRest[activity];
|
const move = button.dataset.move;
|
||||||
|
this.moveData.moves[move].selected = this.moveData.moves[move].selected
|
||||||
|
? this.moveData.moves[move].selected + 1
|
||||||
|
: 1;
|
||||||
|
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
deselectMove(event) {
|
||||||
|
const move = event.currentTarget.dataset.move;
|
||||||
|
this.moveData.moves[move].selected = this.moveData.moves[move].selected
|
||||||
|
? this.moveData.moves[move].selected - 1
|
||||||
|
: 0;
|
||||||
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async takeDowntime() {
|
static async takeDowntime() {
|
||||||
const refreshedFeatures = this.shortrest
|
const moves = Object.values(this.moveData.moves).filter(x => x.selected);
|
||||||
? this.actor.system.refreshableFeatures.shortRest
|
|
||||||
: [...this.actor.system.refreshableFeatures.shortRest, ...this.actor.system.refreshableFeatures.longRest];
|
|
||||||
for (var feature of refreshedFeatures) {
|
|
||||||
await feature.system.refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
const cls = getDocumentClass('ChatMessage');
|
||||||
const msg = new cls({
|
const msg = new cls({
|
||||||
user: game.user.id,
|
user: game.user.id,
|
||||||
|
system: {
|
||||||
|
moves: moves,
|
||||||
|
actor: this.actor.uuid
|
||||||
|
},
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
content: await foundry.applications.handlebars.renderTemplate(
|
||||||
'systems/daggerheart/templates/chat/downtime.hbs',
|
'systems/daggerheart/templates/chat/downtime.hbs',
|
||||||
{
|
{
|
||||||
player: this.actor.name,
|
title: `${this.actor.name} - ${game.i18n.localize(`DAGGERHEART.Downtime.${this.shortRest ? 'ShortRest' : 'LongRest'}.title`)}`,
|
||||||
title: game.i18n.localize(this.selectedActivity.name),
|
moves: moves
|
||||||
img: this.selectedActivity.img,
|
|
||||||
description: game.i18n.localize(this.selectedActivity.description),
|
|
||||||
refreshedFeatures: refreshedFeatures
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
});
|
});
|
||||||
|
|
|
||||||
144
module/applications/settings/components/settingsActionsView.mjs
Normal file
144
module/applications/settings/components/settingsActionsView.mjs
Normal file
|
|
@ -0,0 +1,144 @@
|
||||||
|
import { actionsTypes } from '../../../data/_module.mjs';
|
||||||
|
import DHActionConfig from '../../config/Action.mjs';
|
||||||
|
|
||||||
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
|
export default class DhSettingsActionView extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
|
constructor(resolve, reject, title, name, img, description, actions) {
|
||||||
|
super({});
|
||||||
|
|
||||||
|
this.resolve = resolve;
|
||||||
|
this.reject = reject;
|
||||||
|
this.viewTitle = title;
|
||||||
|
this.name = name;
|
||||||
|
this.img = img;
|
||||||
|
this.description = description;
|
||||||
|
this.actions = actions;
|
||||||
|
}
|
||||||
|
|
||||||
|
get title() {
|
||||||
|
return this.viewTitle;
|
||||||
|
}
|
||||||
|
|
||||||
|
static DEFAULT_OPTIONS = {
|
||||||
|
tag: 'form',
|
||||||
|
classes: ['daggerheart', 'setting', 'dh-style'],
|
||||||
|
position: { width: '400', height: 'auto' },
|
||||||
|
actions: {
|
||||||
|
editImage: this.onEditImage,
|
||||||
|
addItem: this.addItem,
|
||||||
|
editItem: this.editItem,
|
||||||
|
removeItem: this.removeItem,
|
||||||
|
resetMoves: this.resetMoves,
|
||||||
|
saveForm: this.saveForm
|
||||||
|
},
|
||||||
|
form: { handler: this.updateData, submitOnChange: true, closeOnSubmit: false }
|
||||||
|
};
|
||||||
|
|
||||||
|
static PARTS = {
|
||||||
|
header: { template: 'systems/daggerheart/templates/settings/components/action-view-header.hbs' },
|
||||||
|
main: {
|
||||||
|
template: 'systems/daggerheart/templates/settings/components/action-view.hbs'
|
||||||
|
},
|
||||||
|
footer: { template: 'systems/daggerheart/templates/settings/components/action-view-footer.hbs' }
|
||||||
|
};
|
||||||
|
|
||||||
|
async _prepareContext(_options) {
|
||||||
|
const context = await super._prepareContext(_options);
|
||||||
|
context.name = this.name;
|
||||||
|
context.img = this.img;
|
||||||
|
context.description = this.description;
|
||||||
|
context.enrichedDescription = await foundry.applications.ux.TextEditor.enrichHTML(context.description);
|
||||||
|
context.actions = this.actions;
|
||||||
|
|
||||||
|
return context;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async updateData(event, element, formData) {
|
||||||
|
const { name, img, description } = foundry.utils.expandObject(formData.object);
|
||||||
|
this.name = name;
|
||||||
|
this.description = description;
|
||||||
|
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async saveForm(event) {
|
||||||
|
this.resolve({
|
||||||
|
name: this.name,
|
||||||
|
img: this.img,
|
||||||
|
description: this.description,
|
||||||
|
actions: this.actions
|
||||||
|
});
|
||||||
|
this.close(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static close(fromSave) {
|
||||||
|
if (!fromSave) {
|
||||||
|
this.reject();
|
||||||
|
}
|
||||||
|
|
||||||
|
super.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
static onEditImage() {
|
||||||
|
const fp = new FilePicker({
|
||||||
|
current: this.img,
|
||||||
|
type: 'image',
|
||||||
|
callback: async path => {
|
||||||
|
this.img = path;
|
||||||
|
this.render();
|
||||||
|
},
|
||||||
|
top: this.position.top + 40,
|
||||||
|
left: this.position.left + 10
|
||||||
|
});
|
||||||
|
return fp.browse();
|
||||||
|
}
|
||||||
|
|
||||||
|
async selectActionType() {
|
||||||
|
const content = await foundry.applications.handlebars.renderTemplate(
|
||||||
|
'systems/daggerheart/templates/views/actionType.hbs',
|
||||||
|
{ types: SYSTEM.ACTIONS.actionTypes }
|
||||||
|
),
|
||||||
|
title = 'Select Action Type',
|
||||||
|
type = 'form',
|
||||||
|
data = {};
|
||||||
|
return Dialog.prompt({
|
||||||
|
title,
|
||||||
|
label: title,
|
||||||
|
content,
|
||||||
|
type,
|
||||||
|
callback: html => {
|
||||||
|
const form = html[0].querySelector('form'),
|
||||||
|
fd = new foundry.applications.ux.FormDataExtended(form);
|
||||||
|
foundry.utils.mergeObject(data, fd.object, { inplace: true });
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
rejectClose: false
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static async addItem() {
|
||||||
|
const actionType = await this.selectActionType();
|
||||||
|
const cls = actionsTypes[actionType?.type] ?? actionsTypes.attack,
|
||||||
|
action = new cls({
|
||||||
|
_id: foundry.utils.randomID(),
|
||||||
|
type: actionType.type,
|
||||||
|
name: game.i18n.localize(SYSTEM.ACTIONS.actionTypes[actionType.type].name),
|
||||||
|
...cls.getSourceConfig(this.document)
|
||||||
|
});
|
||||||
|
|
||||||
|
this.actions.push(action);
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async editItem(_, button) {
|
||||||
|
await new DHActionConfig(this.actions[button.dataset.id]).render(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
static removeItem(event, button) {
|
||||||
|
this.actions = this.actions.filter((_, index) => index !== Number.parseInt(button.dataset.id));
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static resetMoves() {}
|
||||||
|
}
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
import { DhHomebrew } from '../../data/settings/_module.mjs';
|
import { DhHomebrew } from '../../data/settings/_module.mjs';
|
||||||
|
import DhSettingsActionView from './components/settingsActionsView.mjs';
|
||||||
|
|
||||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
export default class DhAutomationSettings extends HandlebarsApplicationMixin(ApplicationV2) {
|
export default class DhHomebrewSettings extends HandlebarsApplicationMixin(ApplicationV2) {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({});
|
super({});
|
||||||
|
|
||||||
|
|
@ -19,7 +20,10 @@ export default class DhAutomationSettings extends HandlebarsApplicationMixin(App
|
||||||
classes: ['daggerheart', 'setting', 'dh-style'],
|
classes: ['daggerheart', 'setting', 'dh-style'],
|
||||||
position: { width: '600', height: 'auto' },
|
position: { width: '600', height: 'auto' },
|
||||||
actions: {
|
actions: {
|
||||||
reset: this.reset,
|
addItem: this.addItem,
|
||||||
|
editItem: this.editItem,
|
||||||
|
removeItem: this.removeItem,
|
||||||
|
resetMoves: this.resetMoves,
|
||||||
save: this.save
|
save: this.save
|
||||||
},
|
},
|
||||||
form: { handler: this.updateData, submitOnChange: true }
|
form: { handler: this.updateData, submitOnChange: true }
|
||||||
|
|
@ -48,8 +52,101 @@ export default class DhAutomationSettings extends HandlebarsApplicationMixin(App
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
static async reset() {
|
static async addItem(_, target) {
|
||||||
this.settings = new DhHomebrew();
|
await this.settings.updateSource({
|
||||||
|
[`restMoves.${target.dataset.type}.moves.${foundry.utils.randomID()}`]: {
|
||||||
|
name: game.i18n.localize('DAGGERHEART.Settings.Homebrew.NewDowntimeMove'),
|
||||||
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
|
description: '',
|
||||||
|
actions: []
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async editItem(_, target) {
|
||||||
|
const move = this.settings.restMoves[target.dataset.type].moves[target.dataset.id];
|
||||||
|
new Promise((resolve, reject) => {
|
||||||
|
new DhSettingsActionView(
|
||||||
|
resolve,
|
||||||
|
reject,
|
||||||
|
game.i18n.localize('DAGGERHEART.Settings.Homebrew.DowntimeMoves'),
|
||||||
|
move.name,
|
||||||
|
move.img,
|
||||||
|
move.description,
|
||||||
|
move.actions
|
||||||
|
).render(true);
|
||||||
|
}).then(data => this.updateAction.bind(this)(data, target.dataset.type, target.dataset.id));
|
||||||
|
}
|
||||||
|
|
||||||
|
async updateAction(data, type, id) {
|
||||||
|
await this.settings.updateSource({
|
||||||
|
[`restMoves.${type}.moves.${id}`]: {
|
||||||
|
name: data.name,
|
||||||
|
img: data.img,
|
||||||
|
description: data.description
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async removeItem(_, target) {
|
||||||
|
await this.settings.updateSource({
|
||||||
|
[`restMoves.${target.dataset.type}.moves.-=${target.dataset.id}`]: null
|
||||||
|
});
|
||||||
|
this.render();
|
||||||
|
}
|
||||||
|
|
||||||
|
static async resetMoves(_, target) {
|
||||||
|
const confirmed = await foundry.applications.api.DialogV2.confirm({
|
||||||
|
window: {
|
||||||
|
title: game.i18n.format('DAGGERHEART.Settings.Homebrew.ResetMovesTitle', {
|
||||||
|
type: game.i18n.localize(
|
||||||
|
`DAGGERHEART.Downtime.${target.dataset.type === 'shortRest' ? 'ShortRest' : 'LongRest'}.title`
|
||||||
|
)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
content: game.i18n.localize('DAGGERHEART.Settings.Homebrew.ResetMovesText')
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!confirmed) return;
|
||||||
|
|
||||||
|
const fields = game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Homebrew).schema.fields;
|
||||||
|
|
||||||
|
const removeUpdate = Object.keys(this.settings.restMoves[target.dataset.type].moves).reduce((acc, key) => {
|
||||||
|
acc[`-=${key}`] = null;
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
const updateBase =
|
||||||
|
target.dataset.type === 'shortRest'
|
||||||
|
? fields.restMoves.fields.shortRest.fields
|
||||||
|
: fields.restMoves.fields.longRest.fields;
|
||||||
|
const update = {
|
||||||
|
nrChoices: updateBase.nrChoices.initial,
|
||||||
|
moves: Object.keys(updateBase.moves.initial).reduce((acc, key) => {
|
||||||
|
const move = updateBase.moves.initial[key];
|
||||||
|
acc[key] = {
|
||||||
|
...move,
|
||||||
|
name: game.i18n.localize(move.name),
|
||||||
|
description: game.i18n.localize(move.description)
|
||||||
|
};
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
};
|
||||||
|
|
||||||
|
await this.settings.updateSource({
|
||||||
|
[`restMoves.${target.dataset.type}`]: {
|
||||||
|
...update,
|
||||||
|
moves: {
|
||||||
|
...removeUpdate,
|
||||||
|
...update.moves
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,65 +101,99 @@ export const conditions = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const downtime = {
|
export const defaultRestOptions = {
|
||||||
shortRest: {
|
shortRest: () => ({
|
||||||
tendToWounds: {
|
tendToWounds: {
|
||||||
id: 'tendToWounds',
|
id: 'tendToWounds',
|
||||||
name: 'DAGGERHEART.Downtime.TendToWounds.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Name'),
|
||||||
img: 'icons/magic/life/cross-worn-green.webp',
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
description: 'DAGGERHEART.Downtime.TendToWounds.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Description'),
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'healing',
|
||||||
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.TendToWounds.Name'),
|
||||||
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
|
actionType: 'action',
|
||||||
|
healing: {
|
||||||
|
type: 'health',
|
||||||
|
value: {
|
||||||
|
custom: {
|
||||||
|
enabled: true,
|
||||||
|
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
clearStress: {
|
clearStress: {
|
||||||
id: 'clearStress',
|
id: 'clearStress',
|
||||||
name: 'DAGGERHEART.Downtime.ClearStress.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Name'),
|
||||||
img: 'icons/magic/perception/eye-ringed-green.webp',
|
img: 'icons/magic/perception/eye-ringed-green.webp',
|
||||||
description: 'DAGGERHEART.Downtime.ClearStress.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Description'),
|
||||||
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'healing',
|
||||||
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.ClearStress.Name'),
|
||||||
|
img: 'icons/magic/perception/eye-ringed-green.webp',
|
||||||
|
actionType: 'action',
|
||||||
|
healing: {
|
||||||
|
type: 'stress',
|
||||||
|
value: {
|
||||||
|
custom: {
|
||||||
|
enabled: true,
|
||||||
|
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
repairArmor: {
|
repairArmor: {
|
||||||
id: 'repairArmor',
|
id: 'repairArmor',
|
||||||
name: 'DAGGERHEART.Downtime.RepairArmor.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.RepairArmor.Name'),
|
||||||
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
||||||
description: 'DAGGERHEART.Downtime.RepairArmor.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.RepairArmor.Description')
|
||||||
},
|
},
|
||||||
prepare: {
|
prepare: {
|
||||||
id: 'prepare',
|
id: 'prepare',
|
||||||
name: 'DAGGERHEART.Downtime.Prepare.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.Prepare.Name'),
|
||||||
img: 'icons/skills/trades/academics-merchant-scribe.webp',
|
img: 'icons/skills/trades/academics-merchant-scribe.webp',
|
||||||
description: 'DAGGERHEART.Downtime.Prepare.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.ShortRest.Prepare.Description')
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
longRest: {
|
longRest: () => ({
|
||||||
tendToWounds: {
|
tendToWounds: {
|
||||||
id: 'tendToWounds',
|
id: 'tendToWounds',
|
||||||
name: 'DAGGERHEART.Downtime.TendToWounds.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.TendToWounds.Name'),
|
||||||
img: 'icons/magic/life/cross-worn-green.webp',
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
description: 'DAGGERHEART.Downtime.TendToWounds.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.TendToWounds.Description')
|
||||||
},
|
},
|
||||||
clearStress: {
|
clearStress: {
|
||||||
id: 'clearStress',
|
id: 'clearStress',
|
||||||
name: 'DAGGERHEART.Downtime.ClearStress.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.ClearStress.Name'),
|
||||||
img: 'icons/magic/perception/eye-ringed-green.webp',
|
img: 'icons/magic/perception/eye-ringed-green.webp',
|
||||||
description: 'DAGGERHEART.Downtime.ClearStress.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.ClearStress.Description')
|
||||||
},
|
},
|
||||||
repairArmor: {
|
repairArmor: {
|
||||||
id: 'repairArmor',
|
id: 'repairArmor',
|
||||||
name: 'DAGGERHEART.Downtime.RepairArmor.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.RepairArmor.Name'),
|
||||||
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
||||||
description: 'DAGGERHEART.Downtime.RepairArmor.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.RepairArmor.Description')
|
||||||
},
|
},
|
||||||
prepare: {
|
prepare: {
|
||||||
id: 'prepare',
|
id: 'prepare',
|
||||||
name: 'DAGGERHEART.Downtime.Prepare.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.Prepare.Name'),
|
||||||
img: 'icons/skills/trades/academics-merchant-scribe.webp',
|
img: 'icons/skills/trades/academics-merchant-scribe.webp',
|
||||||
description: 'DAGGERHEART.Downtime.Prepare.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.Prepare.Description')
|
||||||
},
|
},
|
||||||
workOnAProject: {
|
workOnAProject: {
|
||||||
id: 'workOnAProject',
|
id: 'workOnAProject',
|
||||||
name: 'DAGGERHEART.Downtime.WorkOnAProject.Name',
|
name: game.i18n.localize('DAGGERHEART.Downtime.LongRest.WorkOnAProject.Name'),
|
||||||
img: 'icons/skills/social/thumbsup-approval-like.webp',
|
img: 'icons/skills/social/thumbsup-approval-like.webp',
|
||||||
description: 'DAGGERHEART.Downtime.WorkOnAProject.Description'
|
description: game.i18n.localize('DAGGERHEART.Downtime.LongRest.WorkOnAProject.Description')
|
||||||
}
|
}
|
||||||
},
|
}),
|
||||||
custom: {
|
custom: {
|
||||||
id: 'customActivity',
|
id: 'customActivity',
|
||||||
name: '',
|
name: '',
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,14 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get tier() {
|
||||||
|
return this.levelData.level.current === 1
|
||||||
|
? 1
|
||||||
|
: Object.values(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.LevelTiers).tiers).find(
|
||||||
|
tier => currentLevel >= tier.levels.start && currentLevel <= tier.levels.end
|
||||||
|
).tier;
|
||||||
|
}
|
||||||
|
|
||||||
get ancestry() {
|
get ancestry() {
|
||||||
return this.parent.items.find(x => x.type === 'ancestry') ?? null;
|
return this.parent.items.find(x => x.type === 'ancestry') ?? null;
|
||||||
}
|
}
|
||||||
|
|
@ -134,19 +142,6 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
: null;
|
: null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get refreshableFeatures() {
|
|
||||||
return this.parent.items.reduce(
|
|
||||||
(acc, x) => {
|
|
||||||
if (x.type === 'feature' && x.system.refreshData?.type === 'feature' && x.system.refreshData?.type) {
|
|
||||||
acc[x.system.refreshData.type].push(x);
|
|
||||||
}
|
|
||||||
|
|
||||||
return acc;
|
|
||||||
},
|
|
||||||
{ shortRest: [], longRest: [] }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
static async unequipBeforeEquip(itemToEquip) {
|
static async unequipBeforeEquip(itemToEquip) {
|
||||||
const primary = this.primaryWeapon,
|
const primary = this.primaryWeapon,
|
||||||
secondary = this.secondaryWeapon;
|
secondary = this.secondaryWeapon;
|
||||||
|
|
@ -242,6 +237,14 @@ export default class DhCharacter extends BaseDataActor {
|
||||||
this.evasion.total = (this.class?.evasion ?? 0) + this.evasion.bonus;
|
this.evasion.total = (this.class?.evasion ?? 0) + this.evasion.bonus;
|
||||||
this.proficiency.total = this.proficiency.value + this.proficiency.bonus;
|
this.proficiency.total = this.proficiency.value + this.proficiency.bonus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRollData() {
|
||||||
|
const data = super.getRollData();
|
||||||
|
return {
|
||||||
|
...data,
|
||||||
|
tier: this.tier
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class DhPCLevelData extends foundry.abstract.DataModel {
|
class DhPCLevelData extends foundry.abstract.DataModel {
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,7 @@ export default class DhHomebrew extends foundry.abstract.DataModel {
|
||||||
actions: new fields.ArrayField(new fields.ObjectField())
|
actions: new fields.ArrayField(new fields.ObjectField())
|
||||||
}),
|
}),
|
||||||
{ initial: defaultRestOptions.longRest() }
|
{ initial: defaultRestOptions.longRest() }
|
||||||
),
|
)
|
||||||
consequences: new fields.SchemaField({})
|
|
||||||
}),
|
}),
|
||||||
shortRest: new fields.SchemaField({
|
shortRest: new fields.SchemaField({
|
||||||
nrChoices: new fields.NumberField({ required: true, integer: true, min: 1, initial: 2 }),
|
nrChoices: new fields.NumberField({ required: true, integer: true, min: 1, initial: 2 }),
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import { actionsTypes } from '../data/_module.mjs';
|
||||||
|
|
||||||
export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog {
|
export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLog {
|
||||||
constructor() {
|
constructor() {
|
||||||
super();
|
super();
|
||||||
|
|
@ -38,6 +40,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
html.querySelectorAll('.ability-use-button').forEach(element =>
|
html.querySelectorAll('.ability-use-button').forEach(element =>
|
||||||
element.addEventListener('click', event => this.abilityUseButton.bind(this)(event, data.message))
|
element.addEventListener('click', event => this.abilityUseButton.bind(this)(event, data.message))
|
||||||
);
|
);
|
||||||
|
html.querySelectorAll('.action-use-button').forEach(element =>
|
||||||
|
element.addEventListener('click', event => this.actionUseButton.bind(this)(event, data.message))
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
setupHooks() {
|
setupHooks() {
|
||||||
|
|
@ -137,4 +142,16 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
const actor = game.actors.get(message.system.origin);
|
const actor = game.actors.get(message.system.origin);
|
||||||
await actor.useAction(action);
|
await actor.useAction(action);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
actionUseButton = async (_, message) => {
|
||||||
|
const parent = await foundry.utils.fromUuid(message.system.actor);
|
||||||
|
const testAction = Object.values(message.system.moves)[0].actions[0];
|
||||||
|
const cls = actionsTypes[testAction.type];
|
||||||
|
const action = new cls(
|
||||||
|
{ ...testAction, _id: foundry.utils.randomID(), name: game.i18n.localize(testAction.name) },
|
||||||
|
{ parent: parent }
|
||||||
|
);
|
||||||
|
|
||||||
|
action.use();
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -134,6 +134,12 @@ div.daggerheart.views.multiclass {
|
||||||
}
|
}
|
||||||
|
|
||||||
.downtime-container {
|
.downtime-container {
|
||||||
|
.downtime-header {
|
||||||
|
margin: 0;
|
||||||
|
color: light-dark(@dark-blue, @golden);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
.activity-container {
|
.activity-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -150,12 +156,32 @@ div.daggerheart.views.multiclass {
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-image {
|
.activity-image {
|
||||||
width: 120px;
|
width: 80px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 8px;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 8px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|
||||||
|
.activity-select-label {
|
||||||
|
position: absolute;
|
||||||
|
top: -9px;
|
||||||
|
font-size: 14px;
|
||||||
|
border: 1px solid light-dark(@dark-blue, @golden);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: light-dark(@beige, @dark);
|
||||||
|
background-image: url(../assets/parchments/dh-parchment-light.png);
|
||||||
|
padding: 0 8px;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
|
|
||||||
&:hover,
|
&:hover,
|
||||||
&.selected {
|
&.selected {
|
||||||
filter: drop-shadow(0 0 6px gold);
|
filter: drop-shadow(0 0 6px gold);
|
||||||
|
|
|
||||||
|
|
@ -1887,6 +1887,11 @@ div.daggerheart.views.multiclass {
|
||||||
.daggerheart.views.levelup .levelup-section .levelup-container .levelup-inner-container .levelup-posttext {
|
.daggerheart.views.levelup .levelup-section .levelup-container .levelup-inner-container .levelup-posttext {
|
||||||
padding: 8px 0;
|
padding: 8px 0;
|
||||||
}
|
}
|
||||||
|
.daggerheart.views .downtime-container .downtime-header {
|
||||||
|
margin: 0;
|
||||||
|
color: light-dark(#18162e, #f3c267);
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
.daggerheart.views .downtime-container .activity-container {
|
.daggerheart.views .downtime-container .activity-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
@ -1902,12 +1907,30 @@ div.daggerheart.views.multiclass {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image {
|
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image {
|
||||||
width: 120px;
|
width: 80px;
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-right: 8px;
|
||||||
border: 2px solid black;
|
border: 2px solid black;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
margin-right: 8px;
|
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image .activity-select-label {
|
||||||
|
position: absolute;
|
||||||
|
top: -9px;
|
||||||
|
font-size: 14px;
|
||||||
|
border: 1px solid light-dark(#18162e, #f3c267);
|
||||||
|
border-radius: 6px;
|
||||||
|
color: light-dark(#efe6d8, #222);
|
||||||
|
background-image: url(../assets/parchments/dh-parchment-light.png);
|
||||||
|
padding: 0 8px;
|
||||||
|
line-height: 1;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image img {
|
||||||
|
border-radius: 50%;
|
||||||
|
}
|
||||||
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image:hover,
|
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image:hover,
|
||||||
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image.selected {
|
.daggerheart.views .downtime-container .activity-container .activity-title .activity-image.selected {
|
||||||
filter: drop-shadow(0 0 6px gold);
|
filter: drop-shadow(0 0 6px gold);
|
||||||
|
|
@ -3155,6 +3178,83 @@ div.daggerheart.views.multiclass {
|
||||||
#resources:has(.fear-bar) {
|
#resources:has(.fear-bar) {
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
}
|
}
|
||||||
|
.daggerheart.dh-style.setting fieldset {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting fieldset.two-columns {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 2fr;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting fieldset.two-columns.even {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .setting-group-field {
|
||||||
|
white-space: nowrap;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-items {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-items .settings-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0 8px 0 0;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-items .settings-item .settings-sub-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-items .settings-item .settings-sub-item img {
|
||||||
|
width: 60px;
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-items .settings-item .settings-sub-item i {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header .profile {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
object-fit: cover;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header .item-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
text-align: center;
|
||||||
|
width: 80%;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header .item-info .item-name input[type='text'] {
|
||||||
|
font-size: 32px;
|
||||||
|
height: 42px;
|
||||||
|
text-align: center;
|
||||||
|
width: 90%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
outline: 2px solid transparent;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
}
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header .item-info .item-name input[type='text']:hover[type='text'],
|
||||||
|
.daggerheart.dh-style.setting .settings-item-header .item-info .item-name input[type='text']:focus[type='text'] {
|
||||||
|
box-shadow: none;
|
||||||
|
outline: 2px solid light-dark(#18162e, #f3c267);
|
||||||
|
}
|
||||||
.daggerheart.dh-style.setting .settings-col {
|
.daggerheart.dh-style.setting .settings-col {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,95 @@
|
||||||
.daggerheart.dh-style.setting {
|
.daggerheart.dh-style.setting {
|
||||||
|
fieldset {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 4px;
|
||||||
|
|
||||||
|
&.two-columns {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr 2fr;
|
||||||
|
gap: 10px;
|
||||||
|
|
||||||
|
&.even {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.setting-group-field {
|
||||||
|
white-space: nowrap;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-items {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
.settings-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
border: 1px solid;
|
||||||
|
border-radius: 8px;
|
||||||
|
padding: 0 8px 0 0;
|
||||||
|
|
||||||
|
.settings-sub-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 60px;
|
||||||
|
border-radius: 8px 0 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
i {
|
||||||
|
font-size: 18px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.settings-item-header {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.profile {
|
||||||
|
height: 100px;
|
||||||
|
width: 100px;
|
||||||
|
object-fit: cover;
|
||||||
|
box-sizing: border-box;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 5px;
|
||||||
|
text-align: center;
|
||||||
|
width: 80%;
|
||||||
|
|
||||||
|
.item-name input[type='text'] {
|
||||||
|
font-size: 32px;
|
||||||
|
height: 42px;
|
||||||
|
text-align: center;
|
||||||
|
width: 90%;
|
||||||
|
transition: all 0.3s ease;
|
||||||
|
outline: 2px solid transparent;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
|
||||||
|
&:hover[type='text'],
|
||||||
|
&:focus[type='text'] {
|
||||||
|
box-shadow: none;
|
||||||
|
outline: 2px solid light-dark(@dark-blue, @golden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.settings-col {
|
.settings-col {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,11 @@
|
||||||
<div class="daggerheart chat downtime">
|
<div class="daggerheart chat downtime">
|
||||||
<h2 class="downtime-title-container">
|
<h2 class="downtime-title-container">
|
||||||
<div>{{this.player}} {{localize "DAGGERHEART.Chat.Downtime.Title"}}</div>
|
<div>{{title}}</div>
|
||||||
<div class="downtime-subtitle">{{this.title}}</div>
|
|
||||||
</h2>
|
</h2>
|
||||||
<img class="downtime-image" src="{{this.img}}" />
|
{{#each moves}}
|
||||||
<div>{{{this.description}}}</div>
|
<strong>{{this.name}}</strong>
|
||||||
<div class="downtime-refresh-container">
|
<img class="downtime-image" src="{{this.img}}" />
|
||||||
<div class="refresh-title">Refreshed Features</div>
|
<div>{{{this.description}}}</div>
|
||||||
{{#each this.refreshedFeatures}}
|
{{#if (gt this.actions.length 0)}}<button class="action-use-button">{{localize "Action"}}</button>{{/if}}
|
||||||
<div class="refresh-inner-container">
|
{{/each}}
|
||||||
<div>{{this.name}}</div>
|
|
||||||
</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
3
templates/settings/components/action-view-footer.hbs
Normal file
3
templates/settings/components/action-view-footer.hbs
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
<section class='tab-form-footer'>
|
||||||
|
<button data-action="saveForm"><i class="fa-solid fa-floppy-disk"></i> {{localize "Save"}}</button>
|
||||||
|
</section>
|
||||||
6
templates/settings/components/action-view-header.hbs
Normal file
6
templates/settings/components/action-view-header.hbs
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
<header class='settings-item-header'>
|
||||||
|
<img class='profile' src='{{this.img}}' data-action='editImage' data-edit='img' />
|
||||||
|
<div class='item-info'>
|
||||||
|
<h1 class='item-name'><input type='text' name='name' value='{{this.name}}' /></h1>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
18
templates/settings/components/action-view.hbs
Normal file
18
templates/settings/components/action-view.hbs
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<div>
|
||||||
|
<fieldset>
|
||||||
|
<legend>{{localize "Description"}}</legend>
|
||||||
|
|
||||||
|
<prose-mirror name="description" value="{{description}}" toggled=true>
|
||||||
|
{{{ enrichedDescription }}}
|
||||||
|
</prose-mirror>
|
||||||
|
</fieldset>
|
||||||
|
{{!-- <fieldset>
|
||||||
|
<legend>{{localize "Actions"}} <a data-action="addItem"><i class="fa-solid fa-plus"></i></a></legend>
|
||||||
|
|
||||||
|
<div class="settings-items">
|
||||||
|
{{#each this.actions as |action index|}}
|
||||||
|
{{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" action type="actions" id=index }}
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</fieldset> --}}
|
||||||
|
</div>
|
||||||
22
templates/settings/components/settings-item-line.hbs
Normal file
22
templates/settings/components/settings-item-line.hbs
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<div class="settings-item">
|
||||||
|
<div class="settings-sub-item">
|
||||||
|
<img src="{{this.img}}" />
|
||||||
|
<div>{{this.name}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="settings-sub-item">
|
||||||
|
<a
|
||||||
|
data-action="editItem"
|
||||||
|
data-type="{{this.type}}"
|
||||||
|
data-id="{{this.id}}"
|
||||||
|
>
|
||||||
|
<i class="fa-solid fa-globe"></i>
|
||||||
|
</a>
|
||||||
|
<a
|
||||||
|
data-action="removeItem"
|
||||||
|
data-type="{{this.type}}"
|
||||||
|
data-id="{{this.id}}"
|
||||||
|
>
|
||||||
|
<i class='fas fa-trash'></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
@ -10,6 +10,52 @@
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<fieldset class="two-columns even">
|
||||||
|
<legend>{{localize "DAGGERHEART.Settings.Homebrew.DowntimeMoves"}}</legend>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
{{localize "DAGGERHEART.Downtime.LongRest.title"}}
|
||||||
|
<a data-action="addItem" data-type="longRest"><i class="fa-solid fa-plus"></i></a>
|
||||||
|
<a data-action="resetMoves" data-type="longRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<div class="form-group setting-group-field">
|
||||||
|
<label>{{localize "DAGGERHEART.Settings.Homebrew.NrChoices"}}</label>
|
||||||
|
<div class="form-fields">
|
||||||
|
<input type="text" name="restMoves.longRest.nrChoices" value="{{settingFields._source.restMoves.longRest.nrChoices}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-items">
|
||||||
|
{{#each settingFields._source.restMoves.longRest.moves as |move id|}}
|
||||||
|
{{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" this type="longRest" id=id }}
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<legend>
|
||||||
|
{{localize "DAGGERHEART.Downtime.ShortRest.title"}}
|
||||||
|
<a data-action="addItem" data-type="shortRest"><i class="fa-solid fa-plus"></i></a>
|
||||||
|
<a data-action="resetMoves" data-type="shortRest"><i class="fa-solid fa-arrow-rotate-left"></i></a>
|
||||||
|
</legend>
|
||||||
|
|
||||||
|
<div class="form-group setting-group-field">
|
||||||
|
<label>{{localize "DAGGERHEART.Settings.Homebrew.NrChoices"}}</label>
|
||||||
|
<div class="form-fields">
|
||||||
|
<input type="text" name="restMoves.shortRest.nrChoices" value="{{settingFields._source.restMoves.shortRest.nrChoices}}" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="settings-items">
|
||||||
|
{{#each settingFields._source.restMoves.shortRest.moves as |move id|}}
|
||||||
|
{{> "systems/daggerheart/templates/settings/components/settings-item-line.hbs" this type="shortRest" id=id }}
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
||||||
|
</fieldset>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
<footer class="form-footer">
|
<footer class="form-footer">
|
||||||
<button data-action="reset">
|
<button data-action="reset">
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,14 @@
|
||||||
<div>
|
<div>
|
||||||
<div class="downtime-container">
|
<div class="downtime-container">
|
||||||
{{#each this.options as |option key|}}
|
<h2 class="downtime-header">{{localize "DAGGERHEART.Downtime.DowntimeHeader" current=nrCurrentChoices max=moveData.nrChoices}}</h2>
|
||||||
|
{{#each moveData.moves as |move key|}}
|
||||||
<div class="activity-container">
|
<div class="activity-container">
|
||||||
<div class="activity-title">
|
<div class="activity-title">
|
||||||
<img class="activity-image {{#if (eq ../selectedActivity.id key)}}selected{{/if}}" src="{{option.img}}" data-action="selectActivity" data-activity="{{key}}" />
|
<div class="activity-image {{#if this.selected}}selected{{/if}}" data-action="selectMove" data-move="{{key}}">
|
||||||
|
{{#if this.selected}}<div class="activity-select-label">{{move.selected}}</div>{{/if}}
|
||||||
|
<img src="{{move.img}}" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<span class="activity-title-text">{{localize this.name}}</span>
|
<span class="activity-title-text">{{localize this.name}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="activity-body">
|
<div class="activity-body">
|
||||||
|
|
@ -11,18 +16,9 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
<div class="activity-container">
|
|
||||||
<div class="activity-title">
|
|
||||||
<img class="activity-image {{#if (eq selectedActivity this.customActivity)}}selected{{/if}}" src="{{this.customActivity.img}}" data-action="selectActivity" data-activity="{{this.customActivity.id}}" />
|
|
||||||
<input class="custom-name-input" type="text" name="name" value="{{this.customActivity.name}}" placeholder="{{localize this.customActivity.namePlaceholder}}" />
|
|
||||||
</div>
|
|
||||||
<div class="activity-body">
|
|
||||||
<textarea class="activity-text-area" name="description" placeholder="{{localize this.customActivity.placeholder}}">{{this.customActivity.description}}</textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<footer class="flexrow">
|
<footer class="flexrow">
|
||||||
<button data-action="takeDowntime" {{#if this.disabledDowntime}}disabled{{/if}}>{{localize "DAGGERHEART.Application.Downtime.TakeDowntime"}}</button>
|
<button type="button" data-action="close">{{localize "DAGGERHEART.Application.Cancel"}}</button>
|
||||||
<button data-action="close">{{localize "DAGGERHEART.Application.Cancel"}}</button>
|
<button type="button" data-action="takeDowntime" {{#if this.disabledDowntime}}disabled{{/if}}>{{localize "DAGGERHEART.Application.Downtime.TakeDowntime"}}</button>
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue