mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
23 lines
1,006 B
JavaScript
23 lines
1,006 B
JavaScript
import { DualityRollColor } from '../data/settings/Appearance.mjs';
|
|
import DHDualityRoll from '../data/chat-message/dualityRoll.mjs';
|
|
|
|
export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
|
async 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.appearance).dualityColorScheme ===
|
|
DualityRollColor.colorful.value
|
|
) {
|
|
html.classList.add('duality');
|
|
const dualityResult = this.system.dualityResult;
|
|
if (dualityResult === DHDualityRoll.dualityResult.hope) html.classList.add('hope');
|
|
else if (dualityResult === DHDualityRoll.dualityResult.fear) html.classList.add('fear');
|
|
else html.classList.add('critical');
|
|
}
|
|
|
|
return html;
|
|
}
|
|
}
|