@@ -1015,6 +1015,14 @@ function addLabels(app, html, data) {
1015
1015
html . find ( ".skills-list" ) . addClass ( "custom-skills" ) ;
1016
1016
html . find ( ".ability-scores" ) . addClass ( "custom-abilities" ) ;
1017
1017
}
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
+ }
1018
1026
1019
1027
const skillList = CustomSkills . getCustomSkillList ( ) ;
1020
1028
const hiddenSkills = CustomSkills . getHiddenSkills ( ) ;
@@ -1027,7 +1035,7 @@ function addLabels(app, html, data) {
1027
1035
html . find ( skillRowSelector ) . each ( function ( ) {
1028
1036
const skillElem = $ ( this ) ;
1029
1037
let skillKey = $ ( this ) . attr ( "data-skill" ) ;
1030
- if ( dndV3 ) {
1038
+ if ( sheetVersion == 'legacy' ) {
1031
1039
skillKey = $ ( this ) . attr ( "data-key" ) ;
1032
1040
}
1033
1041
// if this skill is created by this module..
@@ -1041,7 +1049,7 @@ function addLabels(app, html, data) {
1041
1049
/** hide skills **/
1042
1050
for ( let hs in hiddenSkills ) {
1043
1051
if ( hiddenSkills [ hs ] ) {
1044
- if ( dndV3 ) {
1052
+ if ( sheetVersion == 'dnd2' ) {
1045
1053
$ ( '.skills li[data-key="' + hs + '"]' , html ) . addClass ( 'disabled' ) ;
1046
1054
} else {
1047
1055
$ ( '.skills-list .skill[data-key="' + hs + '"]' , html ) . addClass ( 'disabled' ) ;
@@ -1052,10 +1060,12 @@ function addLabels(app, html, data) {
1052
1060
/** hide abilities **/
1053
1061
for ( let ha in hiddenAbilities ) {
1054
1062
if ( hiddenAbilities [ ha ] ) {
1055
- if ( dndV3 ) {
1063
+ if ( sheetVersion == 'dnd2' ) {
1056
1064
$ ( '.ability-scores .ability-score[data-ability ="' + ha + '"]' , html ) . addClass ( 'disabled' ) ;
1057
- } else {
1065
+ } else if ( sheetVersion == 'legacy' ) {
1058
1066
$ ( '.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' ) ;
1059
1069
}
1060
1070
1061
1071
}
0 commit comments