This commit is contained in:
Dapoolp 2025-06-13 21:36:56 +02:00
parent a040beab13
commit ca6dc047eb
8 changed files with 71 additions and 85 deletions

View file

@ -11,9 +11,7 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
const html = await super.renderHTML();
if (
this.type === 'dualityRoll' &&
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
DualityRollColor.colorful.value
this.type === 'dualityRoll'
) {
html.classList.add('duality');
const dualityResult = this.system.dualityResult;

View file

@ -67,7 +67,7 @@ export default class DHAppearanceSettings extends HandlebarsApplicationMixin(App
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);
document.body.classList.toggle('theme-colorful', game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme === DualityRollColor.colorful.value);
this.close();
}

View file

@ -59,8 +59,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
}),
{ nullable: true, initial: null }
)
}),
forceDisplay: new fields.BooleanField({initial: false})
})
};
}
@ -69,6 +68,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
}
get modifierTotal() {
// return {value: 12, label: "+12"}
const total = this.modifiers.reduce((acc, x) => acc + x.value, 0);
return {
value: total,
@ -97,7 +97,7 @@ export default class DHDualityRoll extends foundry.abstract.TypeDataModel {
get colorful() {
return (
!this.forceDisplay && game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
game.settings.get(SYSTEM.id, SYSTEM.SETTINGS.gameSettings.appearance).dualityColorScheme ===
DualityRollColor.colorful.value
);
}

View file

@ -272,17 +272,9 @@ 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;
}