From 996a1a377d3d24c4e856c92e62d74c8638234fca Mon Sep 17 00:00:00 2001 From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com> Date: Sat, 15 Feb 2025 23:07:22 -0800 Subject: [PATCH] npc, unnatural sorting by column working better --- css/deltagreen.css | 2 +- module/actor/actor-sheet.js | 20 +++++++++++--- templates/actor/actor-sheet.html | 4 +-- templates/actor/npc-sheet.html | 4 +-- .../actor/partials/custom-skills-partial.html | 26 ++++++++++++------- 5 files changed, 37 insertions(+), 19 deletions(-) diff --git a/css/deltagreen.css b/css/deltagreen.css index 4e5c568..6350c23 100644 --- a/css/deltagreen.css +++ b/css/deltagreen.css @@ -457,7 +457,7 @@ explicitly define a number of rows, rather than columns. */ } .deltagreen .skill-and-training-controls { - flex: 0 0 80px; + flex: 0 0 35px; } .deltagreen .action-pill { diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index d0bd5a6..296dc21 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -79,16 +79,28 @@ export default class DeltaGreenActorSheet extends ActorSheet { skill.sortLabel = skill.label; } - sortedSkills.push(skill); + if ( + !( + (this.actor.type == "npc" || this.actor.type == "unnatural") && + this.actor.system.showUntrainedSkills == true && + skill.proficiency < 1 + ) + ) { + sortedSkills.push(skill); + } } - //console.log(sortedSkills); - sortedSkills.sort(function (a, b) { return a.sortLabel.localeCompare(b.sortLabel, game.i18n.lang); }); - this.actor.system.sortedSkills = sortedSkills; + if (game.settings.get("deltagreen", "sortSkills")) { + let columnSortedSkills = this.reorderForColumnSorting(sortedSkills, 3); + + this.actor.system.sortedSkills = columnSortedSkills; + } else { + this.actor.system.sortedSkills = sortedSkills; + } // Prepare a simplified version of the special training for display on sheet. if (this.actor.type !== "vehicle") { diff --git a/templates/actor/actor-sheet.html b/templates/actor/actor-sheet.html index 3dba891..8f6ffb7 100644 --- a/templates/actor/actor-sheet.html +++ b/templates/actor/actor-sheet.html @@ -96,9 +96,9 @@ {{localize "DG.Sheet.BlockHeaders.SkillsAndTraining"}} -