-
-
+
+
+
+
+
+
{{/if_eq}}
{{/each}}
From 0789d3741ffe23e19de22348d6959fef51748c72 Mon Sep 17 00:00:00 2001
From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com>
Date: Sat, 15 Feb 2025 23:18:33 -0800
Subject: [PATCH 3/6] fix vehicles
---
module/actor/actor-sheet.js | 122 +++++++++++++++++++-----------------
1 file changed, 66 insertions(+), 56 deletions(-)
diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js
index 296dc21..a6d4694 100644
--- a/module/actor/actor-sheet.js
+++ b/module/actor/actor-sheet.js
@@ -70,38 +70,43 @@ export default class DeltaGreenActorSheet extends ActorSheet {
// Make it easy for the sheet handlebars to understand how to sort the skills.
data.sortSkillsSetting = game.settings.get("deltagreen", "sortSkills");
- let sortedSkills = [];
- for (const [key, skill] of Object.entries(this.actor.system.skills)) {
- skill.key = key;
- skill.sortLabel = game.i18n.localize(`DG.Skills.${key}`);
+ if (this.actor.type !== "vehicle") {
+ // fill an array that is sorted based on the appropriate localized entry
+ let sortedSkills = [];
+ for (const [key, skill] of Object.entries(this.actor.system.skills)) {
+ skill.key = key;
+ skill.sortLabel = game.i18n.localize(`DG.Skills.${key}`);
- if (skill.sortLabel === "" || skill.sortLabel === `DG.Skills.${key}`) {
- skill.sortLabel = skill.label;
+ if (skill.sortLabel === "" || skill.sortLabel === `DG.Skills.${key}`) {
+ skill.sortLabel = skill.label;
+ }
+
+ // if the actor is an NPC or Unnatural, and they have 'hide untrained skills' active,
+ // it will break the sorting logic, so we have to skip over these
+ if (
+ !(
+ (this.actor.type == "npc" || this.actor.type == "unnatural") &&
+ this.actor.system.showUntrainedSkills == true &&
+ skill.proficiency < 1
+ )
+ ) {
+ sortedSkills.push(skill);
+ }
}
- if (
- !(
- (this.actor.type == "npc" || this.actor.type == "unnatural") &&
- this.actor.system.showUntrainedSkills == true &&
- skill.proficiency < 1
- )
- ) {
- sortedSkills.push(skill);
+ sortedSkills.sort(function (a, b) {
+ return a.sortLabel.localeCompare(b.sortLabel, game.i18n.lang);
+ });
+
+ // if sorting by columns, re-arrange the array to be columns first, then rows
+ if (game.settings.get("deltagreen", "sortSkills")) {
+ let columnSortedSkills = this.reorderForColumnSorting(sortedSkills, 3);
+
+ this.actor.system.sortedSkills = columnSortedSkills;
+ } else {
+ this.actor.system.sortedSkills = sortedSkills;
}
}
-
- sortedSkills.sort(function (a, b) {
- return a.sortLabel.localeCompare(b.sortLabel, game.i18n.lang);
- });
-
- 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") {
const specialTraining = this.actor.system.specialTraining.map(
@@ -141,45 +146,50 @@ export default class DeltaGreenActorSheet extends ActorSheet {
data.specialTraining = specialTraining;
}
- // try to make a combined array of both typed skills and special trainings, so that it can be sorted neatly on the sheet
- let sortedCustomSkills = [];
+ // try to make a combined array of both typed skills and special trainings,
+ // so that it can be sorted together neatly on the sheet
+ if (this.actor.type !== "vehicle") {
+ let sortedCustomSkills = [];
- for (const [key, skill] of Object.entries(this.actor.system.typedSkills)) {
- skill.type = "typeSkill";
- skill.key = key;
- skill.sortLabel = skill.group + "." + skill.label;
+ for (const [key, skill] of Object.entries(
+ this.actor.system.typedSkills
+ )) {
+ skill.type = "typeSkill";
+ skill.key = key;
+ skill.sortLabel = skill.group + "." + skill.label;
- skill.sortLabel = skill.sortLabel.toUpperCase();
+ skill.sortLabel = skill.sortLabel.toUpperCase();
- if (skill.sortLabel === "" || skill.sortLabel === `DG.Skills.${key}`) {
- skill.sortLabel = skill.label;
+ if (skill.sortLabel === "" || skill.sortLabel === `DG.Skills.${key}`) {
+ skill.sortLabel = skill.label;
+ }
+
+ sortedCustomSkills.push(skill);
}
- sortedCustomSkills.push(skill);
- }
+ for (var i = 0; i < data.specialTraining.length; i++) {
+ let training = data.specialTraining[i];
- for (var i = 0; i < data.specialTraining.length; i++) {
- let training = data.specialTraining[i];
+ training.type = "training";
+ training.sortLabel = training.name.toUpperCase();
- training.type = "training";
- training.sortLabel = training.name.toUpperCase();
+ sortedCustomSkills.push(training);
+ }
- sortedCustomSkills.push(training);
- }
+ sortedCustomSkills.sort(function (a, b) {
+ return a.sortLabel.localeCompare(b.sortLabel, game.i18n.lang);
+ });
- sortedCustomSkills.sort(function (a, b) {
- return a.sortLabel.localeCompare(b.sortLabel, game.i18n.lang);
- });
+ if (game.settings.get("deltagreen", "sortSkills")) {
+ let columnSortedSkills = this.reorderForColumnSorting(
+ sortedCustomSkills,
+ 2
+ );
- if (game.settings.get("deltagreen", "sortSkills")) {
- let columnSortedSkills = this.reorderForColumnSorting(
- sortedCustomSkills,
- 2
- );
-
- this.actor.system.sortedCustomSkills = columnSortedSkills;
- } else {
- this.actor.system.sortedCustomSkills = sortedCustomSkills;
+ this.actor.system.sortedCustomSkills = columnSortedSkills;
+ } else {
+ this.actor.system.sortedCustomSkills = sortedCustomSkills;
+ }
}
switch (this.actor.type) {
From 4b7c0e7dd6160aaac41c7dc6567a237005c930c7 Mon Sep 17 00:00:00 2001
From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com>
Date: Sun, 16 Feb 2025 12:18:18 -0800
Subject: [PATCH 4/6] forgot to update contribution
---
README.md | 1 +
1 file changed, 1 insertion(+)
diff --git a/README.md b/README.md
index 8c6e196..7b76c66 100644
--- a/README.md
+++ b/README.md
@@ -88,6 +88,7 @@ The roll tables added to generate operation code names comes from Reddit user /u
- Spanish Translation submitted by [CthulhuRol](https://github.com/CthulhuRol)
- Catalonian Translation submitted by [trombonecot](https://github.com/trombonecot)
- French Translation submitted by [Hrunh](https://github.com/Hrunh)
+- Japanese Translation submitted by [ryotai-trpg](https://github.com/ryotai-trpg)
## Fonts (Some in use, others that I would like to use at some point)
From dc3c94fc52eb16199679fb65da94b045f2d76184 Mon Sep 17 00:00:00 2001
From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com>
Date: Sun, 16 Feb 2025 18:30:42 -0800
Subject: [PATCH 5/6] lost type skill check boxes
---
module/actor/actor-sheet.js | 3 ++-
templates/actor/partials/custom-skills-partial.html | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js
index a6d4694..cad0e04 100644
--- a/module/actor/actor-sheet.js
+++ b/module/actor/actor-sheet.js
@@ -157,8 +157,8 @@ export default class DeltaGreenActorSheet extends ActorSheet {
skill.type = "typeSkill";
skill.key = key;
skill.sortLabel = skill.group + "." + skill.label;
-
skill.sortLabel = skill.sortLabel.toUpperCase();
+ skill.actorType = this.actor.type;
if (skill.sortLabel === "" || skill.sortLabel === `DG.Skills.${key}`) {
skill.sortLabel = skill.label;
@@ -172,6 +172,7 @@ export default class DeltaGreenActorSheet extends ActorSheet {
training.type = "training";
training.sortLabel = training.name.toUpperCase();
+ training.actorType = this.actor.type;
sortedCustomSkills.push(training);
}
diff --git a/templates/actor/partials/custom-skills-partial.html b/templates/actor/partials/custom-skills-partial.html
index 1214927..fe2a3fa 100644
--- a/templates/actor/partials/custom-skills-partial.html
+++ b/templates/actor/partials/custom-skills-partial.html
@@ -21,7 +21,7 @@
- {{#if_eq ../actorType "agent"}}
+ {{#if_eq skill.actorType "agent"}}
{{/if_eq}}
From f10c7583e6d5cba9c9e6c8dcc066dbe054ea6201 Mon Sep 17 00:00:00 2001
From: TheLastScrub <67403321+TheLastScrub@users.noreply.github.com>
Date: Sun, 16 Feb 2025 18:38:02 -0800
Subject: [PATCH 6/6] change input text back to center aligned
---
css/deltagreen.css | 1 +
1 file changed, 1 insertion(+)
diff --git a/css/deltagreen.css b/css/deltagreen.css
index 6350c23..43e224f 100644
--- a/css/deltagreen.css
+++ b/css/deltagreen.css
@@ -525,6 +525,7 @@ input.percentile-skill-input {
margin-left: 5px;
height: unset;
align-self: center;
+ text-align: center !important;
}
input.checkbox-skill-input {