Fix the sliders to do the correct maximums

This commit is contained in:
Chris Ryan 2026-01-17 12:11:21 +10:00
parent a071626e43
commit 2c93defd9c
3 changed files with 4 additions and 3 deletions

View file

@ -41,6 +41,8 @@ export default class RiskItAllDialog extends HandlebarsApplicationMixin(Applicat
async _prepareContext(_options) {
const context = await super._prepareContext(_options);
context.resourceValue = this.resourceValue;
context.maxHitPointsValue = Math.min(this.resourceValue, this.actor.system.resources.hitPoints.max);
context.maxStressValue = Math.min(this.resourceValue, this.actor.system.resources.stress.max);
context.remainingResource = this.resourceValue - this.choices.hitPoints - this.choices.stress;
context.unfinished = context.remainingResource !== 0;

View file

@ -45,7 +45,6 @@ function getFateMessage(roll, flavor) {
export const renderFateButton = async event => {
const button = event.currentTarget,
target = getCommandTarget({ allowNull: true });
console.log('button', button);
const fateTypeData = getFateTypeData(button.dataset?.fatetype);