mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 12:11:07 +01:00
Merge branch 'main' into issue-64
This commit is contained in:
commit
2630b1411e
42 changed files with 2266 additions and 1408 deletions
|
|
@ -1,3 +1,6 @@
|
|||
import { DualityRollColor } from '../config/settingsConfig.mjs';
|
||||
import DhpDualityRoll from '../data/dualityRoll.mjs';
|
||||
|
||||
export default class DhpChatMesssage extends ChatMessage {
|
||||
async renderHTML() {
|
||||
if (
|
||||
|
|
@ -9,6 +12,20 @@ export default class DhpChatMesssage extends ChatMessage {
|
|||
this.content = await foundry.applications.handlebars.renderTemplate(this.content, this.system);
|
||||
}
|
||||
|
||||
return super.renderHTML();
|
||||
/* We can change to fully implementing the renderHTML function if needed, instead of augmenting it. */
|
||||
const html = await super.renderHTML();
|
||||
if (
|
||||
this.type === 'dualityRoll' &&
|
||||
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor) ===
|
||||
DualityRollColor.colorful.value
|
||||
) {
|
||||
html.classList.add('duality');
|
||||
const dualityResult = this.system.dualityResult;
|
||||
if (dualityResult === DhpDualityRoll.dualityResult.hope) html.classList.add('hope');
|
||||
else if (dualityResult === DhpDualityRoll.dualityResult.fear) html.classList.add('fear');
|
||||
else html.classList.add('critical');
|
||||
}
|
||||
|
||||
return html;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,9 @@ export default class DamageSelectionDialog extends HandlebarsApplicationMixin(Ap
|
|||
}
|
||||
}
|
||||
|
||||
static rollDamage() {
|
||||
static rollDamage(event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.resolve({
|
||||
rollString: this.getRollString(),
|
||||
bonusDamage: this.data.bonusDamage,
|
||||
|
|
|
|||
|
|
@ -1,3 +1,5 @@
|
|||
import { DualityRollColor } from '../config/settingsConfig.mjs';
|
||||
|
||||
class DhpAutomationSettings extends FormApplication {
|
||||
constructor(object = {}, options = {}) {
|
||||
super(object, options);
|
||||
|
|
@ -213,6 +215,16 @@ export const registerDHPSettings = () => {
|
|||
}
|
||||
});
|
||||
|
||||
game.settings.register(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.DualityRollColor, {
|
||||
name: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Name'),
|
||||
hint: game.i18n.localize('DAGGERHEART.Settings.DualityRollColor.Hint'),
|
||||
scope: 'world',
|
||||
config: true,
|
||||
type: Number,
|
||||
choices: Object.values(DualityRollColor),
|
||||
default: DualityRollColor.colorful.value
|
||||
});
|
||||
|
||||
game.settings.registerMenu(SYSTEM.id, SYSTEM.SETTINGS.menu.Automation.Name, {
|
||||
name: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Name'),
|
||||
label: game.i18n.localize('DAGGERHEART.Settings.Menu.Automation.Label'),
|
||||
|
|
|
|||
60
module/applications/sheets/feature.mjs
Normal file → Executable file
60
module/applications/sheets/feature.mjs
Normal file → Executable file
|
|
@ -12,7 +12,8 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
|
|||
|
||||
static DEFAULT_OPTIONS = {
|
||||
tag: 'form',
|
||||
classes: ['daggerheart', 'sheet', 'feature'],
|
||||
id: 'daggerheart-feature',
|
||||
classes: ['daggerheart', 'sheet', 'dh-style', 'feature'],
|
||||
position: { width: 600, height: 600 },
|
||||
window: { resizable: true },
|
||||
actions: {
|
||||
|
|
@ -30,17 +31,57 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
|
|||
};
|
||||
|
||||
static PARTS = {
|
||||
form: {
|
||||
id: 'feature',
|
||||
template: 'systems/daggerheart/templates/sheets/feature.hbs'
|
||||
header: { template: 'systems/daggerheart/templates/sheets/items/feature/header.hbs' },
|
||||
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
||||
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
|
||||
actions: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/feature/actions.hbs',
|
||||
scrollable: ['.actions']
|
||||
},
|
||||
settings: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/feature/settings.hbs',
|
||||
scrollable: ['.settings']
|
||||
},
|
||||
effects: {
|
||||
template: 'systems/daggerheart/templates/sheets/items/feature/effects.hbs',
|
||||
scrollable: ['.effects']
|
||||
}
|
||||
};
|
||||
|
||||
_getTabs() {
|
||||
const tabs = {
|
||||
features: { active: true, cssClass: '', group: 'primary', id: 'features', icon: null, label: 'Features' },
|
||||
effects: { active: false, cssClass: '', group: 'primary', id: 'effects', icon: null, label: 'Effects' },
|
||||
actions: { active: false, cssClass: '', group: 'primary', id: 'actions', icon: null, label: 'Actions' }
|
||||
description: {
|
||||
active: true,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'description',
|
||||
icon: null,
|
||||
label: 'DAGGERHEART.Sheets.Feature.Tabs.Description'
|
||||
},
|
||||
actions: {
|
||||
active: false,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'actions',
|
||||
icon: null,
|
||||
label: 'DAGGERHEART.Sheets.Feature.Tabs.Actions'
|
||||
},
|
||||
settings: {
|
||||
active: false,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'settings',
|
||||
icon: null,
|
||||
label: 'DAGGERHEART.Sheets.Feature.Tabs.Settings'
|
||||
},
|
||||
effects: {
|
||||
active: false,
|
||||
cssClass: '',
|
||||
group: 'primary',
|
||||
id: 'effects',
|
||||
icon: null,
|
||||
label: 'DAGGERHEART.Sheets.Feature.Tabs.Effects'
|
||||
}
|
||||
};
|
||||
for (const v of Object.values(tabs)) {
|
||||
v.active = this.tabGroups[v.group] ? this.tabGroups[v.group] === v.id : v.active;
|
||||
|
|
@ -58,7 +99,8 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
|
|||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
context.document = this.document;
|
||||
(context.tabs = this._getTabs()), (context.generalConfig = SYSTEM.GENERAL);
|
||||
context.tabs = this._getTabs();
|
||||
context.generalConfig = SYSTEM.GENERAL;
|
||||
context.itemConfig = SYSTEM.ITEM;
|
||||
context.properties = SYSTEM.ACTOR.featureProperties;
|
||||
context.dice = SYSTEM.GENERAL.diceTypes;
|
||||
|
|
@ -98,7 +140,7 @@ export default class FeatureSheet extends DaggerheartSheet(ItemSheetV2) {
|
|||
}
|
||||
|
||||
static async addAction() {
|
||||
const action = await new DaggerheartAction({}, { parent: this.document });
|
||||
const action = await new DaggerheartAction({ img: this.document.img }, { parent: this.document });
|
||||
await this.document.update({ 'system.actions': [...this.document.system.actions, action] });
|
||||
await new DaggerheartActionConfig(this.document.system.actions[this.document.system.actions.length - 1]).render(
|
||||
true
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue