From f66ac84c0b9c6e1d55c1a8757a1aa35c5f56d0a5 Mon Sep 17 00:00:00 2001 From: "Tim Evans (slaguru666)" Date: Tue, 19 May 2026 22:20:00 +0100 Subject: [PATCH] Skill roll dialog: scrollable list replaces fixed pixel height - Remove manual dialogHeight pixel counter (was error-prone) - Wrap skill list in scrollable div (max-height 340px, overflow-y auto) - Long skill lists no longer push action buttons off-screen --- module/actor/actor.js | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/module/actor/actor.js b/module/actor/actor.js index 0f13764..7a63d3d 100644 --- a/module/actor/actor.js +++ b/module/actor/actor.js @@ -1729,8 +1729,6 @@ export class MothershipActor extends Actor { let skillList = ``; //create skill counter let skillCount = 0; - //create dialog pixel counter - let dialogHeight = 232; //loop through and create skill rows const filteredSkills = playerItems.filter((item) => item.type === "skill" && this.isSkillRelevantForContext(item, context)); const skillSource = filteredSkills.length @@ -1758,13 +1756,9 @@ export class MothershipActor extends Actor { skillList = skillList + tempRow; //increment skill count skillCount++; - //increment pixel counter - dialogHeight = dialogHeight + 77; } - //check if there are no skills, and adjust prompt height accordingly + //check if there are no skills if (skillCount === 0) { - //set window height - dialogHeight = 170; skillList = `
${requiresCombatSkills ? "No combat-tagged skills are available for this action." : "No matching skills are available for this action."}
`; } //create button header if needed @@ -1773,12 +1767,14 @@ export class MothershipActor extends Actor { } else { buttonDesc = ``; } + //wrap skill list in a scrollable container so long lists don't push buttons off-screen + const scrollableSkillList = `
${skillList}
`; //create final dialog data const dialogData = { window: {title: dlgTitle}, classes: ["macro-popup-dialog"], position: {width: 600}, - content: skillHeader + skillList + buttonDesc, + content: skillHeader + scrollableSkillList + buttonDesc, buttons: [] }; //add adv/normal/dis buttons if we need a rollString