Skip to content

Commit 332c5cf

Browse files
committed
1.4.20
legacy + tidy sheets compatibilty
1 parent 4bdf011 commit 332c5cf

4 files changed

+23
-6
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121
- v1.2.1: fix a bug with new ability object in module configuration
2222
- v1.3.0: dnd5e v3+ compatibility
2323
- v1.4.1: FoundryVTT v12 compatibility
24+
- v1.4.20: Restore legacy sheet compatibility, add new tidy sheet compatibility

css/dnd5e-custom-skills.css

+6
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ form .form-group.hide-skills input {
147147
display: none;
148148
}
149149

150+
/** tidy **/
151+
.tidy5e-sheet .actor-stats .disabled,
152+
.tidy5e-sheet .actor-stats .disabled+.vertical-line-separator {
153+
display: none;
154+
}
155+
150156
#skills-form button.requireSave {
151157
background: orange;
152158
}

dnd5e-custom-skills.js

+14-4
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,14 @@ function addLabels(app, html, data) {
10151015
html.find(".skills-list").addClass("custom-skills");
10161016
html.find(".ability-scores").addClass("custom-abilities");
10171017
}
1018+
let sheetVersion = '';
1019+
if (html.hasClass('dnd5e2')) {
1020+
sheetVersion = 'dnd2';
1021+
} else if (html.hasClass('dnd5e')) {
1022+
sheetVersion = 'legacy';
1023+
} else if (html.hasClass('tidy5e-sheet')) {
1024+
sheetVersion = 'tidy';
1025+
}
10181026

10191027
const skillList = CustomSkills.getCustomSkillList();
10201028
const hiddenSkills = CustomSkills.getHiddenSkills();
@@ -1027,7 +1035,7 @@ function addLabels(app, html, data) {
10271035
html.find(skillRowSelector).each(function () {
10281036
const skillElem = $(this);
10291037
let skillKey = $(this).attr("data-skill");
1030-
if (dndV3) {
1038+
if (sheetVersion == 'legacy') {
10311039
skillKey = $(this).attr("data-key");
10321040
}
10331041
// if this skill is created by this module..
@@ -1041,7 +1049,7 @@ function addLabels(app, html, data) {
10411049
/** hide skills **/
10421050
for (let hs in hiddenSkills) {
10431051
if (hiddenSkills[hs]) {
1044-
if (dndV3) {
1052+
if (sheetVersion == 'dnd2') {
10451053
$('.skills li[data-key="' + hs + '"]', html).addClass('disabled');
10461054
} else {
10471055
$('.skills-list .skill[data-key="' + hs + '"]', html).addClass('disabled');
@@ -1052,10 +1060,12 @@ function addLabels(app, html, data) {
10521060
/** hide abilities **/
10531061
for (let ha in hiddenAbilities) {
10541062
if (hiddenAbilities[ha]) {
1055-
if (dndV3) {
1063+
if (sheetVersion == 'dnd2') {
10561064
$('.ability-scores .ability-score[data-ability ="' + ha + '"]', html).addClass('disabled');
1057-
} else {
1065+
} else if (sheetVersion == 'legacy') {
10581066
$('.ability-scores .ability[data-ability ="' + ha + '"]', html).addClass('disabled');
1067+
} else if (sheetVersion == 'tidy') {
1068+
$('.actor-stats .wrapper[data-ability ="' + ha + '"]', html).parent().addClass('disabled');
10591069
}
10601070

10611071
}

module.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "dnd5e-custom-skills",
33
"title": "5e - Custom Abilities & Skills",
44
"description": "FoundryVTT module for adding new character skills and abilities",
5-
"version": "1.4.1",
5+
"version": "1.4.20",
66
"compatibility": {
77
"minimum": "12",
88
"verified": "12.324"
@@ -56,4 +56,4 @@
5656
"flags": {}
5757
}
5858
]
59-
}
59+
}

0 commit comments

Comments
 (0)