mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 13:11:08 +01:00
h
This commit is contained in:
parent
187ee3e1bd
commit
1e31aba8d6
4 changed files with 18 additions and 8 deletions
|
|
@ -14,6 +14,7 @@ import { getCommandTarget, rollCommandToJSON, setDiceSoNiceForDualityRoll } from
|
||||||
import { abilities } from './module/config/actorConfig.mjs';
|
import { abilities } from './module/config/actorConfig.mjs';
|
||||||
import Resources from './module/applications/resources.mjs';
|
import Resources from './module/applications/resources.mjs';
|
||||||
import DHDualityRoll from './module/data/chat-message/dualityRoll.mjs';
|
import DHDualityRoll from './module/data/chat-message/dualityRoll.mjs';
|
||||||
|
import { DualityRollColor } from './module/data/settings/Appearance.mjs';
|
||||||
|
|
||||||
globalThis.SYSTEM = SYSTEM;
|
globalThis.SYSTEM = SYSTEM;
|
||||||
|
|
||||||
|
|
@ -106,6 +107,7 @@ Hooks.once('init', () => {
|
||||||
Hooks.on('ready', () => {
|
Hooks.on('ready', () => {
|
||||||
ui.resources = new CONFIG.ui.resources();
|
ui.resources = new CONFIG.ui.resources();
|
||||||
if(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.DisplayFear) !== 'hide') ui.resources.render({ force: true });
|
if(game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.Resources.DisplayFear) !== 'hide') ui.resources.render({ force: true });
|
||||||
|
document.body.classList.toggle('theme-colorful', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value);
|
||||||
});
|
});
|
||||||
|
|
||||||
Hooks.once('dicesoniceready', () => {});
|
Hooks.once('dicesoniceready', () => {});
|
||||||
|
|
|
||||||
|
|
@ -11,9 +11,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const html = await super.renderHTML();
|
const html = await super.renderHTML();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.type === 'dualityRoll' &&
|
this.type === 'dualityRoll'
|
||||||
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
|
|
||||||
DualityRollColor.colorful.value
|
|
||||||
) {
|
) {
|
||||||
html.classList.add('duality');
|
html.classList.add('duality');
|
||||||
const dualityResult = this.system.dualityResult;
|
const dualityResult = this.system.dualityResult;
|
||||||
|
|
|
||||||
|
|
@ -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;
|
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
||||||
|
|
||||||
static async save() {
|
static async save() {
|
||||||
await game.settings.set(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance, this.settings.toObject());
|
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',
|
id: 'reload-world-confirm',
|
||||||
modal: true,
|
modal: true,
|
||||||
rejectClose: false,
|
rejectClose: false,
|
||||||
|
|
@ -66,7 +66,8 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
|
||||||
if (reload) {
|
if (reload) {
|
||||||
await game.socket.emit('reload');
|
await game.socket.emit('reload');
|
||||||
foundry.utils.debouncedReload();
|
foundry.utils.debouncedReload();
|
||||||
}
|
} */
|
||||||
|
document.body.classList.toggle('theme-colorful', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value);
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,10 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
get chatTemplate() {
|
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() {
|
static getRollType() {
|
||||||
|
|
@ -132,7 +135,7 @@ export class DHBaseAction extends foundry.abstract.DataModel {
|
||||||
const modifierValue = this.actor.system.traits[this.roll.trait].value;
|
const modifierValue = this.actor.system.traits[this.roll.trait].value;
|
||||||
const config = {
|
const config = {
|
||||||
event: event,
|
event: event,
|
||||||
title: this.item.name,
|
title: this.chatTitle,
|
||||||
roll: {
|
roll: {
|
||||||
modifier: modifierValue,
|
modifier: modifierValue,
|
||||||
label: game.i18n.localize(abilities[this.roll.trait].label),
|
label: game.i18n.localize(abilities[this.roll.trait].label),
|
||||||
|
|
@ -199,6 +202,12 @@ export class DHAttackAction extends DHBaseAction {
|
||||||
static getRollType() {
|
static getRollType() {
|
||||||
return 'weapon';
|
return 'weapon';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
get chatTitle() {
|
||||||
|
return game.i18n.format('DAGGERHEART.Chat.AttackRoll.Title', {
|
||||||
|
attack: this.item.name
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
prepareData() {
|
prepareData() {
|
||||||
super.prepareData();
|
super.prepareData();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue