mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 19:51:08 +01:00
duality tpl
This commit is contained in:
parent
21b528e56c
commit
36bbfc52fb
10 changed files with 990 additions and 511 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import DhAppearance from '../../data/settings/Appearance.mjs';
|
||||
import DhAppearance, { DualityRollColor } from '../../data/settings/Appearance.mjs';
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
|||
|
||||
static async save() {
|
||||
await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, this.settings.toObject());
|
||||
const reload = await foundry.applications.api.DialogV2.confirm({
|
||||
/* const reload = await foundry.applications.api.DialogV2.confirm({
|
||||
id: 'reload-world-confirm',
|
||||
modal: true,
|
||||
rejectClose: false,
|
||||
|
|
@ -66,7 +66,8 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
|||
if (reload) {
|
||||
await game.socket.emit('reload');
|
||||
foundry.utils.debouncedReload();
|
||||
}
|
||||
} */
|
||||
document.body.classList.toggle('theme-colorfull', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value);
|
||||
|
||||
this.close();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,7 +105,11 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
|||
}
|
||||
|
||||
get chatTemplate() {
|
||||
return 'systems/daggerheart/templates/chat/attack-roll.hbs';
|
||||
return 'systems/daggerheart/templates/chat/duality-roll.hbs';
|
||||
}
|
||||
|
||||
get chatTitle() {
|
||||
return this.item.name;
|
||||
}
|
||||
|
||||
static getRollType() {
|
||||
|
|
@ -132,7 +136,7 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
|||
const modifierValue = this.actor.system.traits[this.roll.trait].value;
|
||||
const config = {
|
||||
event: event,
|
||||
title: this.item.name,
|
||||
title: this.chatTitle,
|
||||
roll: {
|
||||
modifier: modifierValue,
|
||||
label: game.i18n.localize(abilities[this.roll.trait].label),
|
||||
|
|
@ -200,6 +204,12 @@ export class DHAttackAction extends DHBaseAction {
|
|||
return 'weapon';
|
||||
}
|
||||
|
||||
get chatTitle() {
|
||||
return game.i18n.format('DAGGERHEART.Chat.AttackRoll.Title', {
|
||||
attack: this.item.name
|
||||
});
|
||||
}
|
||||
|
||||
prepareData() {
|
||||
super.prepareData();
|
||||
if (this.damage.includeBase && !!this.item?.system?.damage) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,8 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
|
|||
}),
|
||||
{ nullable: true, initial: null }
|
||||
)
|
||||
})
|
||||
}),
|
||||
forceDisplay: new fields.BooleanField({initial: false})
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -96,7 +97,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
|
|||
|
||||
get colorful() {
|
||||
return (
|
||||
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
|
||||
!this.forceDisplay && game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
|
||||
DualityRollColor.colorful.value
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -272,9 +272,17 @@ export default class DhpActor extends Actor {
|
|||
system: systemData,
|
||||
content: config.chatMessage.template,
|
||||
rolls: [roll]
|
||||
}),
|
||||
msg2 = new cls({
|
||||
type: config.chatMessage.type ?? 'dualityRoll',
|
||||
sound: config.chatMessage.mute ? null : CONFIG.sounds.dice,
|
||||
system: {...systemData, forceDisplay: true },
|
||||
content: config.chatMessage.template,
|
||||
rolls: [roll]
|
||||
});
|
||||
|
||||
await cls.create(msg.toObject());
|
||||
await cls.create(msg2.toObject());
|
||||
}
|
||||
return roll;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue